-
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
[cloudfront] Distribution with S3Origin causes cyclic reference when Bucket is referenced cross-stack #10399
Comments
I am also running in this issue trying to develop a core stack containing an ApiGateway/CloudFront//Domain/HostedZone etc and then having separate stacks for different areas of the platform that connect into the API.
|
…lic references An S3Origin uses a bucket as a Distribution origin; it creates an OriginAccessIdentity, and grants that identity read permissions on the bucket. This creates cyclic references when the bucket is location in a different stack as the distribution. The bucket has a dependency on the generated OAI user for the BucketPolicy, and the Distribution has a dependency on the bucket's domain name for the origin. The fix detects a cross-stack bucket and re-parents the OAI in the bucket's stack. fixes #10399
…lic references An S3Origin creates an OriginAccessIdentity, and grants that identity read permissions on the bucket. This creates cyclic references when the bucket is located in a different stack than the distribution. The bucket has a dependency on the generated OAI user for the BucketPolicy, and the Distribution has a dependency on the bucket's domain name for the origin. The fix detects a cross-stack bucket and re-parents the OAI in the bucket's stack to prevent cylic references. fixes #10399
…lic references An S3Origin creates an OriginAccessIdentity, and grants that identity read permissions on the bucket. This creates cyclic references when the bucket is located in a different stack than the distribution. The bucket has a dependency on the generated OAI user for the BucketPolicy, and the Distribution has a dependency on the bucket's domain name for the origin. The fix detects a cross-stack bucket and re-parents the OAI in the bucket's stack to prevent cyclic references. fixes #10399
…lic references (#10696) An S3Origin creates an OriginAccessIdentity, and grants that identity read permissions on the bucket. This creates cyclic references when the bucket is located in a different stack than the distribution. The bucket has a dependency on the generated OAI user for the BucketPolicy, and the Distribution has a dependency on the bucket's domain name for the origin. The fix detects a cross-stack bucket and re-parents the OAI in the bucket's stack to prevent cyclic references. fixes #10399
|
When using the experimental
cloudfront.Distribution
construct with anS3Origin
, a cyclic reference is created if thes3.Bucket
that the origin references is in a different stack in the same app. This appears to happen when attempting to reference theS3CanonicalUserId
field used when autoconfiguring thecloudfront.OriginAccessIdentity
.Reproduction Steps
Gist here: https://gist.github.com/benagricola/7a9382db2518947c2cd2e2cc84c0d95c
What did you expect to happen?
Cloudfront distribution created successfully, and referenced S3 bucket configured with the right OAI.
What actually happened?
Upon synth:
Environment
Other
As discussed in gitter, can be worked around by importing the bucket from Arn:
But this means OAI is not automatically configured.
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: