【发布时间】:2021-02-25 17:21:01
【问题描述】:
我有一个带有作业定义的 AWS Batch 计算环境。
我使用 Cloud Formation 创建了这一切。
现在我想在此作业定义中添加一个 EFS 卷(名称:EFS-000,文件系统 ID:fs-9999999)和一个 MountPoint。
我读过
- https://docs.aws.amazon.com/AmazonECS/latest/developerguide/tutorial-efs-volumes.html
- https://aws.amazon.com/es/premiumsupport/knowledge-center/batch-mount-efs
在第一个链接中,我们有一个任务定义示例(AWS ECS 而不是 AWS Batch 概念)
{
"containerDefinitions": [
{
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"essential": true,
"mountPoints": [
{
"containerPath": "/usr/share/nginx/html",
"sourceVolume": "efs-html"
}
],
"name": "nginx",
"image": "nginx"
}
],
"volumes": [
{
"name": "efs-html",
"efsVolumeConfiguration": {
"fileSystemId": "fs-1324abcd",
"transitEncryption": "ENABLED"
}
}
],
"family": "efs-tutorial"
}
似乎很容易将正确的代码添加到我的 Cloud Formation 配方中(我选择了 yaml 语法)。我在 ContainerDefinition 中添加了...
Volumes:
- Name: SRV
EfsVolumeConfiguration:
FileSystemId: fs-9999999
TransitEncryption: ENABLED
但是当我运行 Cloud Formation 配方时,我得到......
The following resource(s) failed to update: [ContentJob1].
Property validation failure: [Encountered unsupported properties in {/ContainerProperties/Volumes/0}: [EfsVolumeConfiguration]]
如果 EfsVolumeConfiguration 不是有效属性...
如何使用 Cloud Formation 将 EFS 卷添加到 AWS 批处理作业定义?
【问题讨论】:
标签: amazon-web-services amazon-cloudformation amazon-ecs amazon-efs aws-batch