gpt4 book ai didi

amazon-web-services - Azure DevOps Cloudformation 更新堆栈使用参数文件失败(##[错误]ValidationError : Parameters: do not exist in the template)

转载 作者:行者123 更新时间:2023-12-04 09:34:42 25 4
gpt4 key购买 nike

我有一个使用 AWS CloudFormation 更新堆栈任务的 Azure DevOps 构建管道。 CF 模板是指存储在参数文件中的参数。部署时,构建失败,因为任务找不到我在参数文件中引用的参数。

例如文件本身:

[
{
"ParameterKey": "EnvironmentParameter",
"ParameterValue": "dev"
},
{
"ParameterKey": "DBHost",
"ParameterValue": "xxxxxxxxx.amazonaws.com"
}
]

该任务引用我的模板参数文件:

enter image description here

这是模板本身的引用:

"dbhostparameter"      : {
"Type" : "AWS::SSM::Parameter",
"Properties" : {
"Name" : "/LCS/Database/host",
"Type" : "String",
"Value" : {
"Fn::Sub" : [
"${env}",
{
"env" : {
"Ref" : "DBHost"
}
}
]
},

这是失败输出(显示它成功加载模板参数文件)

2020-06-29T22:37:36.2709027Z Updating stack with template file d:\a\1\s\parameters\parameters.template
2020-06-29T22:37:36.2709794Z Loading template file from 'd:\a\1\s\parameters\parameters.template'
2020-06-29T22:37:36.2713615Z Loading template parameters file 'd:\a\1\s\parameters_ssm_dev.json'
2020-06-29T22:37:36.2715581Z Successfully loaded template parameters
2020-06-29T22:37:36.2716132Z Setting capability CAPABILITY_IAM for stack
2020-06-29T22:37:36.2716592Z Setting capability CAPABILITY_NAMED_IAM for stack
2020-06-29T22:37:36.4072822Z Stack update request failed with error: 'Parameters: [DBHost] do not exist in the template' { ValidationError: Parameters: [DBHost] do not exist in the template
2020-06-29T22:37:36.4074350Z at constructor.extractError (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:87664)
2020-06-29T22:37:36.4077291Z at constructor.callListeners (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:95965)
2020-06-29T22:37:36.4078548Z at constructor.emit (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:95675)
2020-06-29T22:37:36.4079603Z at constructor.emitEvent (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:167913)
2020-06-29T22:37:36.4080477Z at constructor.e (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:163452)
2020-06-29T22:37:36.4083390Z at r.runTo (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:169755)
2020-06-29T22:37:36.4084174Z at d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:169961
2020-06-29T22:37:36.4086749Z at constructor.<anonymous> (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:163722)
2020-06-29T22:37:36.4087643Z at constructor.<anonymous> (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:167969)
2020-06-29T22:37:36.4088469Z at constructor.callListeners (d:\a\_tasks\CloudFormationCreateOrUpdateStack_7ef7cdfa-aa45-42c5-93c8-d7603643dd99\1.7.0\CloudFormationCreateOrUpdateStack.js:2:96071)
2020-06-29T22:37:36.4089053Z message: 'Parameters: [DBHost] do not exist in the template',
2020-06-29T22:37:36.4089378Z code: 'ValidationError',

最佳答案

基于评论。

问题是缺少参数部分部分。

解决方案是添加该部分

关于amazon-web-services - Azure DevOps Cloudformation 更新堆栈使用参数文件失败(##[错误]ValidationError : Parameters: do not exist in the template),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62647840/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com