-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
remove check for existing ips on local.nat_gateways_count #109
remove check for existing ips on local.nat_gateways_count #109
Conversation
@etwillbefine I was wondering why this check was added: https://github.com/cloudposse/terraform-aws-dynamic-subnets/pull/86/files#diff-994b65bfe2a964a586187336675fc84a4099482f4444273426a95fc0a79f62c7R11 This PR removes it but it'd be good to know if it served a particular purpose, as I am not sure! |
/test all |
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.
@joe-niland I don't know why this check was implemented in first place, but as soon as this fix makes things works it LGTM
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.
@joe-niland @maximmi @osterman @aknysh I am worried this PR changes the existing behavior in an incompatible way. Despite the language in #42, which was closed by PR #86 which introduced "existing IPs", and the description of the existing_nat_ips
, the current behavior is that if you provide existing IPs, they are assumed to be connected to existing NAT gateways or instances. No new gateways are created. "existing_nat_ips" is interpreted to mean the IPs of existing NATs.
That said, the existing behavior makes no sense. Nothing is done with the existing IPs, all that happens is that if you provide them, no NATs are created. The same effect could be achieved by setting both nat_gateway_enabled
and nat_instance_enabled
to false
.
So I propose a breaking change that renames existing_nat_ips
to anything else, maybe nat_elastic_ips
, so that anyone using existing_nat_ips
will be notified about the change in behavior, which otherwise could go unnoticed and be expensive.
Intentional breaking change to indicate the actual use of this variable.
@Nuru @maximmi sorry, I should have pinged you guys directly. @Nuru great point. I agree that the original intention of this variable seems to be to support existing NAT devices. It seems that there was an attempt at https://github.com/cloudposse/terraform-aws-dynamic-subnets/blob/master/nat-gateway.tf#L35 but it's contradicted by the check above. I didn't consider the important cost implication of this change! I've made the suggested change. |
This Pull Request has been updated, so we're dismissing all reviews.
/test all |
/test all |
I agree with @Nuru 's recommendations. |
(I take responsiblity for #86 =) - I thought it was just reusing existing Elastic IPs and associating them with a new NAT gateway or instance) |
what
why
references