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

Provide ability to delete default gateway route #29

Conversation

glarizza
Copy link
Contributor

This commit introduces the ability to delete the default gateway route
that is created for the VPC network (issue #25). If the input variable
var.delete_default_internet_gateway_routes is set then a null_resource
uses the local-exec provisioner to execute a script that filters for all
network routes within the project_id whose name begins with
"default-route" and who contains a next hop of "default-internet-gateway"
and then deletes them. This functionality is useful in the event that
all egress traffic should be routed through a single device instead of
directly to the default internet gateway. Without this change there is
no way to automate the deletion of those routes.

@glarizza glarizza force-pushed the gl/25_delete_default_route branch 5 times, most recently from bb91fae to ad5f1b4 Compare February 20, 2019 19:24
Copy link
Contributor

@aaron-lane aaron-lane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of tweaks for handling booleans are requested.

variables.tf Outdated Show resolved Hide resolved
main.tf Outdated Show resolved Hide resolved
Copy link
Contributor

@adrienthebo adrienthebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible to me, though I've got a non-blocking style pick and a question about authenticating with gcloud.

scripts/delete-default-gateway-routes.sh Show resolved Hide resolved
scripts/delete-default-gateway-routes.sh Show resolved Hide resolved
@glarizza glarizza force-pushed the gl/25_delete_default_route branch 2 times, most recently from 193e4e4 to 9c80d9e Compare February 20, 2019 22:51
This commit introduces the ability to delete the default gateway route
that is created for the VPC network (issue terraform-google-modules#25). If the input variable
`var.delete_default_internet_gateway_routes` is set then a null_resource
uses the local-exec provisioner to execute a script that filters for all
network routes within the `project_id` whose name begins with
"default-route" and who contains a next hop of "default-internet-gateway"
and then deletes them. This functionality is useful in the event that
all egress traffic should be routed through a single device instead of
directly to the default internet gateway.  Without this change there is
no way to automate the deletion of those routes.
@glarizza glarizza force-pushed the gl/25_delete_default_route branch from 9c80d9e to d31726f Compare February 20, 2019 22:54
@adrienthebo adrienthebo merged commit 9acd741 into terraform-google-modules:master Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants