Forum Discussion
This is great. I've configured the terraform AND the was plugins, but my terraform is using an AWS S3 backend, and it still can't find the credentials.
Output of the inspect for both plugins:
```
op plugin inspect aws
AWS CLI
Credential type: Access Key
Configured Aliases
✔ Alias for "aws" configured
✔ Aliases sourced (/Users/lantrix/.config/op/plugins.sh)
Configured Credentials
✔ "AWS Access Key (NewProject)" (vault: "Private")
Configured for directory "/Users/lantrix/repos/terraform-infrastructure". (takes precedence)
✔ "AWS Access Key" (vault: "Private")
Configured as global default.
```
and
```
op plugin inspect terraform
Terraform CLI
Configured Aliases
✔ Alias for "terraform" configured
✔ Aliases sourced (/Users/lantrix/.config/op/plugins.sh)
Configured Credentials
✔ "AWS Access Key (NewProject)" (vault: "Private")
Configured for directory "/Users/lantrix/repos/terraform-infrastructure".
```
But on init of the backend, still can't find the credentials. I'm assuming it's because the alias is being used to wrap op
.
```
terraform init \
-backend-config="region=ap-southeast-2" \
-backend-config="workspace_key_prefix=newproject-infra" \
-backend-config="bucket=terraform-state-${accountId}" \
-backend-config="key=newproject-infra-terraform.tfstate" \
-backend-config="dynamodb_table=terraform-state"
Initializing the backend...
Initializing modules...
╷
│ 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
│
│
│
```
Terraform main.tf
is configured for the backend too. This works with normally placed AWS CLI credentials in $HOME/.aws/credentials
terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.16.1"
}
}
backend "s3" {
workspace_key_prefix = "newproject-infra"
bucket = "terraform-state-123456789012"
key = "newproject-infra-terraform.tfstate"
region = "ap-southeast-2"
dynamodb_table = "terraform-state"
}
}