Skip to content

Commit

Permalink
ec2_instance - support AdditionalInfo parameter. (#1828) (#1880)
Browse files Browse the repository at this point in the history
[PR #1828/e02fb78a backport][stable-7] ec2_instance - Support AdditionalInfo option.

This is a backport of PR #1828 as merged into main (e02fb78).
This is a reserved parameter that was already supported by boto3.
SUMMARY
Enable support for passing additional_info while creating instance.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_instance

Reviewed-by: Mark Chappell
  • Loading branch information
patchback[bot] authored Nov 26, 2023
1 parent 1ed55fa commit 7dba786
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1828-ec2_instance_additional_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- modules/ec2_instance - add support for AdditionalInfo option when creating an instance (https://github.com/ansible-collections/amazon.aws/pull/1828).
14 changes: 14 additions & 0 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@
description: The Amazon Resource Name (ARN) of the license configuration.
type: str
required: true
additional_info:
description:
- Reserved for Amazon's internal use.
type: str
version_added: 7.1.0
metadata_options:
description:
- Modify the metadata options for the instance.
Expand Down Expand Up @@ -948,6 +953,12 @@
returned: always
type: str
sample: default
additional_info:
description: Reserved for Amazon's internal use.
returned: always
type: str
version_added: 7.1.0
sample:
private_dns_name:
description: The private DNS name.
returned: always
Expand Down Expand Up @@ -1436,6 +1447,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")
if params.get("license_specifications"):
spec["LicenseSpecifications"] = []
for license_configuration in params.get("license_specifications"):
Expand Down Expand Up @@ -2271,6 +2284,7 @@ def main():
instance_metadata_tags=dict(choices=["disabled", "enabled"], default="disabled"),
),
),
additional_info=dict(type="str"),
)
# running/present are synonyms
# as are terminated/absent
Expand Down

0 comments on commit 7dba786

Please sign in to comment.