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

[Resolve #915] Support ChangeSetType CREATE #1469

Merged

Conversation

alex-harvey-z3q
Copy link
Contributor

@alex-harvey-z3q alex-harvey-z3q commented Jun 1, 2024

This adds logic supporting the case of creating change sets for a stack that does not already exist. That is, it adds support for change sets of ChangeSetType CREATE. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudformation/client/create_change_set.html

To add some context, there is no obvious reason why Sceptre does not already support change sets of type CREATE since the logic for detecting stack status already exists for the launch command. The project's initial commit already has this inconsistency and essentially the same code. It is probably an oversight.

The changes have already been tested by Rohit S in this Slack thread
https://og-aws.slack.com/archives/C01JNN8RGBB/p1716869822031499

In addition, it is necessary to add logic to handle the REVIEW_IN_PROGRESS state, both for the case of the launch and create action.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-describing-stacks.html

Creation of a change set on a non-existent stack actually creates a stack and places it into the REVIEW_IN_PROGRESS state. If Sceptre is then to launch this stack, it is necessary to firstly delete the stack, just as it already does in the cases of states CREATE_FAILED and ROLLBACK_COMPLETE.

PR Checklist

  • Wrote a good commit message & description [see guide below].
  • Commit message starts with [Resolve #issue-number].
  • Added/Updated unit tests.
  • Added/Updated integration tests (if applicable).
  • All unit tests (poetry run tox) are passing.
  • Used the same coding conventions as the rest of the project.
  • The new code passes pre-commit validations (poetry run pre-commit run --all-files).
  • The PR relates to only one subject with a clear title.
    and description in grammatically correct, complete sentences.

Approver/Reviewer Checklist

  • Before merge squash related commits.

Other Information

Guide to writing a good commit

@alex-harvey-z3q alex-harvey-z3q marked this pull request as ready for review June 1, 2024 14:27
@alex-harvey-z3q alex-harvey-z3q changed the title [Resolve #915] Support ChangeSetType UPDATE [Resolve #915] Support ChangeSetType CREATE Jun 1, 2024
.pre-commit-config.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@zaro0508 zaro0508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-harvey-z3q
Copy link
Contributor Author

@zaro0508 integration test fixed:
Screenshot 2024-06-14 at 10 27 22 am

Copy link
Contributor

@zaro0508 zaro0508 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM, just need a little documentation.

sceptre/plan/actions.py Show resolved Hide resolved
@alex-harvey-z3q alex-harvey-z3q merged commit fbb034d into Sceptre:master Jul 3, 2024
15 checks passed
@alex-harvey-z3q alex-harvey-z3q deleted the ah/915-change-set-create branch July 3, 2024 04:41
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