This message was deleted.
# getting-started
s
This message was deleted.
l
The provider you create is not specifying credentials. You should provide these, otherwise you will have to figure where the AWS code is getting them from. It's best to be explicit
You can explicitly pass in a profile name, access and secret key, or whatever works for you. That will make tracking problems down much easier.
n
that makes sense, thank you, it's resolved now 🙏
is there a way to get the profile name from pulumi config? Background: I have 2 stacks: prod and dev. They use different aws-cli profiles and they are defined in respective yaml files:
Copy code
# Pulumi.dev.yaml
config:
  aws:profile: dev

# Pulumi.prod.yaml
config:
  aws:profile: prod
to make the above provider work, I need to pass the profile name, but I can't hardcode it in the typescript code. It has to work some thing like:
Copy code
const awsUsEast1 = new aws.Provider("aws-us-east-1", { region: "us-east-1", profile: pulumi.currentProfile() });
is there such way to get the current aws profile from the current pulumi config?
l
The Config class takes a parameter, which would be the aws part. So you could do this:
Copy code
const awsUsEast1 = new aws.Provider("aws-us-east-1", { region: "us-east-1", profile: new pulumi.Config("aws").require("profile")) });
n
nice 👍 I'll give it a try