-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Terraform: allow deletion of default route upon network creation #1539
Terraform: allow deletion of default route upon network creation #1539
Conversation
Hello! I am a robot who works on Magic Modules PRs. I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs. Thanks for your contribution! A human will be with you soon. |
High-level question: Reading through the use case described in the linked issue, what makes this necessary instead of using a If that's a good enough solution for now, ideally, I'd like to solve this in config and file an issue for a parameter on the upstream API instead of solving it in Terraform. I'm not completely opposed- but implementing features like this in Terraform code has a not-insignificant maintenance cost. |
The problem with the default route is that it's not created through the API, but automatically created at network creation time. So a |
Right! I'm thinking that this is done by the user, by adding a route whose priority means it'll always be taken over the default route; especially in modules, users can easily accomplish this. If you're certain that's not acceptable for those users, I'm 👍 on adding the feature, but if it's a universally useful feature, I'd like to try and bring up upstreaming the feature with the product team as well. |
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.
Made a first pass, unfortunately Terraform isn't great at new fields with defaults so we'll need to coerce it a little.
templates/terraform/custom_import/compute_network_delete_default_route.erb
Outdated
Show resolved
Hide resolved
818fdda
to
adec6a4
Compare
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.
Mostly, yep! We'll never see the field on the resource object so we'll need to pull it from state instead. This suggestion should work if you don't mind verifying.
adec6a4
to
6c7069a
Compare
Hi! I'm the modular magician, I work on Magic Modules. Pull request statusesNo diff detected in terraform-google-conversion. New Pull RequestsI built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed. |
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! Looks great.
Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
[all]
[terraform]
Allow deletion of default route upon network creation
[terraform-beta]
Allow deletion of default route upon network creation
[ansible]
[inspec]