这个问题让我有点崩溃...我正在尝试在公共子网的VPC上运行Fargate中的Docker镜像。当我将其作为任务运行时,出现以下错误:
ResourceInitializationError: unable to pull secrets or registry auth: pull
command failed: : signal: killed
如果我在私有子网中通过NAT运行任务,则可以正常工作。如果我在默认VPC的公共子网中运行它,它也可以正常工作。
我已经查看了这里的建议: Aws ecs fargate ResourceInitializationError: unable to pull secrets or registry auth 特别是,我设置了安全组以允许所有流量。网络ACL设置为允许所有流量。我甚至非常慷慨地授予了IAM权限,以尝试消除可能性:
任务执行角色具有:
{
"Action": [
"kms:*",
"secretsmanager:*",
"ssm:*",
"s3:*",
"ecr:*",
"ecs:*",
"ec2:*"
],
"Resource": "*",
"Effect": "Allow"
}
通过信任关系,允许ecs-tasks扮演此角色:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
安全组是:
sg-093e79ca793d923ab All traffic All traffic All 0.0.0.0/0
网络访问控制列表(Network ACL)如下:
Inbound
Rule number Type Protocol Port range Source Allow/Deny
100 All traffic All All 0.0.0.0/0 Allow
* All traffic All All 0.0.0.0/0 Deny
Outbound
Rule number Type Protocol Port range Destination Allow/Deny
100 All traffic All All 0.0.0.0/0 Allow
* All traffic All All 0.0.0.0/0 Deny
我在子网上设置了流日志,并且可以看到双向流量都被接受。
我没有设置任何接口终端来直接访问AWS服务而不经过Internet Gateway。
同时,我创建Fargate实例时分配了公共IP地址。
这应该可以正常工作,因为公共子网应该通过Internet Gateway访问所有所需的服务。在默认VPC或私有子网中也可以正常工作。
有人能建议我检查什么以调试此问题吗?