Search code examples
terraformterraform-provider-awsterraform-cloud

No valid credential sources found for AWS Provider when using environment vars


I have a terraform script that works locally but when I publish to Terraform Cloud it errors as below:

Error: No valid credential sources found for AWS Provider.
        Please see https://terraform.io/docs/providers/aws/index.html for more information on
        providing credentials for the AWS Provider
 on main.tf line 1, in provider "aws":
  1: provider "aws" {

The i have set the same variables in the same way on other successfully working deployments but it doesn't seem to be pulling the credentials through.

Any direction on troubleshooting would be appreciated

Variables setting


Solution

  • The AWS environment variables should be AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. If you have multiple AWS Keys you can also select a specific profile within your $HOME/.aws/credentials with AWS_PROFILE environment variable.