[WIP] Change logic for generating/loading stack to avoid mismatching key errors #2282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✅ Checklist
Enable foobar integration
rather than515 foobar
).develop
.🚦 Depends on
When a new stack is created (e.g. during the first run of
dsh sre deploy x
), a new encrypted key is generated when trying to load the stack and stored in the local workspace used for this run of the function. This doesn't match the project encrypted key.When an existing stack is selected (such as on a second run of
dsh sre deploy x
), the project key is used correctly.The
create_or_select_stack
function doesn't tell you whether a stack was created or selected. This PR splitsselect_stack
andcreate_stack
separately, catching errors from the stack not existing or already existing respectively. If the stack is being created, then manually overwrite the newly generated key with the existing project key.An alternative would be to keep the existing
create_or_select_stack
function and always overwrite the generated key with the project keyEither way, the separate step of checking if the keys match is no longer required, as the keys will always match.
🌂 Related issues
Closes #2249
🔬 Tests
Tested locally