melodic-psychiatrist-50649
01/31/2024, 5:42 AMFOO_INSTANCE_IP=<came from launching ec2 instance foo>
BAR_INSTANCE_IP=<came from launching ec2 instance bar>
TWINGATE_KEY=<came from configuring a twingate connector>
<actual provisioning bash script concatenated here>
This "infra" machine will use data about the other resources to do important things.
What I'm failing to manage, however, is find a way to delay generating the user data (f-strings, .format()
, etc) until the dependent tasks are complete so these values are available.
Also tried generating the content and uploading to S3, but that suffered a similar fate.
I've read https://www.pulumi.com/docs/concepts/inputs-outputs/ but that's not leading me to enlightenment.
Pointers? Suggestions?icy-controller-6092
01/31/2024, 6:44 AMmelodic-psychiatrist-50649
01/31/2024, 7:03 AMmelodic-psychiatrist-50649
01/31/2024, 7:04 AMicy-controller-6092
01/31/2024, 7:06 AMsalmon-account-74572
01/31/2024, 2:25 PMinfra
machine, so that Pulumi knows those two need to be created first? If you haven't tried that yet, I'd start there (look into dependsOn
). Also, try using pulumi.All
to build the user data instead of f-strings to see if that helps.melodic-psychiatrist-50649
01/31/2024, 5:35 PMuser_data = pulumi.Output.all(key=val, key2=val2, ...).apply(lambda a: f"blah = {a['key2']} ...")
infra = aws.ec2.Instance(
...
opts=pulumi.ResourceOptions(depends_on=[other_instances])
)
salmon-account-74572
01/31/2024, 5:48 PMlittle-cartoon-10569
01/31/2024, 7:16 PM