Hello, I’m struggling with async nature of pulumi ...
# general
p
Hello, I’m struggling with async nature of pulumi , it’s a great feature but in my case I’m creating some roles in AWS and attaching policies after that I’m creating some environment which require the role with the policies .. the policy attached is happening only after the failure of the environment creation which depends on it .. used depends on and put some delays .. still no luck .. any one here have solved anything similar?
e
This isn't really a Pulumi specific issue, it's just that policy attachement is slow in aws. We have tests that just are calling the aws api directly to set up policies and they just have to spin wait for about 10 seconds until the policy starts to work.
p
Added a wait time of 60 seconds and more .. still no luck .. and attachment is happening immediately after the error .. if I retry the run , it’s runs smooth ,with out an error .
e
creating some environment which require the role with the policies
Are you trying to change the role pulumi uses to create aws resources halfway through the program?
p
Yes , creating it
e
What language?
p
Python
e
Are you making a new aws.Provider with configuration for the role?
p
Nope , will try that ..I was using rolepolicyattachment
e
Try making a new provider, that will tell pulumi to use those credentials instead
p
Provider didn’t solve the problem
e
You might need to put a sleep in, I'm not sure the aws provider will retry on credential failure