https://pulumi.com logo
Title
a

ambitious-rainbow-88588

02/20/2021, 3:44 AM
any experts here in setting up cross account access in aws i have little doubts
c

chilly-hairdresser-56259

02/20/2021, 5:46 AM
in which type of context? Are creating resources in account A, then also need to make resources in account B?
a

ambitious-rainbow-88588

02/20/2021, 6:58 AM
no i just want to access resource of account A in account B using assume role
l

little-cartoon-10569

02/21/2021, 8:01 PM
The easiest way imo is to use a separate provider. aws.Provider takes region and profile properties, and profile can have _role___arn_ and _source___profile_ properties.
Then you cam specify the other account's provider in the opts parameter, either in one of the get functions (e.g.
aws.ec2.get("inst", "i-1234567890", {...}, { provider: otherAccount})
https://www.pulumi.com/docs/reference/pkg/aws/ec2/instance/#look-up) or import the resource (e.g.
new aws.ec2.Instance("inst", { ...}, { provider: otherAccount, import: "i-1234567890"})
)