Class: Ansible::Ruby::Modules::Aws_s3
- Inherits:
-
Base
- Object
- Ansible::Ruby::Models::Base
- Base
- Ansible::Ruby::Modules::Aws_s3
- Defined in:
- lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb
Overview
This module allows the user to manage S3 buckets and the objects within them. Includes support for creating and deleting both objects and buckets, retrieving objects as files or strings and generating download links. This module has a dependency on boto3 and botocore.
Instance Method Summary collapse
-
#aws_access_key ⇒ Object?
AWS access key id.
-
#aws_secret_key ⇒ Object?
AWS secret key.
-
#bucket ⇒ String
Bucket name.
-
#dest ⇒ String?
The destination file path when downloading an object/key with a GET operation.
-
#dualstack ⇒ :yes, ...
Enables Amazon S3 Dual-Stack Endpoints, allowing S3 communications using both IPv4 and IPv6.,Requires at least botocore version 1.4.45.
-
#encrypt ⇒ Boolean?
When set for PUT mode, asks for server-side encryption.
-
#encryption_kms_key_id ⇒ Object?
KMS key id to use when encrypting objects using C(aws:kms) encryption.
-
#encryption_mode ⇒ :AES256, ...
What encryption mode to use if C(encrypt) is set.
-
#expiration ⇒ Integer?
Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a mode=put or mode=geturl operation.
-
#headers ⇒ String?
Custom headers for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
-
#ignore_nonexistent_bucket ⇒ Object?
Overrides initial bucket lookups in case bucket or iam policies are restrictive.
-
#marker ⇒ String?
Specifies the key to start with when using list mode.
-
#max_keys ⇒ Integer?
Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys.
-
#metadata ⇒ Array<String>, ...
Metadata for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
-
#mode ⇒ :get, ...
Switches the module behaviour between put (upload), get (download), geturl (return download url, Ansible 1.3+), getstr (download object as string (1.3+)), list (list keys, Ansible 2.0+), create (bucket), delete (bucket), and delobj (delete object, Ansible 2.0+).
-
#object ⇒ String?
Keyname of the object inside the bucket.
-
#overwrite ⇒ String?
Force overwrite either locally on the filesystem or remotely with the object/key.
-
#permission ⇒ String?
This option lets the user set the canned permissions on the object/bucket that are created.
-
#prefix ⇒ String?
Limits the response to keys that begin with the specified prefix for list mode.
-
#region ⇒ String?
AWS region to create the bucket in.
-
#retries ⇒ Integer?
On recoverable failure, how many times to retry before actually failing.
-
#rgw ⇒ Boolean?
Enable Ceph RGW S3 support.
-
#s3_url ⇒ String?
S3 URL endpoint for usage with Ceph, Eucalypus, fakes3, etc.
-
#src ⇒ String?
The source file path when performing a PUT operation.
-
#version ⇒ String?
Version ID of the object inside the bucket.
Methods inherited from Base
Methods inherited from Ansible::Ruby::Models::Base
attr_option, attr_options, attribute, fix_inclusion, #initialize, remove_existing_validations, #to_h, validates
Constructor Details
This class inherits a constructor from Ansible::Ruby::Models::Base
Instance Method Details
#aws_access_key ⇒ Object?
Returns AWS access key id. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
12 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 12 attribute :aws_access_key |
#aws_secret_key ⇒ Object?
Returns AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
15 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 15 attribute :aws_secret_key |
#bucket ⇒ String
Returns Bucket name.
18 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 18 attribute :bucket |
#dest ⇒ String?
Returns The destination file path when downloading an object/key with a GET operation.
22 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 22 attribute :dest |
#dualstack ⇒ :yes, ...
Returns Enables Amazon S3 Dual-Stack Endpoints, allowing S3 communications using both IPv4 and IPv6.,Requires at least botocore version 1.4.45.
90 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 90 attribute :dualstack |
#encrypt ⇒ Boolean?
Returns When set for PUT mode, asks for server-side encryption.
26 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 26 attribute :encrypt |
#encryption_kms_key_id ⇒ Object?
Returns KMS key id to use when encrypting objects using C(aws:kms) encryption. Ignored if encryption is not C(aws:kms).
105 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 105 attribute :encryption_kms_key_id |
#encryption_mode ⇒ :AES256, ...
Returns What encryption mode to use if C(encrypt) is set.
30 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 30 attribute :encryption_mode |
#expiration ⇒ Integer?
Returns Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a mode=put or mode=geturl operation.
34 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 34 attribute :expiration |
#headers ⇒ String?
Returns Custom headers for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
38 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 38 attribute :headers |
#ignore_nonexistent_bucket ⇒ Object?
Returns Overrides initial bucket lookups in case bucket or iam policies are restrictive. Example: a user may have the GetObject permission but no other permissions. In this case using the option mode: get will fail without specifying ignore_nonexistent_bucket: True.
102 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 102 attribute :ignore_nonexistent_bucket |
#marker ⇒ String?
Returns Specifies the key to start with when using list mode. Object keys are returned in alphabetical order, starting with key after the marker in order.
42 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 42 attribute :marker |
#max_keys ⇒ Integer?
Returns Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys.
46 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 46 attribute :max_keys |
#metadata ⇒ Array<String>, ...
Returns Metadata for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.
50 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 50 attribute :metadata |
#mode ⇒ :get, ...
Returns Switches the module behaviour between put (upload), get (download), geturl (return download url, Ansible 1.3+), getstr (download object as string (1.3+)), list (list keys, Ansible 2.0+), create (bucket), delete (bucket), and delobj (delete object, Ansible 2.0+).
54 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 54 attribute :mode |
#object ⇒ String?
Returns Keyname of the object inside the bucket. Can be used to create “virtual directories”, see examples.
58 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 58 attribute :object |
#overwrite ⇒ String?
Returns Force overwrite either locally on the filesystem or remotely with the object/key. Used with PUT and GET operations. Boolean or one of [always, never, different], true is equal to ‘always’ and false is equal to ‘never’, new in 2.0. When this is set to ‘different’, the md5 sum of the local file is compared with the ‘ETag’ of the object/key in S3. The ETag may or may not be an MD5 digest of the object data. See the ETag response header here U(docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html).
74 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 74 attribute :overwrite |
#permission ⇒ String?
Returns This option lets the user set the canned permissions on the object/bucket that are created. The permissions that can be set are ‘private’, ‘public-read’, ‘public-read-write’, ‘authenticated-read’ for a bucket or ‘private’, ‘public-read’, ‘public-read-write’, ‘aws-exec-read’, ‘authenticated-read’, ‘bucket-owner-read’, ‘bucket-owner-full-control’ for an object. Multiple permissions can be specified as a list.
62 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 62 attribute :permission |
#prefix ⇒ String?
Returns Limits the response to keys that begin with the specified prefix for list mode.
66 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 66 attribute :prefix |
#region ⇒ String?
Returns AWS region to create the bucket in. If not set then the value of the AWS_REGION and EC2_REGION environment variables are checked, followed by the aws_region and ec2_region settings in the Boto config file. If none of those are set the region defaults to the S3 Location: US Standard. Prior to ansible 1.8 this parameter could be specified but had no effect.
78 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 78 attribute :region |
#retries ⇒ Integer?
Returns On recoverable failure, how many times to retry before actually failing.
82 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 82 attribute :retries |
#rgw ⇒ Boolean?
Returns Enable Ceph RGW S3 support. This option requires an explicit url via s3_url.
94 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 94 attribute :rgw |
#s3_url ⇒ String?
Returns S3 URL endpoint for usage with Ceph, Eucalypus, fakes3, etc. Otherwise assumes AWS.
86 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 86 attribute :s3_url |
#src ⇒ String?
Returns The source file path when performing a PUT operation.
98 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 98 attribute :src |
#version ⇒ String?
Returns Version ID of the object inside the bucket. Can be used to get a specific version of a file if versioning is enabled in the target bucket.
70 |
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 70 attribute :version |