purple-lawyer-35555
06/18/2021, 9:17 AMsetConfig('aws:region', {value: 'myValue'})
aws.config.region or aws.getRegion() // in this way I can somehow obtain the configuration
// also with const awsConfigRegion = new pulumi.Config('aws').get('region')
Example2:
If I do not have them defined with setConfig/yaml file but in aws.Provider and pass this provider to my CustomResource, I haven't found a clear way to access these values_._
// file1.ts
const awsProvider = new aws.Provider(
'aws-provider',
{region: 'eu-west-1', profile: 'some-profile'}
)
const myCustomResource = new MyCustomComponentResource(
{},
{ provider: awsProvider, parent: awsProvider }
)
// file2.ts
export class MyCustomComponentResource extends pulumi.ComponentResource{
constructor(
args: {},
opts?: pulumi.ComponentResourceOptions | undefined
) {
super('resource-type', 'resource-name', {}, opts)
// how to correctly access here the parent provider config if setConfig has not been called?
// I could pass here the aws provider config as an argument, but it doesn't seem like the intended way to access these values
}
}
billowy-army-68599
06/18/2021, 9:38 AMpurple-lawyer-35555
06/18/2021, 9:40 AMbillowy-army-68599
06/18/2021, 9:45 AMpurple-lawyer-35555
06/18/2021, 10:02 AMdeclare class Provider extends pulumi.ProviderResource {
/**
* Returns true if the given object is an instance of Provider. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Provider;
/**
* The access key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console.
*/
readonly accessKey: pulumi.Output<string | undefined>;
/**
* The profile for API operations. If not set, the default profile created with `aws configure` will be used.
*/
readonly profile: pulumi.Output<string | undefined>;
/**
* The secret key for API operations. You can retrieve this from the 'Security & Credentials' section of the AWS console.
*/
readonly secretKey: pulumi.Output<string | undefined>;
/**
* The path to the shared credentials file. If not set this defaults to ~/.aws/credentials.
*/
readonly sharedCredentialsFile: pulumi.Output<string | undefined>;
/**
* session token. A session token is only required if you are using temporary security credentials.
*/
readonly token: pulumi.Output<string | undefined>;
/**
* Create a Provider resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions);
}
aws.Provider
, ts complains because it's not accessible