From 096b0267a92980e6936ae29f2a6576211d65211d Mon Sep 17 00:00:00 2001 From: Mandar Kulkarni Date: Mon, 22 Apr 2024 07:15:55 -0700 Subject: [PATCH] add support for host option in placement.tenancy (#2026) add support for host option in placement.tenancy SUMMARY Add host option in tenancy under placement. Resolves #1990 ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2/client/run_instances.html The host tenancy is not supported for ImportInstance or for T3 instances that are configured for the unlimited CPU credit option. Reviewed-by: Alina Buzachis Reviewed-by: Helen Bailey Reviewed-by: Mandar Kulkarni Reviewed-by: Mark Chappell --- ...c2_instance-add-support-for-placement-tenancy-host.yml | 3 +++ plugins/modules/ec2_instance.py | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/2026-ec2_instance-add-support-for-placement-tenancy-host.yml diff --git a/changelogs/fragments/2026-ec2_instance-add-support-for-placement-tenancy-host.yml b/changelogs/fragments/2026-ec2_instance-add-support-for-placement-tenancy-host.yml new file mode 100644 index 00000000000..83090e96d42 --- /dev/null +++ b/changelogs/fragments/2026-ec2_instance-add-support-for-placement-tenancy-host.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - ec2_instance - add support for ``host`` option in placement.tenancy (https://github.com/ansible-collections/amazon.aws/pull/2026). diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index 510129f8cb5..79b333f33b1 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -359,10 +359,12 @@ type: int required: false tenancy: - description: Type of tenancy to allow an instance to use. Default is shared tenancy. Dedicated tenancy will incur additional charges. + description: + - Type of tenancy to allow an instance to use. Default is shared tenancy. Dedicated tenancy will incur additional charges. + - Support for I(tenancy=host) was added in amazon.aws 7.6.0. type: str required: false - choices: ['dedicated', 'default'] + choices: ['dedicated', 'default', 'host'] license_specifications: description: - The license specifications to be used for the instance. @@ -2304,7 +2306,7 @@ def main(): host_id=dict(type="str"), host_resource_group_arn=dict(type="str"), partition_number=dict(type="int"), - tenancy=dict(type="str", choices=["dedicated", "default"]), + tenancy=dict(type="str", choices=["dedicated", "default", "host"]), ), ), instance_initiated_shutdown_behavior=dict(type="str", choices=["stop", "terminate"]),