确认已配置正确的 EFS 访问点和 ECS 任务,并确保它们在同一 VPC 和子网。
创建 Task Execution IAM 角色并为其添加以下策略:
{
"Effect": "Allow",
"Action": [
"elasticfilesystem:ClientMount",
"elasticfilesystem:ClientWrite",
"elasticfilesystem:ClientRootAccess"
],
"Resource": ""
}
{
"containerDefinitions": [
{
"name": "",
"image": "",
"mountPoints": [
{
"sourceVolume": "",
"containerPath": "",
"readOnly": false
}
],
"essential": true,
"memory": ,
"cpu": ,
"environment": [],
"logConfiguration": {
"logDriver": "",
"options": {}
},
"secrets": [],
"workingDirectory": "",
"disableNetworking": false,
"privileged": false,
"readonlyRootFilesystem": false,
"dnsServers": [],
"dnsSearchDomains": [],
"extraHosts": [],
"dockerSecurityOptions": [],
"interactive": false,
"healthCheck": {},
"systemControls": []
}
],
"volumes": [
{
"name": "",
"efsVolumeConfiguration": {
"fileSystemId": "",
"authorizationConfig": {
"accessPointId": ""
}
}
}
],
"family": "",
"taskRoleArn": "arn:aws:iam:::role/",
"executionRoleArn": "arn:aws:iam:::role/",
"networkMode": "awsvpc",
"requiresCompatibilities": [
"FARGATE"
],
上一篇:AWSECSFargate启动任务失败,错误信息为:CannotPullContainerError:checkschema1manifestsizehasbeenretried1time(s)