How to configure terraform AWS provider when the credentials are save in 1password

Hello everyone, I have the credentials saved in 1 password, I have the app installed in the laptop and I have created the .env file, when I run “op run --env-file=.env terraform plan” I get an Error: error configuring Terraform AWS Provider: no valid credential sources for Terraform AWS Provider found.

│ Please see Terraform Registry
│ for more information about providing credentials.

│ Error: failed to refresh cached credentials, no EC2 IMDS role found, operation error ec2imds: GetMetadata, request send failed, Get “http://169.254.169.254/latest/meta-data/iam/security-credentials/”: dial tcp 169.254.169.254:80: i/o timeout


│ with provider[“Terraform Registry”],
│ on providers.tf line 17, in provider “aws”:
│ 17: provider “aws” {

can anyone help me?

Thanks

You need to do exactly what the error message says.

Follow the “Documentation” link, and read about how to pass credentials to the provider, including appropriate environment variable names to do so.

1 Like