I've got some code which: 1. Creates an AWS accoun...
# aws
n
I've got some code which: 1. Creates an AWS account (using AWS Classic organizations) 2. Does various configuration within the account, including early-on trying to create a few Secrets Manager secrets Step 2 seems to always fail with "creating Secrets Manager Secret: SubscriptionRequiredException: The AWS Access Key Id needs a subscription for the service", but if I wait for 30 seconds or so then re-try it works. Is there a way to poll for subscriptions to be available, or even just bake in a delay before anything that depends on the account can proceed?
l
Baking in a delay will be hard, since your code is run before deployment, during the state creation phase. I find it easier to solve this sort of problem by splitting the code into projects. Create the account in one project, wait a few seconds, and then create the secrets in a different project. If you use automation-api, you can put both projects inline in a single file, if you want to.
n
I actually figured something out
the whole concept of just adding a delay and hoping it works is pretty janky, but this works as-advertised: https://www.pulumi.com/registry/packages/time/api-docs/sleep/
l
Nice! I've never seen that provider before.