Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed May 25, 2021
2 parents d12847a + dff146b commit 57d09d9
Show file tree
Hide file tree
Showing 87 changed files with 4,871 additions and 256 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ PEP440 is the schema used to describe the versions of Ansible.

## Python version compatibility

This collection depends on the AWS SDK for Python (Boto3 and Botocore). As AWS has [ceased supporting Python 2.6](https://aws.amazon.com/blogs/developer/deprecation-of-python-2-6-and-python-3-3-in-botocore-boto3-and-the-aws-cli/), this collection requires Python 2.7 or greater.
As the AWS SDK for Python (Boto3 and Botocore) has [ceased supporting Python 2.7](https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/), this collection requires Python 3.6 or greater.

Starting with the 2.0.0 releases of amazon.aws and community.aws, it is generally the collection's policy to support the versions of `botocore` and `boto3` that were released 12 months prior to the most recent major collection release, following semantic versioning (for example, 2.0.0, 3.0.0).

Version 2.0.0 of this collection supports `boto3 >= 1.13.0` and `botocore >= 1.16.0`

## Included content

Expand Down
2 changes: 2 additions & 0 deletions changelogs/fragments/290-lint-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
breaking_changes:
- module_utils.core - The boto3 switch has been removed from the region parameter (https://github.com/ansible-collections/amazon.aws/pull/287).
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
breaking_changes:
- module_utils/core - updated the ``scrub_none_parameters`` function so that ``descend_into_lists`` is set to ``True`` by default (https://github.com/ansible-collections/amazon.aws/pull/297).
2 changes: 2 additions & 0 deletions changelogs/fragments/298-python3.6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
major_changes:
- amazon.aws collection - Due to the AWS SDKs announcing the end of support for Python less than 3.6 (https://boto3.amazonaws.com/v1/documentation/api/1.17.64/guide/migrationpy3.html) this collection now requires Python 3.6+ (https://github.com/ansible-collections/amazon.aws/pull/298).
2 changes: 2 additions & 0 deletions changelogs/fragments/318-s3-upload-acl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- aws_s3 - Fix upload permission when an S3 bucket ACL policy requires a particular canned ACL (https://github.com/ansible-collections/amazon.aws/pull/318)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- integration tests - remove dependency with collection ``community.general`` (https://github.com/ansible-collections/amazon.aws/pull/361).
3 changes: 3 additions & 0 deletions changelogs/fragments/migrate_ec2_instance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
major_changes:
- ec2_instance - The module has been migrated from the ``community.aws`` collection. Playbooks using the Fully Qualified Collection Name for this module should be updated to use ``amazon.aws.ec2_instance``.
- ec2_instance_info - The module has been migrated from the ``community.aws`` collection. Playbooks using the Fully Qualified Collection Name for this module should be updated to use ``amazon.aws.ec2_instance_info``.
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ action_groups:
- ec2_eni_info
- ec2_group
- ec2_group_info
- ec2_instance
- ec2_instance_info
- ec2_key
- ec2_snapshot
- ec2_snapshot_info
Expand Down
11 changes: 6 additions & 5 deletions plugins/doc_fragments/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ class ModuleDocFragment(object):
aws_ca_bundle:
description:
- "The location of a CA Bundle to use when validating SSL certificates."
- "Only used for boto3 based modules."
- "Not used by boto 2 based modules."
- "Note: The CA Bundle is read 'module' side and may need to be explicitly copied from the controller if not run locally."
type: path
validate_certs:
description:
- When set to "no", SSL certificates will not be validated for boto versions >= 2.6.0.
- When set to "no", SSL certificates will not be validated for
communication with the AWS APIs.
type: bool
default: yes
profile:
description:
- Uses a boto profile. Only works with boto >= 2.24.0.
- Using I(profile) will override I(aws_access_key), I(aws_secret_key) and I(security_token)
and support for passing them at the same time as I(profile) has been deprecated.
- I(aws_access_key), I(aws_secret_key) and I(security_token) will be made mutually exclusive with I(profile) after 2022-06-01.
Expand All @@ -76,8 +76,9 @@ class ModuleDocFragment(object):
- Only the 'user_agent' key is used for boto modules. See U(http://boto.cloudhackers.com/en/latest/boto_config_tut.html#boto) for more boto configuration.
type: dict
requirements:
- python >= 2.6
- boto
- python >= 3.6
- boto3 >= 1.13.0
- botocore >= 1.16.0
notes:
- If parameters are not set within the module, the following
environment variables can be used in decreasing order of precedence
Expand Down
3 changes: 2 additions & 1 deletion plugins/lookup/aws_account_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
author:
- Sloane Hertel <[email protected]>
requirements:
- python >= 3.6
- boto3
- botocore
- botocore >= 1.16.0
extends_documentation_fragment:
- amazon.aws.aws_credentials
- amazon.aws.aws_region
Expand Down
3 changes: 2 additions & 1 deletion plugins/lookup/aws_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
author:
- Aaron Smith <[email protected]>
requirements:
- python >= 3.6
- boto3
- botocore>=1.10.0
- botocore >= 1.16.0
extends_documentation_fragment:
- amazon.aws.aws_credentials
- amazon.aws.aws_region
Expand Down
3 changes: 2 additions & 1 deletion plugins/lookup/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
- Marat Bakeev <hawara(at)gmail.com>
- Michael De La Rue <[email protected]>
requirements:
- python >= 3.6
- boto3
- botocore
- botocore >= 1.16.0
short_description: Get the value for a SSM parameter or all parameters under a path.
description:
- Get the value for an Amazon Simple Systems Manager parameter or a hierarchy of parameters.
Expand Down
6 changes: 3 additions & 3 deletions plugins/module_utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def resource(self, service):
region=region, endpoint=ec2_url, **aws_connect_kwargs)

@property
def region(self, boto3=True):
return get_aws_region(self, boto3)
def region(self):
return get_aws_region(self, True)

def fail_json_aws(self, exception, msg=None, **kwargs):
"""call fail_json with processed exception
Expand Down Expand Up @@ -360,7 +360,7 @@ def get_boto3_client_method_parameters(client, method_name, required=False):
return parameters


def scrub_none_parameters(parameters, descend_into_lists=False):
def scrub_none_parameters(parameters, descend_into_lists=True):
"""
Iterate over a dictionary removing any keys that have a None value
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/aws_az_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
requirements: [botocore, boto3]
'''

EXAMPLES = '''
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/aws_caller_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- Ed Costello (@orthanc)
- Stijn Dubrul (@sdubrul)
requirements: [ 'botocore', 'boto3' ]
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
Expand Down
14 changes: 12 additions & 2 deletions plugins/modules/aws_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
- This option lets the user set the canned permissions on the object/bucket that are created.
The permissions that can be set are C(private), C(public-read), C(public-read-write), C(authenticated-read) for a bucket or
C(private), C(public-read), C(public-read-write), C(aws-exec-read), C(authenticated-read), C(bucket-owner-read),
C(bucket-owner-full-control) for an object. Multiple permissions can be specified as a list.
C(bucket-owner-full-control) for an object. Multiple permissions can be specified as a list; although only the first one
will be used during the initial upload of the file
default: ['private']
type: list
elements: str
Expand Down Expand Up @@ -117,7 +118,6 @@
dualstack:
description:
- Enables Amazon S3 Dual-Stack Endpoints, allowing S3 communications using both IPv4 and IPv6.
- Requires at least botocore version 1.4.45.
type: bool
default: false
rgw:
Expand Down Expand Up @@ -156,6 +156,7 @@
description:
- KMS key id to use when encrypting objects using I(encrypting=aws:kms). Ignored if I(encryption) is not C(aws:kms).
type: str
<<<<<<< HEAD
copy_src:
description:
- The source details of the object to copy.
Expand All @@ -178,6 +179,8 @@
description:
- version ID of the source object.
requirements: [ "boto3", "botocore" ]
=======
>>>>>>> dff146be9cb89b0e4857a721dd02103d084cb0fc
author:
- "Lester Wade (@lwade)"
- "Sloane Hertel (@s-hertel)"
Expand Down Expand Up @@ -563,6 +566,13 @@ def upload_s3file(module, s3, bucket, obj, expiry, metadata, encrypt, headers, s
else:
extra['Metadata'][option] = metadata[option]

if module.params.get('permission'):
permissions = module.params['permission']
if isinstance(permissions, str):
extra['ACL'] = permissions
elif isinstance(permissions, list):
extra['ACL'] = permissions[0]

if 'ContentType' not in extra:
content_type = None
if src is not None:
Expand Down
Loading

0 comments on commit 57d09d9

Please sign in to comment.