你可以这样做自2020年4月起!这有点棘手但有效。
我遇到的最大问题是您需要将“平台版本”设置为 1.4.0 - 它将默认为“最新”,即 1.3.0。
在容器定义中,您需要定义一个volume and a 挂载点您希望将 EFS 共享安装在容器内的位置:
Volume:
"volumes": [
{
"efsVolumeConfiguration": {
"transitEncryptionPort": null,
"fileSystemId": "fs-xxxxxxx",
"authorizationConfig": {
"iam": "DISABLED",
"accessPointId": "fsap-xxxxxxxx"
},
"transitEncryption": "ENABLED",
"rootDirectory": "/"
},
"name": "efs volume name",
"host": null,
"dockerVolumeConfiguration": null
}
]
在容器中挂载卷:
"mountPoints": [
{
"readOnly": null,
"containerPath": "/opt/your-app",
"sourceVolume": "efs volume name"
}
这些帖子对我有帮助,尽管它们缺少一些细节:
教程:将 Amazon EFS 文件系统与 Amazon ECS 结合使用
EFS卷配置