https://pulumi.com logo
Title
c

cuddly-smartphone-15267

01/30/2023, 9:26 AM
can anybody suggest an elegant way of getting the root account user arn? would it involve calling
aws.getCallerIdentity()
to get the accountId and then using interpolation to build a string like
arn:aws:iam::${accountId}:root
?
l

little-cartoon-10569

01/30/2023, 7:52 PM
It's generally best to pass this in via config. That way, you're protected if you accidentally use the wrong provider / access key. If you don't line up the root user and the provider, then it won't work.
Since you want the root user, you must be doing something potentially dangerous / destructive, so having an extra layer of protection against misconfiguration is usually a good idea.
c

cuddly-smartphone-15267

01/31/2023, 8:38 AM
thanks for the advice 👌