-
Notifications
You must be signed in to change notification settings - Fork 4k
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: setting originAccessControlId
in aws-cloudfront-origins
does nothing
#32018
Comments
…e to cloudfront templates fixes aws#32018
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
Hi @ivanbarlog , thanks for reporting this. The mentioned issue is reproducible with this sample code - const distribution = new Distribution(this, "Distribution", {
defaultBehavior: {
origin: new FunctionUrlOrigin(fn.addFunctionUrl(), {
keepaliveTimeout: Duration.seconds(60),
originAccessControlId: oac.attrId, // this line does not propagate to CloudFormation template
}),
},
priceClass: PriceClass.PRICE_CLASS_100,
}); Synthesized template snippet - "Distribution830FAC52": {
"Type": "AWS::CloudFront::Distribution",
"Properties": {
"DistributionConfig": {
"DefaultCacheBehavior": {
"CachePolicyId": "658327ea-f89d-4fab-a63d-7e88639e58f6",
"Compress": true,
"TargetOriginId": "CloudfrontIssuev2StackDistributionOrigin1427B910B",
"ViewerProtocolPolicy": "allow-all"
},
"Enabled": true,
"HttpVersion": "http2",
"IPV6Enabled": true,
"Origins": [
{
"CustomOriginConfig": {
"OriginKeepaliveTimeout": 60,
"OriginProtocolPolicy": "https-only",
"OriginSSLProtocols": [
"TLSv1.2"
]
},
"DomainName": {
"Fn::Select": [
2,
{
"Fn::Split": [
"/",
{
"Fn::GetAtt": [
"MyFunctionFunctionUrlFF6DE78C",
"FunctionUrl"
]
}
]
}
]
},
"Id": "CloudfrontIssuev2StackDistributionOrigin1427B910B"
}
],
"PriceClass": "PriceClass_100"
}
}, As it can be seen, the mentioned property @ivanbarlog , thanks for your contribution. For further help, you could do these-
Hope that would be helpful! |
Hi @khushail! Is this reply to my pull request? I just cannot see the point of integration test for this one. Eg. this should be already covered somewhere, or not? I am not sure how this works, but I am keen to check the tutorials. For me this is just a simple 3 line code fix and I would appreciate the help of someone who already have experience with this. As I believe this will result in adding another 3 lines of code in some integration test, another sweating of my computer running that test suite but me studying the whole process for hours which I don't really have. Only the video you've posted here is more than hour long. Nevertheless I will give it a shot... I guess. |
…Formation templates fixes aws#32018
@ivanbarlog , I totally understand your point but adding the property requires one to submit integration test and snapshots. You could refer to this PR , which adds a pproperty to EC2 and snapshots and integ test are also included. Might be helpful. |
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
Hi @ivanbarlog , thanks for raising this issue. We just merged #31339 which introduces L2 support for setting up a lambda function URL origin with origin access control, which means setting |
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
…Formation templates fixes aws#32018
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
Describe the bug
The property from this interface is not being used anywhere.
Hence setting the property in here does nothing.
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
When setting
originAccessControlId
attribute onFunctionUrlOrigin
the CloudFront template should containOriginAccessControlId
.Current Behavior
When setting
originAccessControlId
attribute onFunctionUrlOrigin
the CloudFront template does not containOriginAccessControlId
.Reproduction Steps
Possible Solution
Add following line below this https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-cloudfront/lib/origin.ts#L151
Add following line below this https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-cloudfront/lib/origin.ts#L165
Add following line below this https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-cloudfront/lib/origin.ts#L189
I have already tested this by adding the lines to the code in my
node_modules
and it works as expected.Additional Information/Context
No response
CDK CLI Version
2.165.0 (build 00f70f1)
Framework Version
No response
Node.js Version
v20.18.0
OS
macOS
Language
TypeScript
Language Version
5.6.3
Other information
No response
The text was updated successfully, but these errors were encountered: