Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate template parameter for cloudformation #2048

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/cloudformation-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
deprecated_features:
- cloudformation - the ``template`` parameter has been deprecated and will be removed in a release after 2026-05-01. The ``template_body`` parameter can be used in conjungtion with the lookup plugin (https://github.com/ansible-collections/amazon.aws/pull/2048).
18 changes: 15 additions & 3 deletions plugins/modules/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template),
I(template_body) nor I(template_url) are specified, the previous template will be reused.
- The I(template) parameter has been deprecated and will be remove in a release after
2026-05-01. It is recommended to use I(template_body) with the lookup plugin.
type: path
notification_arns:
description:
Expand Down Expand Up @@ -172,7 +174,9 @@
state: "present"
region: "us-east-1"
disable_rollback: true
template: "files/cloudformation-example.json"
# The template parameter has been deprecated, use template_body with lookup instead.
# template: "files/cloudformation-example.json"
template_body: "{{ lookup('file', 'cloudformation-example.json') }}"
template_parameters:
KeyName: "jmartin"
DiskType: "ephemeral"
Expand All @@ -188,7 +192,9 @@
state: "present"
region: "us-east-1"
disable_rollback: true
template: "roles/cloudformation/files/cloudformation-example.json"
# The template parameter has been deprecated, use template_body with lookup instead.
# template: "roles/cloudformation/files/cloudformation-example.json"
template_body: "{{ lookup('file', 'cloudformation-example.json') }}"
role_arn: 'arn:aws:iam::123456789012:role/cloudformation-iam-role'

- name: delete a stack
Expand Down Expand Up @@ -640,7 +646,13 @@ def main():
stack_name=dict(required=True),
template_parameters=dict(required=False, type="dict", default={}),
state=dict(default="present", choices=["present", "absent"]),
template=dict(default=None, required=False, type="path"),
template=dict(
default=None,
required=False,
type="path",
removed_at_date="2026-05-01",
removed_from_collection="amazon.aws",
),
notification_arns=dict(default=None, required=False),
stack_policy=dict(default=None, required=False),
stack_policy_body=dict(default=None, required=False, type="json"),
Expand Down
Loading