Skip to content

Commit

Permalink
Cleanup deprecation and set date
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Oct 30, 2023
1 parent ab537d5 commit b805c52
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit b805c52

Please sign in to comment.