【发布时间】:2017-02-07 01:16:58
【问题描述】:
在账户 A 中,我使用 cloudformation 创建了一个 s3 存储桶,CodeBuild 构建了一个工件并上传到该存储桶。在账户 B 中,我尝试使用 cloudformation 创建堆栈,并使用账户 A 的存储桶中的工件来部署我的 Lambda 函数。但是,我收到拒绝访问错误。有谁知道解决方案?谢谢...
"TestBucket": {
"Type": "AWS::S3::Bucket",
"DeletionPolicy": "Retain",
"Properties": {
"AccessControl": "BucketOwnerFullControl"
}
},
"IAMPolicy": {
"Type": "AWS::S3::BucketPolicy",
"Properties": {
"Bucket": {
"Ref": "TestBucket"
},
"PolicyDocument": {
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": [
"arn:aws:iam::xxxxxxxxxxxx:root",
"arn:aws:iam::xxxxxxxxxxxx:root"
]
},
"Action": [
"s3:GetObject"
],
"Resource": [
{
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "TestBucket"
},
"/*"
]
]
},
{
"Fn::Join": [
"",
[
"arn:aws:s3:::",
{
"Ref": "TestBucket"
}
]
]
}
]
}
]
}
}
}
【问题讨论】:
标签: amazon-web-services amazon-s3 amazon-cloudformation