sparse-intern-71089
02/23/2021, 9:34 AMbetter-actor-92669
02/24/2021, 12:22 PMfrom subprocess import Popen, PIPE
get_gcp_region_description_output, errors =\
Popen(["gcloud", "compute", "regions", "describe",
f"{pulumi.Config('gcp').require('region')}", "--format", "json"],
stdout=PIPE).communicate()
gcp_region_description_json =\
json.loads(get_gcp_region_description_output.decode('utf-8'))
gcp_region_zones = [zone.split('/')[-1] for zone in
sorted(gcp_region_description_json['zones'])]
and then if you want all zones, you can omit slicing the list like I do below
node_locations=gke_nodes_node_locations
After you get access to zones, you can template the machine type string accordinglyNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by