Open adonig opened 1 year ago
Thanks for reporting this, I was able to reproduce it
I believe this is an error with CloudFormation's implementation of this service. Since we aren't generating the name in the template here, it is up to CloudFormation to generate the name. I have reached out to them internally (P79034998), will provide updates as they become available. Thanks!
Hi @peterwoodworth! Thank you for the quick response and action. It seems like this issue also applies to AWS Secrets Manager secrets. They also don't come with a stack name prefix by default. I now chose to always manually give resources a prefixed name when possible. Is there any downside to this?
Yeah there are a couple downsides to specifying the physical names of resources, see our docs here
Assigning physical names to resources has some disadvantages in AWS CloudFormation. Most importantly, any changes to deployed resources that require a resource replacement, such as changes to a resource's properties that are immutable after creation, will fail if a resource has a physical name assigned. If you end up in that state, the only solution is to delete the AWS CloudFormation stack, then deploy the AWS CDK app again. See the AWS CloudFormation documentation for details.
Thank you! That makes a lot of sense. For now I will try to manually prefix the construct id instead of declaring an explicit name in those cases where I found that the prefixing doesn't happen automatically. I'll keep you updated if I find more cases.
I have an update here,
The CloudFormation functionality provided by the Batch service was before there was a standard naming convention function. They intentionally stuck with this, but have created an action item to migrate to the new naming convention. I can't give any ETA on this, and likely won't be posting any more updates until the functionality is implemented
Describe the bug
Normally the names of all resources created by the CDK get prepended with the stack name, which helps a lot identifying the stack the resources belong to. This is not the case for the constructs from the aws_batch_alpha module.
Expected Behavior
I expected all resources created in my stack to have their names prepended with the stack name somehow.
Current Behavior
Most resources have their names prepended with the stack name but the ones from aws_batch_alpha don't. See the comments in the code below for examples.
Reproduction Steps
Possible Solution
Automatically prepend their names with the stack name.
Additional Information/Context
No response
CDK CLI Version
2.60.0 (build 2d40d77)
Framework Version
No response
Node.js Version
v18.12.1
OS
Fedora Linux 37
Language
Python
Language Version
Python (3.11.1)
Other information
No response