https://pulumi.com logo
#aws
Title
# aws
p

proud-pizza-80589

09/26/2020, 5:50 AM
I’m having some trouble with providers. I do not want to use the aws user logged in on my computer, but pass a secret and access key from code. I figured this would work
Copy code
const provider = new aws.Provider('aws', {region: 'eu-west-3',secretKey: 'm/XXX/xxxxx',accessKey: 'XXXXX' });
const cluster = new eks.Cluster('my-cluster',{...},{ provider });
but it deploys using the user on my computer. What am I missing?
putting the access key, secretkey and region in the config also does not work
@broad-dog-22463 It looks like i’m also hit by https://github.com/pulumi/pulumi-aws/issues/791 Did you ever find the reason?
with the env vars loaded it works, guess i’ll use those for now
g

gentle-diamond-70147

09/27/2020, 8:12 PM
Pulumi allows credentials (KUBECONFIG, AWS_ACCESS_KEY_ID, etc) to be overridden by environment variables. From https://www.pulumi.com/docs/intro/cloud-providers/aws/setup/#environment-variables, "Although credentials are recommended, the SDK will prefer environment variables over any other settings". If you unset your AWS environment variables I would expect Pulumi to use the configured settings as described on the setup page.