Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help wanted]: error configuring S3 Backend: #28

Open
1 task done
masoudkavehie opened this issue Jun 12, 2023 · 3 comments
Open
1 task done

[Help wanted]: error configuring S3 Backend: #28

masoudkavehie opened this issue Jun 12, 2023 · 3 comments

Comments

@masoudkavehie
Copy link

Before anything

  • I searched for the problem and don't found the answer.

What is the problem?

When I was trying to run terraform init after ive added backend s3 on my provider file i got this error .why it happend for me .

Logs (optional).

Initializing the backend...
╷
│ 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
│
@Imany-apk
Copy link

To use your IAM credentials to authenticate the Terraform AWS provider, you should set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables of your own.

Did you set them?

@masoudkavehie
Copy link
Author

yes i did it

@Shayan-Ghani
Copy link
Member

I assume you're using Localstack. In this case, you won't need s3 as localstack, as the name implies, is for testing in the local environment. However, you can create a module and add the terraform block to its provider.tf file. This solves this error but is not best practice and you'll get a warning. you can check out a repository of mine in which I have done the exact thing. it might help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants