cuddly-jewelry-42389
12/29/2023, 9:14 AMdry-keyboard-94795
12/29/2023, 9:57 AMpulumi.output
to wrap promises, so it's a different lifecycle that can be treated as "sync" before a stack is constructed.
If it's an output from a resource, you should still avoid using .apply
to create other resourcescuddly-jewelry-42389
12/29/2023, 10:02 AMdry-keyboard-94795
12/29/2023, 10:10 AMpulumi.output
too.
You shouldn't need to dive further into implementation details than thatcuddly-jewelry-42389
12/29/2023, 10:22 AMawsx.ec2.DefaultVpc
it has a property publicSubnetIds
. The type of that property is pulumi.Output<string[]>
.
An instance of type aws.acm.Certificate
has a property domainValidationOptions
of type pulumi.Output<CertificateDomainValidationOptions[]>
.
How do I know on which of these properties I'm allowed to create new resources inside the apply
callback and on which not?
I see no way except looking into the code of the corresponding package implementations.dry-keyboard-94795
12/29/2023, 10:42 AMdry-keyboard-94795
12/29/2023, 10:42 AMcuddly-jewelry-42389
12/29/2023, 10:45 AMBut yes, without that example you'd need to check the codeThis does sound like a bit of a design flaw to me.
dry-keyboard-94795
12/29/2023, 10:48 AMKnownOutput
to make it clearer when it's always safe to use.
I don't think it'd help much though, as there wouldn't be a way to warn about resource creation inside the function bodycuddly-jewelry-42389
12/29/2023, 10:51 AMdry-keyboard-94795
12/29/2023, 10:52 AMcuddly-jewelry-42389
12/29/2023, 10:54 AMbillowy-army-68599
dry-keyboard-94795
12/29/2023, 1:05 PMcuddly-jewelry-42389
12/29/2023, 2:35 PM