Skip to content

Commit

Permalink
ec2_ami
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Apr 27, 2022
1 parent 7ce34b6 commit e45435f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/795-deprecate-aliases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ deprecated_features:
- aws_s3 - The ``S3_URL`` alias for the s3_url option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
- ec2_vpc_dhcp_option_info - The ``DryRun`` alias for the dry_run option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
- ec2_vpc_dhcp_option_info - The ``DhcpOptionIds`` alias for the dhcp_option_ids option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
- ec2_ami - The ``DeviceName`` alias for the device_name option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
- ec2_ami - The ``VirtualName`` alias for the virtual_name option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
- ec2_ami - The ``NoDevice`` alias for the no_device option has been deprecated and will be removed in release 5.0.0 (https://github.com/ansible-collections/community.aws/pull/795).
16 changes: 11 additions & 5 deletions plugins/modules/ec2_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,24 @@
type: str
description:
- The device name. For example C(/dev/sda).
- The C(DeviceName) alias had been deprecated and will be removed in
release 5.0.0.
required: yes
aliases: ['DeviceName']
virtual_name:
type: str
description:
- The virtual name for the device.
- See the AWS documentation for more detail U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html).
- Alias C(VirtualName) has been deprecated and will be removed after 2022-06-01.
- The C(VirtualName) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['VirtualName']
no_device:
type: bool
description:
- Suppresses the specified device included in the block device mapping of the AMI.
- Alias C(NoDevice) has been deprecated and will be removed after 2022-06-01.
- The C(NoDevice) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['NoDevice']
volume_type:
type: str
Expand Down Expand Up @@ -707,13 +711,15 @@ def rename_item_if_exists(dict_object, attribute, new_attribute, child_node=None

def main():
mapping_options = dict(
device_name=dict(type='str', aliases=['DeviceName'], required=True),
device_name=dict(
type='str', aliases=['DeviceName'], required=True,
deprecated_aliases=[dict(name='VirtualName', version='5.0.0', collection_name='amazon.aws')]),
virtual_name=dict(
type='str', aliases=['VirtualName'],
deprecated_aliases=[dict(name='VirtualName', date='2022-06-01', collection_name='amazon.aws')]),
deprecated_aliases=[dict(name='VirtualName', version='5.0.0', collection_name='amazon.aws')]),
no_device=dict(
type='bool', aliases=['NoDevice'],
deprecated_aliases=[dict(name='NoDevice', date='2022-06-01', collection_name='amazon.aws')]),
deprecated_aliases=[dict(name='NoDevice', version='5.0.0', collection_name='amazon.aws')]),
volume_type=dict(type='str'),
delete_on_termination=dict(type='bool'),
snapshot_id=dict(type='str'),
Expand Down

0 comments on commit e45435f

Please sign in to comment.