sparse-intern-71089
02/26/2020, 11:22 PMcolossal-plastic-46140
02/26/2020, 11:43 PMbusy-umbrella-36067
02/26/2020, 11:50 PMcolossal-plastic-46140
02/26/2020, 11:52 PMwhite-balloon-205
aws.getCallerIdentity
to get the Account ID and the ARN and user id. That may be enough to infer these things. It's the ultimate identity that is actually being used, but doesn't have all the details of how that identity was determined.
Alternatively, aws.config.profile
should give you the profile that was configured as input.busy-umbrella-36067
02/27/2020, 12:24 AMaws.config
doesn’t work in the below example, profile comes up as undefined.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
class Test extends pulumi.ComponentResource {
readonly bucket: aws.s3.Bucket
constructor(opts?: pulumi.ComponentResourceOptions) {
super('test', 'test', opts)
console.log(aws.config.profile)
this.bucket = new aws.s3.Bucket('test')
}
}
// Create an AWS resource (S3 Bucket)
const provider = new aws.Provider('test', { profile: 'stage'})
const bucket = new Test({provider: provider})
white-balloon-205
pulumi.config
only works for the default provider configuration - there is not currently a way to get the equivalent for a new aws.Provider
instance. Pretty sure there is an issue tracking adding the ability to retrieve this.