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

Version: 2.49 Cannot Use Custom cloudFrontLoggingBucketProps - 2.45 works though #1056

Open
anh-rivergon opened this issue Jan 24, 2024 · 2 comments
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged

Comments

@anh-rivergon
Copy link

anh-rivergon commented Jan 24, 2024

You cannot specify a custom "cloudFrontLoggingBucketProps" If you do, resulting CloudFormation template contains duplicate buckets and hence, the stack will fail.

Reproduction Steps

Just specify a custom cloudFrontLoggingBucketProps rather than leaving it optional.

Error Log

CREATE_FAILED | AWS::S3::Bucket | CloudFrontToS3/CloudfrontLoggingBucket (CloudFrontToS3CloudfrontLoggingBucket59050E4A) abcxyz already exists in stack

Environment

  • CDK CLI Version 2.122.0 (build 7e77e02) :
  • **CDK Framework Version: 2
  • **AWS Solutions Constructs Version 2.49
  • OS : Windows WSL2 / Ubuntu
  • Language : Typescript

Other


This is 🐛 Bug Report

@anh-rivergon anh-rivergon added bug Something isn't working needs-triage The issue or PR still needs to be triaged labels Jan 24, 2024
@biffgaut
Copy link
Contributor

Thanks, we'll check this out.

@biffgaut
Copy link
Contributor

biffgaut commented Jan 29, 2024

Can you provide an example of code that produces this error? This code compiles and launches without an issue and the template contains 4 buckets -

  • the S3 content bucket
  • the S3 Access Log bucket for the content bucket
  • the CloudFront log bucket
  • the S3 Access Log bucket for the CloudFront log bucket
export class Issue1056Stack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new CloudFrontToS3(this, 'issue1056', {
      cloudFrontLoggingBucketProps: {
        removalPolicy: cdk.RemovalPolicy.DESTROY,
        autoDeleteObjects: true
      }
    });
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage The issue or PR still needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants