aws-amplify / aws-amplify/amplify-cli
Stack Cloudformation Names are Nondeterministic
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 825
- Avg merge
- 11d 23h
- Merged PRs (30d)
- 2
Description
### How did you install the Amplify CLI?
npm 8.19.3
### If applicable, what version of Node.js are you using?
v16.19.1
### Amplify CLI Version
11.1.1
### What operating system are you using?
Mac
### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
### Describe the bug
During the creation of a stack the stackname created is nondeterministic which makes it impossible to determine the stack name and pre-push activities which need stack name information.
The bug is in the [cloudformation initializer].
[cloudformation initializer]:https://github.com/aws-amplify/amplify-cli/blob/v12.0.0/packages/amplify-provider-awscloudformation/src/initializer.ts#L60-L62
### Expected behavior
I should be able to determine what a stack name will be based on context within the build without relying on a random timestamp or UUID string.
### Reproduction steps
1. Create an amplify application without any environments and hook up CI builds.
2. Push a change to a CI environment.
3. A random backend environment name is chosen and the stack created has a random id in it.
### Project Identifier
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
### Before submitting, please confirm:
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
Contributor guide
Assessment
This issue has not been assessed yet.