-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
updating to allow conditional creation of the cdn and dns #31
updating to allow conditional creation of the cdn and dns #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @dannybrody
please see comments.
Also, since you are at it anyway, you can add count = var.enabled == "true" ? 1 : 0
to all other resources (label, logs, dns) - var.enabled
should enable/disable all resources in the module
@aknysh sounds great, I'll update, test, and then update the PR. Thanks for responding so quickly! |
…le to version 0.3.0 since that is the minimum version that has the 'enabled' variable
@aknysh I went ahead and tried updated the other modules with |
Any updates on this? |
updated due to running into the following plan error: |
main.tf
Outdated
@@ -1,5 +1,6 @@ | |||
module "origin_label" { | |||
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.7" | |||
enabled = "${var.enabled ? true : false }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled = "${var.enabled ? true : false }" | |
enabled = "${var.enabled}" |
main.tf
Outdated
@@ -13,7 +14,8 @@ resource "aws_cloudfront_origin_access_identity" "default" { | |||
} | |||
|
|||
module "logs" { | |||
source = "git::https://github.com/cloudposse/terraform-aws-log-storage.git?ref=tags/0.2.2" | |||
source = "git::https://github.com/cloudposse/terraform-aws-log-storage.git?ref=tags/0.3.0" | |||
enabled = "${var.enabled ? true : false }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled = "${var.enabled ? true : false }" | |
enabled = "${var.enabled}" |
main.tf
Outdated
@@ -28,6 +30,7 @@ module "logs" { | |||
|
|||
module "distribution_label" { | |||
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.3.7" | |||
enabled = "${var.enabled ? true : false }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled = "${var.enabled ? true : false }" | |
enabled = "${var.enabled}" |
main.tf
Outdated
@@ -37,6 +40,7 @@ module "distribution_label" { | |||
} | |||
|
|||
resource "aws_cloudfront_distribution" "default" { | |||
count = "${var.enabled ? 1 : 0 }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
count = "${var.enabled ? 1 : 0 }" | |
count = "${var.enabled == "true" ? 1 : 0 }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @dannybrody
Please see comments and run terraform fmt
and rebuild README by executing:
make init
make readme/deps
make readme
``
/rebuild-readme |
/terraform-fmt |
Currently we require the ability to conditionally create the aws_cloudfront_distribution. Updated to allow the conditional creation of resource "aws_cloudfront_distribution" "default" together with module "dns". Also updated the outputs to work with both cases.