Pass AWS_PROFILE to extension
See original GitHub issueI 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:
- Created 2 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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:
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.
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.