I'm trying to set up a Transit Gateway-based netwo...
# aws
f
I'm trying to set up a Transit Gateway-based network and am running into some issues. You can create a transit gateway that automatically accepts any attachment requests; alternatively, you can set it up so that the attachment must be affirmatively accepted using a
pulumi_aws.ec2transitgateway.VpcAttachmentAccepter
. My problem comes when trying to set up route table associations. I would like to have the gateway configured to automatically accept attachments, but route table associations can't be created if the attachment hasn't been accepted yet (the error is
IncorrectState: tgw-attach-XXXXXXXXXXXX is in invalid state
). Auto-acceptance still takes some time, though, and I can't seem to find a way to have the route table associations to wait until the attachment has been accepted; the first
pulumi up
fails on all the route table associations, but if I wait a minute, I can re-run and they'll all proceed. Is there a way to make this work in Pulumi? Thanks.
f
@billowy-army-68599 Sorry, I'm not seeing the waiting mechanism. I guess I should also mention that I'm not using the default route tables of the transit gateway.
b
I didn’t use the accepter, I used the resource share and attached it manually to get around this issue
if you want to stick with your path, you’ll need to set a dependsOn the
VpcAttachmentAccepter
and likely build the routes inside an
apply
f
What do you mean "attached it manually"?
I suppose another wrinkle is that I'd like to keep the Pulumi projects scoped to a single AWS account if at all possible.
b
I see, haven’t tried that method
f
Back to the general problem, is there a way to have Pulumi "wait" for a condition to be true before proceeding? I'm not quite ready to convert all this to an Automation API program. Maybe something with a Command provider resource?
I can't seem to find anything along these lines in Terraform world either
b
Is there a way to have Pulumi “wait” for a condition to be true before proceeding?
it depends on the condition, you can do things inside an
apply
that poll something for example
f
🤔 Interesting... any examples of that lying around, by chance?
f
ah, nice; thanks very much!
Ah, this works fantastically