https://pulumi.com logo
#general
Title
# general
s

square-hair-965

09/27/2022, 9:21 PM
I'm sure this comes up a lot: Anyone know a 1- or 2 liner I can use in typescript to verify an account id just before the plan runs? i'm already getting the account id via a getter/waiter in most of my index files?. There's been a few times now were I've created a few resources I have to go cleanup because I'm on the wrong aws cli profile 😓
Copy code
const account = aws.getCallerIdentity({});
const accountId = pulumi.output(account).apply(acc => `${acc.accountId}`);
Seems like checking that account id against a config value would do it but it's not that straight forward with how pulumi plans
s

stocky-restaurant-98004

09/27/2022, 10:18 PM
Instead of this approach, try configuring
allowedAccountIds
or
forbiddenAccountIds
in the AWS provider: https://www.pulumi.com/registry/packages/aws/installation-configuration/#configuration-options
3 Views