Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 创建从参数文件读取的更改集_Amazon Web Services_Amazon Cloudformation - Fatal编程技术网

Amazon web services 创建从参数文件读取的更改集

Amazon web services 创建从参数文件读取的更改集,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,问题 我正在运行createchangeset命令,该命令将查找参数文件,但收到一条CLI错误消息 代码 aws cloudformation create-change-set --stack-name arn:aws:cloudformation:eu-west-1:xxxxxxxxxxxxxx:stack/JM-MachineLearning/0846dff0-5f91-11e9-8422-0a9391483dc6 --template-body packaged.yaml --para

问题 我正在运行createchangeset命令,该命令将查找参数文件,但收到一条CLI错误消息

代码

aws cloudformation create-change-set --stack-name  arn:aws:cloudformation:eu-west-1:xxxxxxxxxxxxxx:stack/JM-MachineLearning/0846dff0-5f91-11e9-8422-0a9391483dc6 --template-body packaged.yaml --parameters teststackupdate.json --change-set-name SampleChangeSet2 
Parameter validation failed:
Invalid type for parameter Parameters[0].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[1].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[2].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[3].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[4].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
cat teststackupdate.json
[
        {
                "ParameterKey": "DeploymentName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "KinesisName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "serverName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "LambdaFunctionName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "LambdaTimeout",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "payloadBucketName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "nameTableEvent",
                "UsePreviousValue": "true"
        }
]
错误消息

aws cloudformation create-change-set --stack-name  arn:aws:cloudformation:eu-west-1:xxxxxxxxxxxxxx:stack/JM-MachineLearning/0846dff0-5f91-11e9-8422-0a9391483dc6 --template-body packaged.yaml --parameters teststackupdate.json --change-set-name SampleChangeSet2 
Parameter validation failed:
Invalid type for parameter Parameters[0].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[1].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[2].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[3].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
Invalid type for parameter Parameters[4].UsePreviousValue, value: true, type: <type 'unicode'>, valid types: <type 'bool'>
cat teststackupdate.json
[
        {
                "ParameterKey": "DeploymentName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "KinesisName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "serverName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "LambdaFunctionName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "LambdaTimeout",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "payloadBucketName",
                "UsePreviousValue": "true"
        },
        {
                "ParameterKey": "nameTableEvent",
                "UsePreviousValue": "true"
        }
]
我要做的是更新AWS Cloudformation中的堆栈。 我从SAM通过CLI创建了堆栈,转换成Cloudformation,然后部署

我确实通过CLI运行了该命令,但这也不起作用 ParameterKey=string,ParameterValue=string,UsePreviousValue=boolean,ResolvedValue=string

通过CLI运行参数

aws cloudformation create-change-set --stack-name arn:aws:cloudformation:eu-west-1:xxxxxxxxxxx:stack/JM-MachineLearning/0846dff0-5f91-11e9-8422-0a9391483dc6 --change-set-name SampleChangeSet2  --parameter LambdaFunctionName=MachineLearningMementoDynamoDBSaver nameTableEvent=MachineLearningEvent nameTableCountersEvent=MachineLearningCountersEventId nameTableCountersEventRowId=MachineLearningCountersEventRowId serverName=LambdaMachineLearning KinesisName=MachineLearningDataStream payloadBucketName=redcloud-machinelearning-6888/memento/error-payload --profile DEV  --region eu-west-1

Parameter validation failed:
Unknown parameter in Parameters[0]: "LambdaFunctionName", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[1]: "nameTableEvent", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[2]: "nameTableCountersEvent", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[3]: "nameTableCountersEventRowId", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[4]: "serverName", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[5]: "KinesisName", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
Unknown parameter in Parameters[6]: "payloadBucketName", must be one of: ParameterKey, ParameterValue, UsePreviousValue, ResolvedValue
任何建议都会被提出

我是新来的


谢谢编辑:再想一想,这可能不是你的问题,但一定要试试看错误是否会改变。希望其他人能提供更好的答案

在teststackupdate.json中,您有:

"UsePreviousValue": "true"
"UsePreviousValue": true
您的true在引号中,使其成为字符串。 错误告诉您它需要是布尔值,即true/false

取消引用所有“true”,使其看起来像: