diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index 0dc9b9be856..858e652212c 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -851,6 +851,16 @@ returned: always type: str sample: default + host_id: + description: The ID of the Dedicated Host on which the instance resides. + returned: always + type: str + sample: "" + additional_info: + description: Reserved. + returned: always + type: dict + sample: private_dns_name: description: The private DNS name. returned: always @@ -1293,6 +1303,16 @@ def build_top_level_options(params): spec["Placement"]["GroupName"] = str(params.get("placement_group")) else: spec.setdefault("Placement", {"GroupName": str(params.get("placement_group"))}) + if params.get("host_id"): + if "Placement" in spec: + spec["Placement"]["HostId"] = str(params.get("host_id")) + else: + spec.setdefault("Placement", {"HostId": str(params.get("host_id"))}) + if params.get("availability_zone"): + if "Placement" in spec: + spec["Placement"]["AvailabilityZone"] = str(params.get("availability_zone")) + else: + spec.setdefault("Placement", {"AvailabilityZone": str(params.get("availability_zone"))}) if params.get("ebs_optimized") is not None: spec["EbsOptimized"] = params.get("ebs_optimized") if params.get("instance_initiated_shutdown_behavior"): @@ -1323,6 +1343,8 @@ def build_top_level_options(params): ) spec["MetadataOptions"]["HttpProtocolIpv6"] = params.get("metadata_options").get("http_protocol_ipv6") spec["MetadataOptions"]["InstanceMetadataTags"] = params.get("metadata_options").get("instance_metadata_tags") + if params.get('additional_info'): + spec['AdditionalInfo'] = params.get('additional_info') return spec @@ -2134,6 +2156,8 @@ def main(): instance_metadata_tags=dict(choices=["disabled", "enabled"], default="disabled"), ), ), + additional_info=dict(type='str'), + host_id=dict(type="str"), ) # running/present are synonyms # as are terminated/absent