You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating a Cloudfront distribution with OAC using the module terraform-aws-modules/cloudfront/aws and using the bucket name as the OAC config map ID.
I'm also creating the S3 bucket using this module to serve as the origin for the CloudFront distribution.
I'm also attaching an S3 bucket policy to the s3 Bucket by using the attach_policy and policy variables. The policy references both the S3 and the CF Distribution.
Since the policy resource is a separate resource from the s3_bucket resource there should be no circular dependency, but because the module output variable s3_bucket_id is linked to the policy first, I'm getting a circular dependency error in terraform.
Using a different string for the OAC config ID does not trigger this circular dependency error.
Using the bucket ID here is a requirement for us, since we have multiple origins in the CF distribution, and multiple CF distributions.
Here's some example code, extracted from our module that we use in multiple deployments:
I'm creating a Cloudfront distribution with OAC using the module
terraform-aws-modules/cloudfront/aws
and using the bucket name as the OAC config map ID.I'm also creating the S3 bucket using this module to serve as the origin for the CloudFront distribution.
I'm also attaching an S3 bucket policy to the s3 Bucket by using the
attach_policy
andpolicy
variables. The policy references both the S3 and the CF Distribution.Since the policy resource is a separate resource from the s3_bucket resource there should be no circular dependency, but because the module output variable
s3_bucket_id
is linked to the policy first, I'm getting a circular dependency error in terraform.Using a different string for the OAC config ID does not trigger this circular dependency error.
Using the bucket ID here is a requirement for us, since we have multiple origins in the CF distribution, and multiple CF distributions.
Here's some example code, extracted from our module that we use in multiple deployments:
The text was updated successfully, but these errors were encountered: