0.12.29
data.vault_aws_access_credentialsprovider "aws" {}
provider "vault" {
address = "https://vault.domain.com"
token = "${var.route53_vault_token}"
}
data "vault_aws_access_credentials" "route53_creds" {
backend = "team-repo-prod-aws"
role = "route53_aws_domain_com_deploy"
}
provider "aws" {
alias = "route53"
access_key = "${data.vault_aws_access_credentials.route53_creds.access_key}"
secret_key = "${data.vault_aws_access_credentials.route53_creds.secret_key}"
}
Error: Error refreshing state: 1 error(s) occurred:
* data.vault_aws_access_credentials.route53_creds: 1 error(s) occurred:
* data.vault_aws_access_credentials.route53_creds: data.vault_aws_access_credentials.route53_creds: error reading from Vault: Error making API request.
URL: GET https://vault.lllint.com/v1/team-repo-prod-aws/config/root
Code: 403. Errors:
* 1 error occurred:
* permission denied
Vault policy for this role should not require access to the root configuration endpoint.
Terraform requires a new Vault permission unexpectedly.
terraform applyAttached policy used to be:
// Allow token to create creds against the aws Account
path "team-repo-prod-aws/creds/route53_aws_domain_com_deploy" {
capabilities = ["read"]
}
Now needs to be updated to:
// Allow token to create creds against the aws Account
path "team-repo-prod-aws/creds/route53_aws_domain_com_deploy" {
capabilities = ["read"]
}
// Breaking change in Terraform Vault provider v2.12.1 now requires this permission
path "team-repo-prod-aws/config/root" {
capabilities = ["read"]
}
N/A
The same for me, but with 405:
Error: Error refreshing state: 3 errors occurred:
* data.vault_aws_access_credentials.creds: 1 error occurred:
* data.vault_aws_access_credentials.creds: data.vault_aws_access_credentials.creds: error reading from Vault: Error making API request.
URL: GET https://xxx/v1/aws/sso/config/root
Code: 405. Errors:
* 1 error occurred:
* unsupported operation
Thanks @WDouglasWest
He reviewed the merge and found the issue
Similar here as well:
Error: Error refreshing state: 1 error occurred:
* data.vault_aws_access_credentials.aws: 1 error occurred:
* data.vault_aws_access_credentials.aws: data.vault_aws_access_credentials.aws: error reading from Vault: Error making API request.
URL: GET https://xxxxxxx.:443/v1/aws/ssc/config/root
Code: 405. Errors:
* 1 error occurred:
* unsupported operation
With version 2.12.0 it still works as expected.
Thanks for the report! We're looking into this now and hope to update the provider today (Friday, July 31st 2020). That update may be simply reverting this change, but I don't know for sure at this time. Thank you again for reporting and your patience.
Fixed in #837
Most helpful comment
Thanks for the report! We're looking into this now and hope to update the provider today (Friday, July 31st 2020). That update may be simply reverting this change, but I don't know for sure at this time. Thank you again for reporting and your patience.