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

(aws-cdk-lib): (Cloudwatch Log Groups do not have a UID suffix or stack name prefix like other components) #28031

Closed
ssingh-01 opened this issue Nov 16, 2023 · 6 comments
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/medium Medium work item – several days of effort p3

Comments

@ssingh-01
Copy link

ssingh-01 commented Nov 16, 2023

Describe the bug

I want to re-deploy the same stack multiple times in the same region and account with different names (for different business use cases). All the components are created with a non-conflicting name, because of the prefixed stack name and suffixed UID with each component name, except Cloudwatch Log Group.

Expected Behavior

If I re-deploy the same stack multiple times using a different stack name each time, all the components should be created with a non-conflicting name.

Current Behavior

The customer wants to re-deploy the same stack multiple times with different names (for different business use cases). All the components are created with a non-conflicting name, because of the prefixed stack name and suffixed UID with each component name, except Cloudwatch Log Group.

Reproduction Steps

  1. Bootstrap cdk in one account and region
  2. Create a cdk stack with some components like lambda, eventbridge, step functions but must have an explicit cloudwatch log group in the stack.
  3. Deploy the stack.
  4. Redeploy it with a different stack name in same account and region, it fails due to resource conflict.
    idp-poc-event-logs already exists in stack arn:aws:cloudformation:us-east-1::stack/idp-poc-sfn/75ea4bf0-8485-11ee-8204-0ec5737c0aed

Possible Solution

For workaround :
Change the log group name or parameterize it in code to resolve the name uniquely.

Additional Information/Context

No response

CDK CLI Version

2.96.1

Framework Version

No response

Node.js Version

v18.16.0

OS

MAC

Language

Python

Language Version

3.10.6

Other information

No response

@ssingh-01 ssingh-01 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Nov 16, 2023
@pahud
Copy link
Contributor

pahud commented Nov 16, 2023

Did you mean it always creates the log group named idp-poc-event-logs even with different stack? Can you share a minimal reproducible code snippets?

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2023
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Nov 19, 2023
@ssingh-01
Copy link
Author

Did you mean it always creates the log group named idp-poc-event-logs even with different stack? Can you share a minimal reproducible code snippets?

This could be by design. In the following code snippet, if I do not provide the log_group_name, then a unique log group name is created, but if I provide a name, then it is hard coded with each stack :

log_group = logs.LogGroup(self, "IDPPOCEventsGroup",log_group_name="idp-poc-event-logs")

Is this expected behavior ?

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Nov 19, 2023
@pahud
Copy link
Contributor

pahud commented Jun 4, 2024

Yes, if you do not provide logGroupName, cloudformation will generate one for you.

@pahud
Copy link
Contributor

pahud commented Jun 4, 2024

Closing as it's by design from CFN. Feel free to reopen if it's still relevant.

@pahud pahud closed this as completed Jun 4, 2024
@pahud pahud added p3 and removed p2 labels Jun 4, 2024
Copy link

github-actions bot commented Jun 4, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-cdk-lib Related to the aws-cdk-lib package bug This issue is a bug. effort/medium Medium work item – several days of effort p3
Projects
None yet
Development

No branches or pull requests

2 participants