Re:Infrastructure Manager: Provision Google Cloud Resources ...
by samsquire on Monday September 18, 2023 @11:12AM
(#37557260)
My hobby solution was to represent an environment as an ordered graph that you can spin up.
Re:Infrastructure Manager: Provision Google Cloud Resources ...
by msmith on Tuesday September 19, 2023 @06:25AM
(#37567841)
Can your example be solved by having the k8s cluster resource reference the network resource’s “name” attribute?
Doing that allows Terraform to create both resources in one plan/apply step, and it also helps Terraform understand the dependency between the resources so that they are created in the correct order.
A simple example of what I mean by computed values is that let’s say you want to provision a k8s cluster on top of a network. The k8s provider might want the network name/id which you could normally get by setting it upstream. The problem is you can’t plan the network creation and k8s cluster in a single pass because you don’t get the network name until it’s actually provisioned. You actually need to apply the network tf first to get the inputs you need to plan the cluster. Meaning not only do you need to run tf twice, you also can’t E2E plan infra provisioning
If anyone has a solution/pattern for the above (or more generally how to chain these modules together when this limitation exists) I’m all ears