You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
Data source for google_compute_network_endpoint_group would be useful to safer/better automate gke resources with traffic manager. Currently using
GKE creates a convenient NEG that can be used outside the cluster, e.g with traffic manager etc. Terraform can express pretty much all the bits needed to setup lb's, but can't easily include objects created by GKE.
New or Affected Resource(s)
google_compute_network_endpoint_group
Potential Terraform Configuration
The way I work around it now, is by data external.
data"external""negs" {
program = ["bash", "${var.path}/data-external-scripts/get-negs.sh"]
query = {
service =var.service
}
}
where the get-negs.sh is a flatten map with NEGs links.
I use the service name as a filter, not completely happy with it, but did not find another way.
#!/bin/bash# Exit if any of the intermediate steps failset -e
# Extract "foo" and "baz" arguments from the input into# FOO and BAZ shell variables.# jq will ensure that the values are properly quoted# and escaped for consumption by the shell.eval"$(jq -r '@sh "SERVICE=\(.service)"')"# Placeholder for whatever data-fetching logic your script implements
SERVICE="$SERVICE"
gcloud beta compute network-endpoint-groups list --format json | jq --arg target "$SERVICE"'[.[] | select( .name | contains($target))] | [.[] | { (.selfLink): .selfLink }] | add'
Then, in a google_compute_backend_service resource, I create as many backends my service has for_each
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
ghost
locked and limited conversation to collaborators
Mar 28, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Description
Data source for
google_compute_network_endpoint_group
would be useful to safer/better automate gke resources with traffic manager. Currently usingGKE creates a convenient NEG that can be used outside the cluster, e.g with traffic manager etc. Terraform can express pretty much all the bits needed to setup lb's, but can't easily include objects created by GKE.
New or Affected Resource(s)
Potential Terraform Configuration
The way I work around it now, is by data external.
where the
get-negs.sh
is a flatten map with NEGs links.I use the service name as a filter, not completely happy with it, but did not find another way.
Then, in a
google_compute_backend_service
resource, I create as many backends my service hasfor_each
References
The text was updated successfully, but these errors were encountered: