Class: Ansible::Ruby::Modules::Aws_s3

Inherits:
Base show all
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

Methods inherited from Base

#ansible_name, #to_h

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_keyObject?

Returns AWS access key id. If not set then the value of the AWS_ACCESS_KEY environment variable is used.

Returns:

  • (Object, nil)

    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_keyObject?

Returns AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.

Returns:

  • (Object, nil)

    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

#bucketString

Returns Bucket name.

Returns:

  • (String)

    Bucket name.



18
# File 'lib/ansible/ruby/modules/generated/cloud/amazon/aws_s3.rb', line 18

attribute :bucket

#destString?

Returns The destination file path when downloading an object/key with a GET operation.

Returns:

  • (String, nil)

    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.

Returns:

  • (:yes, :no, nil)

    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

#encryptBoolean?

Returns When set for PUT mode, asks for server-side encryption.

Returns:

  • (Boolean, nil)

    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_idObject?

Returns KMS key id to use when encrypting objects using C(aws:kms) encryption. Ignored if encryption is not C(aws:kms).

Returns:

  • (Object, nil)

    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.

Returns:

  • (:AES256, :"aws:kms", nil)

    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

#expirationInteger?

Returns Time limit (in seconds) for the URL generated and returned by S3/Walrus when performing a mode=put or mode=geturl operation.

Returns:

  • (Integer, nil)

    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

#headersString?

Returns Custom headers for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.

Returns:

  • (String, nil)

    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_bucketObject?

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.

Returns:

  • (Object, nil)

    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

#markerString?

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.

Returns:

  • (String, nil)

    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_keysInteger?

Returns Max number of results to return in list mode, set this if you want to retrieve fewer than the default 1000 keys.

Returns:

  • (Integer, nil)

    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

#metadataArray<String>, ...

Returns Metadata for PUT operation, as a dictionary of ‘key=value’ and ‘key=value,key=value’.

Returns:

  • (Array<String>, String, nil)

    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+).

Returns:

  • (:get, :put, :delete, :create, :geturl, :getstr, :delobj, :list)

    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

#objectString?

Returns Keyname of the object inside the bucket. Can be used to create “virtual directories”, see examples.

Returns:

  • (String, nil)

    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

#overwriteString?

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).

Returns:

  • (String, nil)

    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

#permissionString?

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.

Returns:

  • (String, nil)

    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

#prefixString?

Returns Limits the response to keys that begin with the specified prefix for list mode.

Returns:

  • (String, nil)

    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

#regionString?

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.

Returns:

  • (String, nil)

    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

#retriesInteger?

Returns On recoverable failure, how many times to retry before actually failing.

Returns:

  • (Integer, nil)

    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

#rgwBoolean?

Returns Enable Ceph RGW S3 support. This option requires an explicit url via s3_url.

Returns:

  • (Boolean, nil)

    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_urlString?

Returns S3 URL endpoint for usage with Ceph, Eucalypus, fakes3, etc. Otherwise assumes AWS.

Returns:

  • (String, nil)

    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

#srcString?

Returns The source file path when performing a PUT operation.

Returns:

  • (String, nil)

    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

#versionString?

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.

Returns:

  • (String, nil)

    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