sparse-intern-71089
01/19/2024, 7:56 AMechoing-dinner-19531
01/19/2024, 9:03 AMfreezing-vase-18205
01/19/2024, 9:23 AMc = local.Command(args)
I look for a way to return the same for a task that doesn’t use the resource.
Imagine if I generate a YAML file using outputs and native language libs, so I don’t interact with pulumi-managed resource, then the question is how to make the next step (which is a local.command) to depend on that function completion?freezing-vase-18205
01/19/2024, 9:28 AMdef render_credentials(subnet_id: pulumi.Output):
def render_creds(subnet_id):
env = Environment(loader=FileSystemLoader("."))
template = env.get_template("infra_modules/credentials_dev.yaml.j2")
with open("credentials.yaml", "w") as f:
f.write(
template.render(
os.environ,
subnet_id=subnet_id,
)
)
return True
return subnet_id.apply(render_creds)
then, in order to make sure that my next steps will depend in this step I return an output
creds_done = kubeone_cluster.render_credentials(subnet_id=sub.id)
cluster = kubeone_cluster.deploy(depends_on=[yaml_done, creds_done])
But may be I am rubbing it the wrong wayechoing-dinner-19531
01/19/2024, 10:54 AMoutput.all([a, b]).apply(([a, b]) => a)
to make an output that depends on b but doesn't use it's value in any way.freezing-vase-18205
01/19/2024, 11:05 AMfreezing-vase-18205
06/16/2024, 9:26 AMoutput.all
function. Can someone clarify? Thanks!echoing-dinner-19531
06/16/2024, 12:43 PMall
method are the union of all the dependencies of the outputs passed into the all
method. So this tracks the dependencies for a and b. Then the apply statement doesn't change dependencies but takes only the value of a.freezing-vase-18205
06/18/2024, 12:08 PMechoing-dinner-19531
06/22/2024, 7:20 PMfreezing-vase-18205
06/24/2024, 12:14 PM