Comments (10)
@jschaul typically we implement this by adding an enabled
variable which disables the module. Not all of our modules support this flag.
If you have time to implement this feature, we'll gladly accept the Pull Request.
Someone recently submitted this PR which demonstrates this strategy: cloudposse/terraform-aws-route53-alias#11
We also have a module here that implements it:
https://github.com/cloudposse/terraform-aws-ecs-cloudwatch-sns-alarms/
Please have a look. Also, join our slack team to reach us directly.
from terraform-aws-cloudfront-s3-cdn.
@osterman If no one else is going to take this I am willing to take a look at it. If I get it figured out I will put in a PR. Love everything that CloudPosse is doing, especially for the Terraform community!
from terraform-aws-cloudfront-s3-cdn.
Thanks @catdevman! That would be awesome. We appreciate your support!
from terraform-aws-cloudfront-s3-cdn.
@osterman Still learning some of the tips and tricks of Terraform... Having some issues with optional adding the logging_config key for the aws_cloudfront_distribution resource. So I added enabled to terraform-aws-s3-log-storage which is currently in PR, so I have it where it won't the logging s3 bucket.
The expected logging_config key :
logging_config {
include_cookies = "${var.log_include_cookies}"
bucket = "${module.logs.bucket_domain_name}"
prefix = "${var.log_prefix}"
}
The issue is that bucket is required if you have the logging_config key there.
I am getting "logging_config.0.bucket": required field is not set
error.
locals {
logging_config = "${var.is_logging_enabled == "true" ? join(",", list(map(
"include_cookies", var.log_include_cookies,
"bucket", module.logs.bucket_domain_name,
"prefix", var.log_prefix
))) : join(",", list(""))}"
}
resource "aws_cloudfront_distribution" "default" {
...
logging_config = ["${compact(split(",", local.logging_config))}"]
}
but if I do this it works fine without the values being in there:
resource "aws_cloudfront_distribution" "default" {
...
logging_config = []
}
I am willing to continue to work on it but I was wondering if you have any tips for conditional list like this. I was looking into overrides but before I spent my whole day trying to find a solution I thought it would be worth asking the community.
from terraform-aws-cloudfront-s3-cdn.
@catdevman what you'll want to do is use the join
+splat
pattern. Here's an example: https://github.com/cloudposse/terraform-aws-dynamodb-autoscaler/pull/10/files#diff-7a370d8342e7203b805911c92454f0f4R100
from terraform-aws-cloudfront-s3-cdn.
@osterman I looked over that and I am not sure that will work because this is a full map. I think that would work for individual keys but that didn't seemed to for the full map.
from terraform-aws-cloudfront-s3-cdn.
Ahk, you're right.
from terraform-aws-cloudfront-s3-cdn.
@osterman So I think this will all be fixed with Terraform 0.12 because of https://www.hashicorp.com/blog/terraform-0-12-conditional-operator-improvements. What I didn't know is what your process was for determining what the minimum version of Terraform should be for a module. I would hate to force people to upgrade if 0.12 just because of this feature but if it works for you it works for me.
from terraform-aws-cloudfront-s3-cdn.
Hi there -- i'm facing this same issue, i need to disable creation of s3 logs bucket and logging feature for CloudFront
is there any workaround for this?
Thanks for any suggestion/response
from terraform-aws-cloudfront-s3-cdn.
Hey guys!
Any updates on this?
I will be happy to help, have to do something similar for my work :)
from terraform-aws-cloudfront-s3-cdn.
Related Issues (20)
- Make random_password.referer available as an output HOT 1
- AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'
- IAM Continuously Updates Between Apply HOT 1
- Using existing origin access identity fails with explicit context HOT 1
- Lambda@Edge submodule doesn't allow to control log group settings HOT 1
- Add support for origin-access-control to replace origin-access-identity HOT 2
- Allow route53 records overwrite
- `additional_bucket_policy` has no effect HOT 1
- The parameter ForwardedValues is required error if i use ordered_cache parameter HOT 2
- Cannot create deployment principal and the CDN in the same terraform run HOT 1
- http2and3 http_version gives validation error
- Ability to attach a custom iAM policy to lambdas
- There are many deprecated resources related to S3 HOT 1
- Unable to disable logging
- Changes To S3 Bucket Default Settings Breaks Access Logging HOT 3
- Unable to reference an origin bucket that does not existing yet
- Website enabled forces an S3 bucket SSL only access policy that can not be applied
- Version 5.0.0 of the aws provider contains breaking changes for this module HOT 2
- ACL fails if `s3_object_ownership` = `BucketOwnerEnforced`
- key group does not default to null
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-aws-cloudfront-s3-cdn.