gpt4 book ai didi

amazon-web-services - Elastic Beanstalk 部署卡在更新配置设置上

转载 作者:行者123 更新时间:2023-12-04 08:15:37 25 4
gpt4 key购买 nike

我一直在测试我的持续部署设置,试图获得一组最小的 IAM 权限,这将允许我的 CI IAM 组部署到我的“暂存”Elastic Beanstalk 环境。

在我最近的测试中,我的部署卡住了。控制台中的最后一个事件是:

Updating environment staging's configuration settings.

幸运的是,部署将在 30 分钟后超时,因此可以再次部署环境。

这似乎是一个权限问题,因为如果我对所有资源授予 s3:* 权限,部署就会成功。似乎在调用 UpdateEnvironment 时, Elastic Beanstalk 对 S3 做了一些事情,但我不知道是什么。

我尝试了以下策略来授予 EB 对其资源桶的完全访问权限:

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT/resources/_runtime/_embedded_extensions/APP",
"arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT/resources/_runtime/_embedded_extensions/APP/*",
"arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT/resources/environments/ENV_ID",
"arn:aws:s3:::elasticbeanstalk-REGION-ACCOUNT/resources/environments/ENV_ID/*"
]
}
]
}

其中REGIONACCOUNTAPPENV_ID是我的AWS区域、账号、应用名称, 和环境 ID。

有人知道 EB 试图访问哪个 S3 操作和资源吗?

最佳答案

Shared this on your blog already ,但这可能有更广泛的受众,所以这里是:

在此之后,ElastiBeanstalk 团队向我提供了以下关于 S3 权限的答复:

"[...]Seeing the requirement below, would a slightly locked down version work? I've attached a policy to this case which will grant s3:GetObject on buckets starting with elasticbeanstalk. This is essentially to allow access to all elasticbeanstalk buckets, including the ones that we own. The only thing you'll need to do with our bucket is a GetObject, so this should be enough to do everything you need."

所以看起来 ElasticBeanstalk 正在访问任何人领域之外的存储桶以便正常工作(这有点糟糕,但事实就是如此)。

据此,以下策略足以让事情与 S3 一起工作:

{
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::elasticbeanstalk-<region>-<account_id>",
"arn:aws:s3:::elasticbeanstalk-<region>-<account_id>/",
"arn:aws:s3:::elasticbeanstalk-<region>-<account_id>/*"
],
"Effect": "Allow"
},
{
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::elasticbeanstalk*",
"Effect": "Allow"
}

显然,您需要将其包装到 IAM 理解的适当策略声明中。不过,您之前关于 IAM 政策的所有假设都已被证明是正确的,所以我猜这应该不是问题。

关于amazon-web-services - Elastic Beanstalk 部署卡在更新配置设置上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23912714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com