ec2_instance: add placement_group support (#49286)

* add placement_group support
pull/4420/head
Frank Zwart 2018-12-03 11:27:54 +01:00 committed by John R Barker
parent 840ab706ee
commit 329922e2dd
1 changed files with 11 additions and 4 deletions

View File

@ -184,6 +184,10 @@ options:
then the ListInstanceProfiles permission must also be granted.
U(https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListInstanceProfiles.html) If no full ARN is provided,
the role with a matching name will be used from the active AWS account.
placement_group:
description:
- The placement group that needs to be assigned to the instance
version_added: 2.8
extends_documentation_fragment:
- aws
@ -1116,6 +1120,8 @@ def build_top_level_options(params):
spec['CreditSpecification'] = {'CpuCredits': params.get('cpu_credit_specification')}
if params.get('tenancy') is not None:
spec['Placement'] = {'Tenancy': params.get('tenancy')}
if params.get('placement_group'):
spec.setdefault('Placement', {'GroupName': str(params.get('placement_group'))})
if params.get('ebs_optimized') is not None:
spec['EbsOptimized'] = params.get('ebs_optimized')
elif (params.get('network') or {}).get('ebs_optimized') is not None:
@ -1584,6 +1590,7 @@ def main():
threads_per_core=dict(type='int', choices=[1, 2], required=True)
)),
tenancy=dict(type='str', choices=['dedicated', 'default']),
placement_group=dict(type='str'),
instance_initiated_shutdown_behavior=dict(type='str', choices=['stop', 'terminate']),
termination_protection=dict(type='bool'),
detailed_monitoring=dict(type='bool'),