Cloudformation - 指定S3 ACL主体

0

【以下的问题经过翻译处理】 你好,

我试图在S3 ACL策略中使用Fn:GetAtt指定一个主体,但始终收到“无效的桶策略语法”错误。以下是摘录,我做错了什么?

“ingestions3bucketbucketpolicy”:{
    “Type”:“AWS :: S3 :: BucketPolicy”,
    “Properties”:{
        “Bucket”:{
            “Ref”:“ingestions3bucket”
        },
        “PolicyDocument”:{
            “Statement”:[
                {
                    “Action”:[
                        “s3:PutObject”
                    ],
                    “Effect”:“Allow”,
                    “Resource”:{
                        “Fn :: Join”:[
                            “”,
                            [
                                “arn:aws:s3 :::”,
                                {
                                    “Ref”:“ingestions3bucket”
                                },
                                “/*”
                            ]
                        ]
                    },
                    “Principal”:{
                        “Fn :: Join”:[
                            “”,
                            [
                                “\”AWS \“:”,
                                {
                                    “Fn :: GetAtt”:[
                                        “IngestionServiceRole”,
                                        “Arn”
                                    ]
                                }
                            ]
                        ]
                    }
                }
            ]
        }
    },
    “DependsOn”:“IngestionServiceRole”
}
profile picture
EXPERTE
gefragt vor 5 Monaten69 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 主体是一个对象,只有一个属性——在这种情况下是“AWS”。你上面的代码指定了以“AWS:”开头的字符串。


"Principal":  {
    "AWS" : { "Fn::GetAtt": [ "IngestionServiceRole",  "Arn" ] }
}

有关更多信息,请参见http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Principal

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen