1

我收到了这个错误:

Error executing 'up': AssumeRoleTokenProviderNotSetError: assume role with MFA enabled, but AssumeRoleTokenProvider session option not set.

尝试执行此命令时:

ecs-cli up --force --capability-iam --size 2 --instance-type t2.medium --cluster-config [my-config] --aws-profile [my-profile] --port [xxxx] [xx]

使用此配置:

  • .aws/config
[default]
region = eu-west-1

[profile my-profile]
role_arn = arn:aws:iam::xxxxxxxxxxx:role/xxxxxx
region = eu-west-1
source_profile = default
mfa_serial=arn:aws:iam::xxxxxxxxxx:mfa/xxxxxxxxxxx
  • .aws/credential :它们是使用 get-session-token 生成的
aws_access_key_id = XXXXXXXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXx
aws_session_token = XXXXXXXXXXXXXXXX
  • .ecs/config
version: v1
default: default
clusters:
  my-config:
    cluster: cluster_name
    region: eu-west-1
    default_launch_type: EC2
  default:
    cluster: default
    region: eu-west-1
    default_launch_type: EC2
  • .ecs/credential
version: v1
default: my-profile
ecs_profiles:
  my-profile:
    aws_access_key_id: XXXXXXXXXXXXXXXXX
    aws_secret_access_key: XXXXXXXXXXXXXXXXXXXXXX

也尝试使用临时会话,但我得到了同样的错误。感谢帮助 !

4

0 回答 0