所以我有以下内容
foo.bar.output这给了我类似的东西array[14],这意味着它包含 14 个元素
现在我想在每个数组索引中选择特定属性array[i]并将其存储在新的 JSON 对象中
样本值
{
"description" : "sample",
"link" : "mylink",
"id" :"myid",
"deviceName:"mydevice"
},
Run Code Online (Sandbox Code Playgroud)
这样的迭代有 14 次,
在每次迭代中我只想选择id和deviceName其存储在单独的 JSON 对象中
所以我创建的最终 JSON 对象应该如下所示
{
"id":"myid",
"deviceName:"mydevice"
},
Run Code Online (Sandbox Code Playgroud)
我没有使用 jQuery 的经验,我真的很困惑如何解决这个问题,非常感谢任何帮助:)
{
"containerDefinitions": [
{
"name": "container-using-efs",
"image": "amazonlinux:2",
"entryPoint": [
"sh",
"-c"
],
"command": [
"ls -la /mount/efs"
],
"mountPoints": [
{
"sourceVolume": "myEfsVolume",
"containerPath": "/mount/efs",
"readOnly": true
}
]
}
],
"volumes": [
{
"name": "myEfsVolume",
"efsVolumeConfiguration": {
"fileSystemId": "fs-1234",
"rootDirectory": "/path/to/my/data"
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个 EFS 文件系统,分配给它的安全组允许入站 NFS,并且 EFS 使用该安全组以及我的 ECS 集群使用的子网和 VPC
问题
当我使用 AWS 管理控制台在我的任务定义中创建挂载点时,我必须输入containerPathelsemountPoints未反映在我的 JSON 中
题
1)我应该containerPath在mountPoints什么之下?
2)我应该指定一个rootDirectoryunder …
amazon-web-services amazon-ecs docker dockerfile docker-compose