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

fix - check stack is ready for cc to be created #1910

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ccggeo
Copy link

@ccggeo ccggeo commented Dec 6, 2023

Handling creating a change set when the check flag is set to true, and the stack is not in a state to be updated yet e.g UPDATE_IN_PROGRESS

SUMMARY

When creating a changeset in check_mode for cloudformation, unless the stack is in a ready state e.g UPDATE_COMPLETE the cmd will error out.

This is particularly a problem in CI pipelines where stacks are being updated constantly and multiple branches with this check are run when the stacks are updating as part of pre deployment testing.

This change waits for the stack to be in a ready state i.e UPDATE_COMPLETE prior to moving on to creating the changeset.

I think this is more of a bug as I would think this case would be handled by the module but isn't.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

amazon.aws.cloudformation

ADDITIONAL INFORMATION

As I think I've understood here, all I do is check the status of the stack. If its in UPDATE_COMPLETE, continue on to creating the changeset. Otherwise wait like the operation to wait for a create changeset below it.

A step-by-step reproduction of the problem

  1. Create a stack
  2. Create an ansible playbook to create a changeset based off this stack.
  3. Get the stack into a status of UPDATE_IN_PROGRESS and immediately run the create changeset with the --check flag true.
  4. Error will indicate that a changeset cannot be created while UPDATE_IN_PROGRESS is the status of the stack.

Please let me know if I can be of more support in explaining the issue.

Thanks!

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/5e6eaddeb4e745faa51b13e91ac2275b

ansible-galaxy-importer FAILURE in 5m 30s
✔️ build-ansible-collection SUCCESS in 17m 10s
✔️ ansible-test-splitter SUCCESS in 5m 21s
✔️ integration-amazon.aws-1 SUCCESS in 19m 09s
Skipped 43 jobs

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/d0a0d59dc5e4486aa2dec92e03c0a127

✔️ ansible-galaxy-importer SUCCESS in 4m 50s
✔️ build-ansible-collection SUCCESS in 14m 38s
✔️ ansible-test-splitter SUCCESS in 5m 39s
✔️ integration-amazon.aws-1 SUCCESS in 13m 46s
Skipped 43 jobs

@hakbailey
Copy link
Contributor

@ccggeo Thank you for submitting this PR! It looks good to me but it needs a changelog fragment and there's a small linting error (trailing whitespace in the added code). Could you add the changelog fragment and fix that please?

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/9b74a201228f4f3f9b5bf982b98d8943

✔️ ansible-galaxy-importer SUCCESS in 6m 10s
✔️ build-ansible-collection SUCCESS in 15m 41s
✔️ ansible-test-splitter SUCCESS in 5m 29s
✔️ integration-amazon.aws-1 SUCCESS in 13m 36s
Skipped 43 jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants