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

add handling for plan when cfngin_bucket does not exist #429

Merged
merged 16 commits into from
Sep 14, 2020
Merged

add handling for plan when cfngin_bucket does not exist #429

merged 16 commits into from
Sep 14, 2020

Conversation

ITProKyle
Copy link
Collaborator

@ITProKyle ITProKyle commented Aug 24, 2020

Summary

Using runway plan (with CFNgin modules) in a new environment can create a situation where the S3 bucket used to stage CFN templates has not been created yet. Being a planning step, we want to avoid creating an S3 bucket because the user may not consent to/expect it to be deployed and may intend to deploy it as a dedicated stack.

If the S3 bucket does not already exist, Runway will now log that it will be created during the next deploy (assuming it's not being created as its own stack) and proceed without using an S3 bucket.

This does introduce another case where the template may be too large to use directly with the API. If this is the case, Runway will log that an error occurred, skip the stack who's template was too large, and continue onto the next step.

NOTE: There was an issue uncovered while writing tests for this update and an issue was created to address it (#432).

Why This Is Needed

runway plan fails for CFNgin modules when the cfngin_bucket does not exist (closes #424).

What Changed

Added

  • added a backport for http.HTTPStatus (part of the standard lib in python >= 3.5)
  • added a class to simplify working with S3 buckets & AWS responses
  • added handling for "template too large" error when planning a CFNgin deployment without an S3 bucket
    • informs the user that an S3 bucket is required

Changed

  • when running runway plan, CFNgin modules will now skip using a cfngin_bucket if it does not exist
    • logs that it will be created during the next deploy
  • the stacker shim is now in runway.module.cloudformation
    • it's previous location was causing a cyclic import when importing from runway.core in runway.cfngin

@ITProKyle ITProKyle added the feature Request or pull request for a new feature label Aug 24, 2020
@ITProKyle ITProKyle self-assigned this Aug 24, 2020
@ITProKyle ITProKyle marked this pull request as ready for review August 26, 2020 16:15
@ITProKyle ITProKyle requested a review from troyready August 26, 2020 16:15
@ITProKyle
Copy link
Collaborator Author

@troyready - any ETA on when you may have a change to take a look at this? There are some sensitive areas it's touching (like the shim) and I want to make sure I didn't miss something.

There are some undesirable side effects (as noted in #432) that look to impact direct imports (outside of deploy/destroy) to some locations in runway but not all. Theres no real way to fix this without moving things around a bit which would likely constitute a major change.

I could temporarily relocate this addition inside of runway.cfngin until then which may mitigate the issue but that would create more work in the upcoming major release.

We could also postpone this until v2.

@troyready troyready merged commit 376e438 into rackspace:master Sep 14, 2020
@ITProKyle ITProKyle deleted the feature/plan-no-cfngin-bucket branch September 14, 2020 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request or pull request for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] plan should prompt to create the CFNgin bucket when it doesn't exist
2 participants