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

Conditional input for s3_origin_config #8

Open
chris3ware opened this issue Aug 7, 2022 · 0 comments
Open

Conditional input for s3_origin_config #8

chris3ware opened this issue Aug 7, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed terraform Pull requests that update Terraform code

Comments

@chris3ware
Copy link
Member

s3_origin_config should only be passed to the CloudFront module when secure_s3_bucket is set to true.

Currently the following is commented out, and needs to be uncommented to associate the origin access identify created with the CloudFront distribution:

module "cdn" {
...
origin = {
    top10cats = {
      domain_name = module.s3_bucket.s3_bucket_bucket_regional_domain_name

      #? Can s3_origin_config be added dynamically based on the value of var.secure_s3_bucket
      #* Uncomment to associated the OAI with the cloudfront distribution and secure the S3 bucket
      # s3_origin_config = {
      #   origin_access_identity = "top-10-cats-bucket"
      # }
    }
  }

  create_origin_access_identity = var.secure_s3_bucket ? true : false
  origin_access_identities = {
    top-10-cats-bucket = "top-10-cats-bucket"
  }
...
}
@chris3ware chris3ware added enhancement New feature or request help wanted Extra attention is needed labels Aug 7, 2022
@chris3ware chris3ware added the terraform Pull requests that update Terraform code label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed terraform Pull requests that update Terraform code
Development

No branches or pull requests

1 participant