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_cloudfront): Distribution does not associate set certificate #32772

Closed
1 task
JZechy opened this issue Jan 7, 2025 · 4 comments
Closed
1 task

(aws_cloudfront): Distribution does not associate set certificate #32772

JZechy opened this issue Jan 7, 2025 · 4 comments
Assignees
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@JZechy
Copy link

JZechy commented Jan 7, 2025

Describe the bug

I was creating CloudFront Distribution with custom alternate domain with usage of a cross region certificate from us-east-1 to eu-central-1 as described in CDK docs here.

Certificate association with CloudFront distribution template is missing (only Aliases are assigned), leading to an error during stack update.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

According to CloudFormation documentation property called ViewerCertificate under DistributionConfig should be created.

Current Behavior

ViewerCertificate property is missing in DistributionConfig for existing and even new cloudfront distributions. Distribution is only created with Aliases property leading to an error during stack update, because distribution is missing reference to domain certificate.

Reproduction Steps

Create a CloudFront distribution as described in Docs here.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.174.0

Framework Version

No response

Node.js Version

22.9.0

OS

Windows 10

Language

.NET

Language Version

No response

Other information

No response

@JZechy JZechy added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 7, 2025
@github-actions github-actions bot added the @aws-cdk/aws-cloudfront Related to Amazon CloudFront label Jan 7, 2025
@khushail khushail self-assigned this Jan 7, 2025
@khushail khushail added needs-reproduction This issue needs reproduction. p2 investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Jan 7, 2025
@khushail
Copy link
Contributor

Hi @JZechy , thanks for reaching out.
Could you please share a minimal self contained reproduction code which I can use on my side to reproduce the issue?

Also would like to add highlight one more thing - the cross-region certificates in cloudfront is Experimental -https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront-readme.html#cross-region-certificates

@khushail khushail added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jan 10, 2025
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 Jan 12, 2025
@JZechy
Copy link
Author

JZechy commented Jan 13, 2025

@khushail Identified problem on my side - I forgot when I init property alongside object creation with new keyword, the properties are not available for constructor. So this code...

CertificateStack cert = new(scope);
DistributionStack dist = new(scope) {
  DomainCertificate = cert.Instance
}

Cannot work if I describe the distribution in constructor - where the DomainCertificate is not available yet.

@JZechy JZechy closed this as completed Jan 13, 2025
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made. needs-reproduction This issue needs reproduction. p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants