creamy-jelly-91590
05/19/2019, 11:40 AMconst target = new gcp.compute.TargetPool("node-pool-target", {
sessionAffinity: "CLIENT_IP",
project,
region: location,
instances: defaultNodePool.instanceGroupUrls
.apply(groups =>
groups.map(group => {
const splat = group.split("/");
const idxZones = splat.indexOf("zones");
const zone = splat[idxZones + 1];
const groupId = splat[idxZones + 3];
return { group: groupId, zone };
})
)
.apply(groups =>
Promise.all(
groups.map(group =>
gcp.compute
.getInstanceGroup({ project, name: group.group, zone: group.zone })
.then(r => r.instances)
)
).then(flatten)
)
});
No 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