簡體   English   中英

在 AWS IAM Role TrustEntity Relation 中寫入多個 Principal AWS 的正確方法

[英]Correct way to write multiple Principal AWS in AWS IAM Role TrustEntity Relation

我是 AWS IAM 角色的新手。

這里的場景是,我有一個用於 DynamoDB 讀取訪問的 IAM 角色 (DDBReadRole)(假設在帳戶 P 中)。 而我們在賬戶B,賬戶C中分別有2個lambda執行角色L1,L2。 現在需要將這 2 個 lambda 執行角色添加到 DDBReadRole 訪問信任實體關系

為此,我正在寫 {

"Version": "2012-10-17",
"Statement": [
    {
        "Effect": "Allow",
        "Principal": {
            "AWS": ["arn:aws:iam::<AccountBId>:role/<AccountBRole>",  "arn:aws:iam:: 
                   <AccountCId>:role/<AccountCRole>"]

        },
        "Action": "sts:AssumeRole"
    }
]

}

我有另一個選擇

{

"Version": "2012-10-17",
"Statement": [
    {
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::<AccountBId>:role/<AccountBRole>

        },
        "Action": "sts:AssumeRole"
    },
    {
        "Effect": "Allow",
        "Principal": {
            "AWS":  "arn:aws:iam::<AccountCId>:role/<AccountCRole>"

        },
        "Action": "sts:AssumeRole"
    }
]

}

有人可以幫助我這是在信任實體中添加 2 個 AWS 委托人的正確方法嗎!!

兩者都是正確的,您可以使用其中任何一個。 但通常使用第一種形式,因為它更短。

暫無
暫無

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

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