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

cloudformation_stack_set - Add a waiter to ensure that running operations against existing stacksets complete #1790

Merged

Conversation

rmahroua
Copy link
Contributor

SUMMARY

Add a waiter to ensure that running operations against existing stacksets complete. Current code would fail in cases where new instances need to be added since the previous update_stack_set(module, stack_params, cfn) would still be running.
Fixes #1608

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

cloudformation_stack_set

ADDITIONAL INFORMATION

I initially thought that the module was not idempotent since new instances wouldn't be added to my existing stack sets. Upon closer examination, the issue had to do with the fact that we had prior calls being made before adding new instances to existing stack sets:

raise error_class(parsed_response, operation_name)\nbotocore.errorfactory.OperationInProgressException: 
    An error occurred (OperationInProgressException) when calling the UpdateStackInstances operation:
    Another Operation on StackSet arn:aws:cloudformation:us-east-1:XXXXXX:stackset/aws-config-stackset:2bcb419a-f263-48ca-9fe0-cdef11fb59de is in progress

The error got triggered because of a missing waiter after this operation:

changed |= update_stack_set(module, stack_params, cfn)

This change add a waiter function after the update operation, which, in turn, ensure that the subsequent call to add stack instances to the stack set properly run.

@github-actions
Copy link

github-actions bot commented Apr 24, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/7194d91fc7294c6792a8805c24eb365e

ansible-galaxy-importer FAILURE in 4m 01s
✔️ build-ansible-collection SUCCESS in 12m 40s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 24s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 34s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 35s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 30s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 03s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 33s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 08s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 5m 54s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 5m 48s
✔️ ansible-test-changelog SUCCESS in 4m 20s
✔️ ansible-test-splitter SUCCESS in 5m 00s
Skipped 22 jobs

@tremble tremble added this to the 5.5.0 milestone Apr 27, 2023
@tremble tremble changed the title Fix #1608 cloudformation_stack_set - Add a waiter to ensure that running operations against existing stacksets complete May 5, 2023
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label May 5, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/64e2726ff8b14574a8a4e89aea29da9b

✔️ ansible-galaxy-importer SUCCESS in 3m 57s
✔️ build-ansible-collection SUCCESS in 13m 18s
✔️ ansible-test-sanity-docker-devel SUCCESS in 11m 50s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 12m 24s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 43s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 59s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 15s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 7m 47s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 08s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 25s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 8m 19s
✔️ ansible-test-changelog SUCCESS in 4m 32s
✔️ ansible-test-splitter SUCCESS in 4m 57s
Skipped 22 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 2c91768 into ansible-collections:main May 5, 2023
@tremble tremble added the backport-5 PR should be backported to the stable-5 branch label May 5, 2023
@patchback
Copy link

patchback bot commented May 5, 2023

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/2c91768935123f9dfe1af0713146002c98309da7/pr-1790

Backported as #1806

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request May 5, 2023
…ions against existing stacksets complete (#1790)

cloudformation_stack_set - Add a waiter to ensure that running operations against existing stacksets complete

SUMMARY
Add a waiter to ensure that running operations against existing stacksets complete. Current code would fail in cases where new instances need to be added since the previous update_stack_set(module, stack_params, cfn) would still be running.
Fixes #1608
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudformation_stack_set
ADDITIONAL INFORMATION
I initially thought that the module was not idempotent since new instances wouldn't be added to my existing stack sets. Upon closer examination, the issue had to do with the fact that we had prior calls being made before adding new instances to existing stack sets:
raise error_class(parsed_response, operation_name)\nbotocore.errorfactory.OperationInProgressException:
    An error occurred (OperationInProgressException) when calling the UpdateStackInstances operation:
    Another Operation on StackSet arn:aws:cloudformation:us-east-1:XXXXXX:stackset/aws-config-stackset:2bcb419a-f263-48ca-9fe0-cdef11fb59de is in progress
The error got triggered because of a missing waiter after this operation:
changed |= update_stack_set(module, stack_params, cfn)
This change add a waiter function after the update operation, which, in turn, ensure that the subsequent call to add stack instances to the stack set properly run.

Reviewed-by: Mark Chappell
(cherry picked from commit 2c91768)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request May 5, 2023
…ions against existing stacksets complete (#1790) (#1806)

[PR #1790/2c917689 backport][stable-5] cloudformation_stack_set - Add a waiter to ensure that running operations against existing stacksets complete

This is a backport of PR #1790 as merged into main (2c91768).
SUMMARY
Add a waiter to ensure that running operations against existing stacksets complete. Current code would fail in cases where new instances need to be added since the previous update_stack_set(module, stack_params, cfn) would still be running.
Fixes #1608
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
cloudformation_stack_set
ADDITIONAL INFORMATION
I initially thought that the module was not idempotent since new instances wouldn't be added to my existing stack sets. Upon closer examination, the issue had to do with the fact that we had prior calls being made before adding new instances to existing stack sets:
raise error_class(parsed_response, operation_name)\nbotocore.errorfactory.OperationInProgressException: 
    An error occurred (OperationInProgressException) when calling the UpdateStackInstances operation:
    Another Operation on StackSet arn:aws:cloudformation:us-east-1:XXXXXX:stackset/aws-config-stackset:2bcb419a-f263-48ca-9fe0-cdef11fb59de is in progress
The error got triggered because of a missing waiter after this operation:
changed |= update_stack_set(module, stack_params, cfn)
This change add a waiter function after the update operation, which, in turn, ensure that the subsequent call to add stack instances to the stack set properly run.

Reviewed-by: Mark Chappell
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-5 PR should be backported to the stable-5 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_cloudformation_stackset: adding new accounts doesn't create new stack instances
2 participants