簡體   English   中英

使用ecs-cli時發生IAM錯誤

[英]IAM Error while using ecs-cli

我正在嘗試使用撰寫文件為ECS創建新任務,但是即使我的用戶具有所需的權限,我也遇到了AccessDeniedException。

$ ecs-cli compose --project-name test create
WARN[0000] Skipping unsupported YAML option for service...  option name=build service name=builder
WARN[0000] Skipping unsupported YAML option for service...  option name=restart service name=db
WARN[0000] Skipping unsupported YAML option for service...  option name=restart service name=dbadmin
WARN[0000] Skipping unsupported YAML option for service...  option name=restart service name=app
ERRO[0001] Error registering task definition             error=AccessDeniedException: User: arn:aws:iam::XXXXXXX:user/foo is not authorized to perform: ecs:RegisterTaskDefinition on resource: *
    status code: 400, request id: 41e6b69a-a839-11e6-84b0-e9bc2ec3f81b family=ecscompose-test
ERRO[0001] Create task definition failed                 error=AccessDeniedException: User: arn:aws:iam::XXXXXXX:user/foo is not authorized to perform: ecs:RegisterTaskDefinition on resource: *
    status code: 400, request id: 41e6b69a-a839-11e6-84b0-e9bc2ec3f81b
FATA[0001] AccessDeniedException: User: arn:aws:iam::XXXXXXX:user/foo is not authorized to perform: ecs:RegisterTaskDefinition on resource: *
    status code: 400, request id: 41e6b69a-a839-11e6-84b0-e9bc2ec3f81b 

用戶已附加此策略:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecs:RegisterTaskDefinition",
                "ecs:ListTaskDefinitions",
                "ecs:DescribeTaskDefinition"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}

我還嘗試附加了AmazonEC2ContainerServiceFullAccess (具有ecs:*),但是沒有用。

我認為這篇文章對為什么會發生上述錯誤有一些答案,認為不是解決方法。

使用ecs-cli在AWS上部署docker時遇到問題

“據我了解,ecs-cli對完整的Docker Compose文件語法的支持非常有限”

每位使用者Dolan Antenucci

請注意警告“ WARN [0000]正在跳過不支持的YAML服務選項...”

ECS不支持大部分組合設置。 但是,它只應打印警告並忽略它們,這將產生意想不到的結果,但不應引發權限問題。

當您看到400種AccessDeniedExceptions形式為“未授權user_arn對service_resource執行service:action”時,肯定是一個IAM問題。 但是,您列出的IAM策略看起來正確。 我的想法是,您某種程度上沒有使用正確的用戶憑據,或者IAM策略未正確應用於用戶。

發現了問題,我正在使用的用戶具有使用MFA(MultiFactor Auth)的策略,而ecs-cli不支持該策略。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM