-
-
Notifications
You must be signed in to change notification settings - Fork 54
Fix flickering when transit gateway description is not set #32
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
base: main
Are you sure you want to change the base?
Conversation
Without this fix every Terraform run shows this change: ~ description = "Transit Gateway" -> " Transit Gateway"
The solution is to provide at least one of the context null label inputs such as A better fix for people who do not want to use name would be to use a |
@@ -12,7 +12,7 @@ locals { | |||
|
|||
resource "aws_ec2_transit_gateway" "default" { | |||
count = module.this.enabled && var.create_transit_gateway ? 1 : 0 | |||
description = var.transit_gateway_description == "" ? format("%s Transit Gateway", module.this.id) : var.transit_gateway_description | |||
description = var.transit_gateway_description == "" ? format("%sTransit Gateway", module.this.id) : var.transit_gateway_description |
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.
description = var.transit_gateway_description == "" ? format("%sTransit Gateway", module.this.id) : var.transit_gateway_description | |
description = var.transit_gateway_description == "" ? join(" ", compact([module.this.id, "Transit Gateway"])) : var.transit_gateway_description |
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.
@mattock Please accept the suggested change. While we understand your solution, it degrades the most common approach, which is to use the null-label
inputs and combine those with the " Transit Gateway" description. @nitrocode's solution solves for both and is preferred. Once the suggested change is accepted we'll get this approved + merged.
Thanks @mattock for creating this pull request! A maintainer will review your changes shortly. Please don't be discouraged if it takes a while. While you wait, make sure to review our contributor guidelines. Tip Need help or want to ask for a PR review to be expedited?Join us on Slack in the |
what
This PR fixes flickering on every Terraform run when var.transit_gateway_description is unset.
The problem is caused by the leading space in the description: something that AWS APIs accept without erroring out or warning, but which gets removed or ignored. Hence Terraform tries to "fix" the situation on every run.
why
Without this change this happens on every Terraform run if var.transit_gateway_description is not defined:
With this change applied things work as expected: