无法将 json 文件传递到 AWS autoscaling create-launch-configuration --block-device-mapping
Trouble passing json file to AWS autoscaling create-launch-configuration --block-device-mapping
目前命令看起来像这样
aws autoscaling create-launch-configuration --block-device-mapping file://mappings.json
并且在 mappings.json 内是
{
"DeviceName": "/dev/sda1",
"Encrytped":false,
"DeleteOnTermination":true,
"Ebs": {
"VolumeSize":300,
"VolumeType":"gp2"
}
}
命令给出的错误
Error parsing parameter '--block-device-mappings': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 2(char 1)
JSON received: {
注意我 运行 这个命令在 windows 子系统上。
我试过用 \ 转义 mappings.json 中的每个 " 但它没有用
block-device-mappings
应该是一个列表:
[{
"DeviceName": "/dev/sda1",
"Encrytped": false,
"DeleteOnTermination": true,
"Ebs": {
"VolumeSize": 300,
"VolumeType": "gp2"
}
}]
请注意,还有许多其他信息缺失(或问题中未提供)才能使命令正常工作。因此,仅修复 block-device-mappings
不会导致命令成功执行。
目前命令看起来像这样
aws autoscaling create-launch-configuration --block-device-mapping file://mappings.json
并且在 mappings.json 内是
{
"DeviceName": "/dev/sda1",
"Encrytped":false,
"DeleteOnTermination":true,
"Ebs": {
"VolumeSize":300,
"VolumeType":"gp2"
}
}
命令给出的错误
Error parsing parameter '--block-device-mappings': Invalid JSON: Expecting property name enclosed in double quotes: line 1 column 2(char 1)
JSON received: {
注意我 运行 这个命令在 windows 子系统上。
我试过用 \ 转义 mappings.json 中的每个 " 但它没有用
block-device-mappings
应该是一个列表:
[{
"DeviceName": "/dev/sda1",
"Encrytped": false,
"DeleteOnTermination": true,
"Ebs": {
"VolumeSize": 300,
"VolumeType": "gp2"
}
}]
请注意,还有许多其他信息缺失(或问题中未提供)才能使命令正常工作。因此,仅修复 block-device-mappings
不会导致命令成功执行。