google.cloud
google.cloud copied to clipboard
Missing module for managing router nats
SUMMARY
I would like to request a module for manipulating router nat configuration.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
google.cloud. gcp_compute_router_nats
ADDITIONAL INFORMATION
The equivalent gcloud command is gcloud compute routers nats
and the rationale for this is that I am using the google.cloud module to configure private GKE clusters which need a NAT router for external access.
Same problem/requirement here.
I don't see why it can't be added as it's part of the router api, and is in an array called "nats"
I just started to play with the GCP modules and missing the ability to create NATs was really surprising. As @ericsysmin points it out it is part of the router api, the router module does exists, but can't take the nats
array. Is there a specific reason for this not being included? Is it just a matter of someone making a PR?
Got around it by a shell
module, but this feels really.... hacky:
- name: Create NAT
ansible.builtin.shell: |
export GOOGLE_APPLICATION_CREDENTIALS={{ gcp_cred_file }}
gcloud compute routers nats create test-nat \
--router=test-router --region={{ region }} \
--auto-allocate-nat-external-ips --nat-all-subnet-ip-ranges \
--enable-endpoint-independent-mapping
ignore_errors: True
register: create_nat
Was looking at the module code and it doesn't look like much of an effort to put in the nats
support, but then I looked closer on this project and it has a lot of pending issues and PRs. Wondering if the project is actually maintained or Terraform has more attention on it? :thinking:
I spent some time on digging in to the matter this weekend and things doesn't look super promising. The check the module makes of available parameters is not passing back nats
as a viable option which makes things a little worse. At this point I tend to question this entire project and it's readiness. The list of issues and the lack of communication is alarming. I'm not saying that is has to be a must, but if Google is serious about this they have to offer better support for Ansible. Maybe this could be poked by Red Hat as well?
Yes, this is an open source project and it is a crappy thing to "demand" support, but last I checked this was maintained by Google's employees who get paid to do this work, and the code is utilized by people who pay for GCP services. For the time being I will continue with Ansible, but the lack of support will force me to maintain the exact same thing in Terraform as well. Not cool, but there is also little to nothing I can do about this.