question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS_PROFILE not working, commands failing

See original GitHub issue

What happened?

In pulumi-aws v5+, if the provider profile is specified by the config, it is now required to set the AWS_ACCESS_KEY and AWS_SECRET_KEY for that specific profile. Previously if there were no credentials, Terraform would fall back on the credentials found in the environment.

GH Issue Terraform Provider Update

Given this, I am attempting to pass AWS_PROFILE as an env parameter to the actions as recommended here. However, this does not work and there is no way to relate the credentials to the was profile so Pulumi does not fail the command.

Steps to reproduce

  1. Have an AWS profile set up in your aws provider.
- name: Pulumi preview
        uses: pulumi/actions@v3
        with:
          command: preview
          stack-name: myStack
        env:
          PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}
          AWS_PROFILE: ${{ env.AWS_PROFILE }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: ${{ env.AWS_REGION }}

Expected Behavior

Actions can use the credentials set in the CI/CD process to the profile passed in the actions automatically. Command runs successfully.

Actual Behavior

Commands fail with the following error:

error configuring Terraform AWS Provider: failed to get shared config profile, my-profile

Versions used

@pulumi/aws 5.4.0 @pulumi/awsx 0.40.0 @pulumi/pulumi 3.32.1 @pulumi/random 4.6.0

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already).

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
stack72commented, Jun 15, 2022

I believe this is fixed via #2004 and will go out into production with the new release this week

0reactions
ringodscommented, Jun 8, 2022

This seems to be a duplicate of #1995

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS_PROFILE not working with aws cli - Stack Overflow
I have the aws cli installed on my macbook. I updated the version last week and since then it seems like it ignores...
Read more >
Named profiles for the AWS CLI - AWS Command Line Interface
Create and use name profiles for AWS CLI commands. ... It does not affect any command shell that is already running at the...
Read more >
Setup AWS credentials and configuration
Setup AWS credentials and configuration. You will supply configuration and credentials used by the AWS CLI and AWS SDK to access your AWS...
Read more >
15 AWS Configure Command Examples to Manage Multiple ...
The following commands will use dev profile credentials (not the default credentials), as we've set the AWS_PROFILE to dev.
Read more >
The Config Profile could not be Found AWS CLI Error
The "config profile could not be found" error occurs when you try to run an AWS CLI command with a profile that is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found