diff --git a/changelogs/fragments/270_add_additional_storage_classes_to_S3_lifecycle_transition_list.yml b/changelogs/fragments/270_add_additional_storage_classes_to_S3_lifecycle_transition_list.yml new file mode 100644 index 00000000000..ac1d6306704 --- /dev/null +++ b/changelogs/fragments/270_add_additional_storage_classes_to_S3_lifecycle_transition_list.yml @@ -0,0 +1,2 @@ +minor_changes: + - s3_lifecycle - Add support for intelligent tiering and deep archive storage classes (https://github.com/ansible-collections/community.aws/issues/270) diff --git a/plugins/modules/s3_lifecycle.py b/plugins/modules/s3_lifecycle.py index a2518a88570..5edceea50bf 100644 --- a/plugins/modules/s3_lifecycle.py +++ b/plugins/modules/s3_lifecycle.py @@ -56,7 +56,7 @@ description: - 'Transition noncurrent versions to this storage class' default: glacier - choices: ['glacier', 'onezone_ia', 'standard_ia'] + choices: ['glacier', 'onezone_ia', 'standard_ia', 'intelligent_tiering', 'deep_archive'] required: false type: str noncurrent_version_transition_days: @@ -91,10 +91,10 @@ type: str storage_class: description: - - "The storage class to transition to. Currently there are two supported values - 'glacier', 'onezone_ia', or 'standard_ia'." + - "The storage class to transition to." - "The 'standard_ia' class is only being available from Ansible version 2.2." default: glacier - choices: [ 'glacier', 'onezone_ia', 'standard_ia'] + choices: [ 'glacier', 'onezone_ia', 'standard_ia', 'intelligent_tiering', 'deep_archive'] type: str transition_date: description: @@ -437,12 +437,13 @@ def destroy_lifecycle_rule(client, module): def main(): + s3_storage_class = ['glacier', 'onezone_ia', 'standard_ia', 'intelligent_tiering', 'deep_archive'] argument_spec = dict( name=dict(required=True, type='str'), expiration_days=dict(type='int'), expiration_date=dict(), noncurrent_version_expiration_days=dict(type='int'), - noncurrent_version_storage_class=dict(default='glacier', type='str', choices=['glacier', 'onezone_ia', 'standard_ia']), + noncurrent_version_storage_class=dict(default='glacier', type='str', choices=s3_storage_class), noncurrent_version_transition_days=dict(type='int'), noncurrent_version_transitions=dict(type='list', elements='dict'), prefix=dict(), @@ -450,7 +451,7 @@ def main(): rule_id=dict(), state=dict(default='present', choices=['present', 'absent']), status=dict(default='enabled', choices=['enabled', 'disabled']), - storage_class=dict(default='glacier', type='str', choices=['glacier', 'onezone_ia', 'standard_ia']), + storage_class=dict(default='glacier', type='str', choices=s3_storage_class), transition_days=dict(type='int'), transition_date=dict(), transitions=dict(type='list', elements='dict'),