https://pulumi.com logo
Title
f

fancy-shoe-18611

03/07/2023, 3:46 PM
Trying to pass credentials to the provider and I keep getting (YAML runtime)
error: unable to validate AWS credentials - see <https://pulumi.io/install/aws.html> for details on configuration
I know it isn't my env variables because I get the same error when I hard code. Also, the equivalent in terraform works so im positive it isn't my keys.
b

billowy-army-68599

03/07/2023, 3:46 PM
how are you setting your keys?
f

fancy-shoe-18611

03/07/2023, 3:52 PM
main-provider:
    properties:
      accessKey: AKIAREDACTED
      secretKey: lskdfjldskjredactedlsdkjfglsdkjf
      region: us-east-1
    type: pulumi:providers:aws
b

billowy-army-68599

03/07/2023, 3:54 PM
provider specific configuration needs to be prefixed with the provider name, ie
aws:secretKey
and
aws:accessKey
Try doing:
pulumi config set aws:accessKey <value>
pulumi config set aws:secretKey <value> --secret
if you can share your full yaml I can figure out how to set it for per provider configuration
f

fancy-shoe-18611

03/07/2023, 4:24 PM
Pulumi.yaml
name: kms
runtime:
  name: yaml
  options:
    compiler: clojure -M -m com.kms.deployment
outstring value
name: kms
variables: {}
resources:
  finance-bucket:
    properties:
      bucket: dave-g-finace-bucket-acg-6
    type: aws:s3:Bucket
  main-provider:
    properties:
      accessKey: AKIAREDACTED
      secretKey: lskdfjldskjredactedlsdkjfglsdkjf
      region: us-east-1
    type: pulumi:providers:aws
outputs:
  s3:
    foo: bar
b

billowy-army-68599

03/07/2023, 4:35 PM
ah, the issue here is that you didn’t pass your provider to the resource:
name: kms
runtime:
  name: yaml
variables: {}
resources:
  finance-bucket:
    properties:
      bucket: lbriggs-test
    options:
      provider: ${main-provider} # you have defined an explicit provider, therefore you need to pass it to the resource
      parent: ${main-provider}
    type: aws:s3:Bucket
  main-provider:
    properties:
      accessKey: <redacted>
      secretKey: <redacted>
      region: us-east-1
    type: pulumi:providers:aws
outputs:
  s3:
    foo: bar
f

fancy-shoe-18611

03/07/2023, 4:46 PM
ohhh okay thanks i'll try that