From b805c527390123e0179755e5beef49a6f37de708 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Mon, 30 Oct 2023 10:08:36 +0100 Subject: [PATCH] Cleanup deprecation and set date --- plugins/modules/ec2_instance.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/modules/ec2_instance.py b/plugins/modules/ec2_instance.py index 28e27454f7c..8858e024c16 100644 --- a/plugins/modules/ec2_instance.py +++ b/plugins/modules/ec2_instance.py @@ -258,7 +258,7 @@ tenancy: description: - What type of tenancy to allow an instance to use. Default is shared tenancy. Dedicated tenancy will incur additional charges. - - This field is deprecated, use I(placement) instead. + - This field is deprecated and will be removed in a release after 2025-12-01, use I(placement) instead. choices: ['dedicated', 'default'] type: str termination_protection: @@ -326,7 +326,7 @@ placement_group: description: - The placement group that needs to be assigned to the instance. - - This field is deprecated, use I(placement) instead. + - This field is deprecated and will be removed in a release after 2025-12-01, use I(placement) instead. type: str placement: description: @@ -2295,6 +2295,20 @@ def main(): if module.params.get("security_groups"): module.fail_json(msg="Parameter network.interfaces can't be used with security_groups") + if module.params.get("placement_group"): + module.deprecate( + "The placement_group parameter has been deprecated, please use placement.group_name instead.", + date="2025-12-01", + collection_name="amazon.aws", + ) + + if module.params.get("tenancy"): + module.deprecate( + "The tenancy parameter has been deprecated, please use placement.tenancy instead.", + date="2025-12-01", + collection_name="amazon.aws", + ) + state = module.params.get("state") retry_decorator = AWSRetry.jittered_backoff(