This message was deleted.
# aws
s
This message was deleted.
h
I don’t think you’re able to use env variables. I know you can use the credentials file in ~/.aws/ or you can look at https://www.pulumi.com/docs/intro/cloud-providers/aws/#configuration for other options
👍 1
h
Thanks this helps. I am reading it from
.env
file using
dotenv
package and then setting the provider
Copy code
const config = new pulumi.Config(process.env.provider);

const providerOpts: pulumi.ComponentResourceOptions = {
  provider: new aws.Provider('prov', {
    region: <aws.Region>process.env.region,
    accessKey: process.env.accessKey,
    secretKey: process.env.secretKey,
  }),
};
Is there a way to set a default provider programmatically? It seems like i have to keep passing these provider values to every resource i am creating.