https://pulumi.com logo
#aws
Title
# aws
f

full-artist-27215

10/26/2022, 8:04 PM
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

full-artist-27215

10/26/2022, 8:28 PM
@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

billowy-army-68599

10/26/2022, 8:29 PM
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

full-artist-27215

10/26/2022, 8:31 PM
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

billowy-army-68599

10/26/2022, 8:36 PM
I see, haven’t tried that method
f

full-artist-27215

10/26/2022, 8:38 PM
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

billowy-army-68599

10/26/2022, 8:41 PM
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

full-artist-27215

10/26/2022, 8:44 PM
🤔 Interesting... any examples of that lying around, by chance?
f

full-artist-27215

10/26/2022, 8:47 PM
ah, nice; thanks very much!
Ah, this works fantastically