Skip to content

Commit

Permalink
Merge branch 'main' into promote_ec2_vpc_igw
Browse files Browse the repository at this point in the history
  • Loading branch information
jillr authored Aug 26, 2021
2 parents ccf1dfa + 6f44e02 commit 4e9855a
Show file tree
Hide file tree
Showing 19 changed files with 1,958 additions and 28 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/433-ec2_instance-throughput.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- ec2_instance - add ``throughput`` parameter for gp3 volume types (https://github.com/ansible-collections/amazon.aws/pull/433).
13 changes: 13 additions & 0 deletions changelogs/fragments/migrate_ec2_vpc_endpoint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
major_changes:
- ec2_vpc_endpoint_facts - 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_vpc_endpoint_info``.
- ec2_vpc_endpoint - 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_vpc_endpoint``.
- ec2_vpc_endpoint_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_vpc_endpoint_info``.
- ec2_vpc_endpoint_service_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_vpc_endpoint_service_info``.
64 changes: 38 additions & 26 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,81 +48,84 @@ action_groups:
- ec2_vpc_subnet
- ec2_vpc_subnet_info
- s3_bucket

- ec2_vpc_igw_facts
- ec2_vpc_igw
- ec2_vpc_igw_info
- ec2_vpc_endpoint_facts
- ec2_vpc_endpoint
- ec2_vpc_endpoint_info
- ec2_vpc_endpoint_service_info
plugin_routing:
modules:
aws_az_facts:
deprecation:
removal_date: 2022-06-01
warning_text: >-
aws_az_facts was renamed in Ansible 2.9 to aws_az_info.
Please update your tasks.
aws_az_facts was renamed in Ansible 2.9 to aws_az_info.
Please update your tasks.
aws_caller_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
aws_caller_facts was renamed in Ansible 2.9 to aws_caller_info.
Please update your tasks.
aws_caller_facts was renamed in Ansible 2.9 to aws_caller_info.
Please update your tasks.
cloudformation_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
cloudformation_facts has been deprecated and will be removed.
The cloudformation_info module returns the same information, but
not as ansible_facts. See the module documentation for more
information.
cloudformation_facts has been deprecated and will be removed.
The cloudformation_info module returns the same information, but
not as ansible_facts. See the module documentation for more
information.
ec2:
deprecation:
removal_version: 4.0.0
warning_text: >-
The ec2 module is based upon a deprecated version of the AWS SDKs
and is deprecated in favor of the ec2_instance module.
Please update your tasks.
The ec2 module is based upon a deprecated version of the AWS SDKs
and is deprecated in favor of the ec2_instance module.
Please update your tasks.
ec2_ami_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_ami_facts was renamed in Ansible 2.9 to ec2_ami_info.
Please update your tasks.
ec2_ami_facts was renamed in Ansible 2.9 to ec2_ami_info.
Please update your tasks.
ec2_eni_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_eni_facts was renamed in Ansible 2.9 to ec2_eni_info.
Please update your tasks.
ec2_eni_facts was renamed in Ansible 2.9 to ec2_eni_info.
Please update your tasks.
ec2_group_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_group_facts was renamed in Ansible 2.9 to ec2_group_info.
Please update your tasks.
ec2_group_facts was renamed in Ansible 2.9 to ec2_group_info.
Please update your tasks.
ec2_snapshot_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_snapshot_facts was renamed in Ansible 2.9 to ec2_snapshot_info.
Please update your tasks.
ec2_snapshot_facts was renamed in Ansible 2.9 to ec2_snapshot_info.
Please update your tasks.
ec2_vol_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_vol_facts was renamed in Ansible 2.9 to ec2_vol_info.
Please update your tasks.
ec2_vol_facts was renamed in Ansible 2.9 to ec2_vol_info.
Please update your tasks.
ec2_vpc_dhcp_option_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_vpc_dhcp_option_facts was renamed in Ansible 2.9 to
ec2_vpc_dhcp_option_info. Please update your tasks.
ec2_vpc_dhcp_option_facts was renamed in Ansible 2.9 to
ec2_vpc_dhcp_option_info. Please update your tasks.
ec2_vpc_net_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_vpc_net_facts was renamed in Ansible 2.9 to ec2_vpc_net_info.
Please update your tasks.
ec2_vpc_net_facts was renamed in Ansible 2.9 to ec2_vpc_net_info.
Please update your tasks.
ec2_vpc_subnet_facts:
deprecation:
removal_date: 2021-12-01
Expand All @@ -135,3 +138,12 @@ plugin_routing:
warning_text: >-
ec2_vpc_igw_facts was renamed in Ansible 2.9 to ec2_vpc_igw_info.
Please update your tasks.
ec2_vpc_subnet_facts was renamed in Ansible 2.9 to
ec2_vpc_subnet_info. Please update your tasks.
ec2_vpc_endpoint_facts:
deprecation:
removal_date: 2021-12-01
warning_text: >-
ec2_vpc_endpoint_facts was renamed in Ansible 2.9 to
ec2_vpc_endpoint_info.
Please update your tasks.
17 changes: 17 additions & 0 deletions plugins/inventory/aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,23 @@
exclude_filters:
- tag:Name:
- 'my_first_tag'
# Example using groups to assign the running hosts to a group based on vpc_id
plugin: aws_ec2
boto_profile: aws_profile
# Populate inventory with instances in these regions
regions:
- us-east-2
filters:
# All instances with their state as `running`
instance-state-name: running
keyed_groups:
- prefix: tag
key: tags
compose:
ansible_host: public_dns_name
groups:
libvpc: vpc_id == 'vpc-####'
'''

import re
Expand Down
10 changes: 10 additions & 0 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
- A list of block device mappings, by default this will always use the AMI root device so the volumes option is primarily for adding more storage.
- A mapping contains the (optional) keys device_name, virtual_name, ebs.volume_type, ebs.volume_size, ebs.kms_key_id,
ebs.iops, and ebs.delete_on_termination.
- Set ebs.throughput value requires botocore>=1.19.27.
- For more information about each parameter, see U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html).
type: list
elements: dict
Expand Down Expand Up @@ -954,6 +955,15 @@ def build_volume_spec(params):
for int_value in ['volume_size', 'iops']:
if int_value in volume['ebs']:
volume['ebs'][int_value] = int(volume['ebs'][int_value])
if 'volume_type' in volume['ebs'] and volume['ebs']['volume_type'] == 'gp3':
if not volume['ebs'].get('iops'):
volume['ebs']['iops'] = 3000
if 'throughput' in volume['ebs']:
module.require_botocore_at_least('1.19.27', reason='to set throughtput value')
volume['ebs']['throughput'] = int(volume['ebs']['throughput'])
else:
volume['ebs']['throughput'] = 125

return [snake_dict_to_camel_dict(v, capitalize_first=True) for v in volumes]


Expand Down
Loading

0 comments on commit 4e9855a

Please sign in to comment.