【发布时间】:2021-02-03 00:44:46
【问题描述】:
我正在尝试测试一个 github 项目 - https://github.com/charlottemach/cross-account-aws-iam-roles 关于 aws 上的 terraform 和两个帐户,假设的角色。我在本地从我的电脑运行这个 terraform 脚本。当然我在 .aws\config 中添加了两个配置文件
[default]
region = eu-west-1
output = json
[profile prod]
region = eu-north-1
output = json
[profile utils]
region = eu-north-1
output = json
和 .aws\凭据
[default]
aws_access_key_id = xxx
aws_secret_access_key = xxxx
[prod]
aws_access_key_id = xxx
aws_secret_access_key = xxxx
[utils]
aws_access_key_id = xxx
aws_secret_access_key = xxxx
问题是我收到错误消息。我找不到任何解决此问题的方法。首先我运行 terraform init 它执行成功,现在我运行 terraform plan 并且出现以下错误:
terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling
sts:GetCallerIdentity: ExpiredToken: The security token included in the request is expired
status code: 403, request id: xxxx-xxx
Error: error configuring Terraform AWS Provider: error validating provider credentials: error calling
sts:GetCallerIdentity: ExpiredToken: The security token included in the request is expired
status code: 403, request id: xxxx-xxx
【问题讨论】:
标签: amazon-web-services terraform