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.

Pass AWS_PROFILE to extension

See original GitHub issue

I run Terraform: apply from vscode and got this error

Initialization failed: exit status 1 Error: error configuring S3 Backend: no valid credential sources for S3 Backend found. Please see https://www.terraform.io/docs/language/settings/backends/s3.html for more information about providing credentials. Error: NoCredentialProviders: no valid providers in chain. Deprecated. For verbose messaging see aws.Config.CredentialsChainVerboseErrors

How can I pass env AWS_PROFILE into Terraform extension?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jpograncommented, Feb 14, 2022

Hello everyone,

The AWS Terraform provider has a section in the documentation on how to provide credentials and other sensitive information to Terraform when it runs. You’ll have to check which method you’re using in order to use it with VS Code.

For example, if you’re using an Environment variable, you’ll have to start VS Code from within a terminal that has that environment variable already populated. VS Code will then inherit all the environment variables of the parent process and any processes VS Code states (in this the case Terraform binary) will also have those environment variables. For example:

$ export AWS_ACCESS_KEY_ID="anaccesskey"
$ export AWS_SECRET_ACCESS_KEY="asecretkey"
$ export AWS_DEFAULT_REGION="us-west-2"
$ code . 

We see a common issue where people start VS Code from the dock in macOS or from the Start menu in Windows and it does not have the same set of environment variables as launching from the command line, so be sure that the place you’re starting from has the data you need to execute Terraform.

If you have any further questions about usage, please reach out on our Discuss board and ask over there. I’m going to close this out for now, but please let us know if things do not work.

0reactions
github-actions[bot]commented, Mar 17, 2022

I’m going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration and credential file settings - AWS Documentation
The AWS CLI stores sensitive credential information that you specify with aws configure in a local file named credentials , in a folder...
Read more >
Using the AWS credentials file and credential Profiles
How to retrieve credentials for AWS using the AWS SDK for PHP. ... A credentials file is a plaintext file that contains your...
Read more >
Creating profiles for your AWS credentials
To open AWS Explorer in Visual Studio, choose View, AWS Explorer. Choose the New Account Profile icon to the right of the Credentials:...
Read more >
Setting up your AWS credentials - AWS Toolkit for VS Code
Create the shared AWS credentials file · Open VS Code. · To open the Command Palette, on the menu bar, choose View, Command...
Read more >
Shared AWS config and credentials files
The shared AWS config and credentials files contain a set of profiles. A profile is a set of configuration values that can be...
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