diff --git a/changelogs/fragments/1419-fix-ec2_snapshot_copy-with-tags.yml b/changelogs/fragments/1419-fix-ec2_snapshot_copy-with-tags.yml new file mode 100644 index 00000000000..9cdb86f3461 --- /dev/null +++ b/changelogs/fragments/1419-fix-ec2_snapshot_copy-with-tags.yml @@ -0,0 +1,2 @@ +bugfixes: + - ec2_snapshot_copy - including tags caused the erorr "Tag specification resource type must have a value". Fix sets the ResourceType to snapshot to resolve this issue (https://github.com/ansible-collections/community.aws/pull/1419). diff --git a/plugins/modules/ec2_snapshot_copy.py b/plugins/modules/ec2_snapshot_copy.py index 455a7c6b85c..f45be44178d 100644 --- a/plugins/modules/ec2_snapshot_copy.py +++ b/plugins/modules/ec2_snapshot_copy.py @@ -140,7 +140,7 @@ def copy_snapshot(module, ec2): params['KmsKeyId'] = module.params.get('kms_key_id') if module.params.get('tags'): - params['TagSpecifications'] = boto3_tag_specifications(module.params.get('tags')) + params['TagSpecifications'] = boto3_tag_specifications(module.params.get('tags'), types=['snapshot']) try: snapshot_id = ec2.copy_snapshot(**params)['SnapshotId']