AWS SAM:呼叫CreateChangeset操作时发生错误(验证)必须是一个数字
我正在为AWS RDS Aurora-Mysql云形式模板添加一个新参数。但是运行SAM部署
时,我会遇到以下错误。
sam deploy \
--region us-west-2 \
--stack-name xxxx \
--template-file build/product.yaml \
--capabilities CAPABILITY_IAM \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
VpcId=vpc-123456789 \
LambdaCodeBucket=artifacts-123456789
Deploying with following values
===============================
Stack name : xxxx
Region : us-west-2
Confirm changeset : False
Deployment s3 bucket : None
Capabilities : ["CAPABILITY_NAMED_IAM"]
Parameter overrides : {"VpcId": "vpc-123456789", "LambdaCodeBucket": "artifacts-123456789"}
Signing Profiles : {}
Initiating deployment
=====================
Error: Failed to create changeset for the stack: xxxx, An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameter 'MaxAllowedPacket' must be a number.
make: *** [deploy] Error 1
product.yaml代码:
MaxAllowedPacket:
Description: >-
This parameter indicates the maximum size of packet in bytes. Allowed values are between 1024 to 1073741824.
The default value is 4194304 (4 MB).
Type: Number
MinValue: 1024
MaxValue: 1073741824
Default: 4194304
....
Resources:
...
DBParameterGroup:
Type: AWS::RDS::DBParameterGroup
Properties:
Description: !Ref AWS::StackName
Family: aurora-mysql5.7
Parameters:
max_allowed_packet: !Ref MaxAllowedPacket
我已经将maxallowedpacket的类型设置为
numbern
用数字 min 和 Max ,默认值也是数字。因此,不清楚为什么要抛出此错误:错误:无法为堆栈创建更改:XXXX,在调用CreateChangeSet操作时发生错误(verialationError):参数“ maxloweredpacket”必须是数字。 make:*** [部署]错误1
我确实在其他类似的帖子上查看了 this ,但这无济于事。
I am adding a new parameter to my AWS RDS aurora-mysql CloudFormation template. But I am getting following error when running sam deploy
.
sam deploy \
--region us-west-2 \
--stack-name xxxx \
--template-file build/product.yaml \
--capabilities CAPABILITY_IAM \
--capabilities CAPABILITY_NAMED_IAM \
--parameter-overrides \
VpcId=vpc-123456789 \
LambdaCodeBucket=artifacts-123456789
Deploying with following values
===============================
Stack name : xxxx
Region : us-west-2
Confirm changeset : False
Deployment s3 bucket : None
Capabilities : ["CAPABILITY_NAMED_IAM"]
Parameter overrides : {"VpcId": "vpc-123456789", "LambdaCodeBucket": "artifacts-123456789"}
Signing Profiles : {}
Initiating deployment
=====================
Error: Failed to create changeset for the stack: xxxx, An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameter 'MaxAllowedPacket' must be a number.
make: *** [deploy] Error 1
product.yaml snippet:
MaxAllowedPacket:
Description: >-
This parameter indicates the maximum size of packet in bytes. Allowed values are between 1024 to 1073741824.
The default value is 4194304 (4 MB).
Type: Number
MinValue: 1024
MaxValue: 1073741824
Default: 4194304
....
Resources:
...
DBParameterGroup:
Type: AWS::RDS::DBParameterGroup
Properties:
Description: !Ref AWS::StackName
Family: aurora-mysql5.7
Parameters:
max_allowed_packet: !Ref MaxAllowedPacket
I have set the type for MaxAllowedPacket
as Number
with a numeric min and max and the default value is also numeric. So not clear why is it throwing this error: Error: Failed to create changeset for the stack: xxxx, An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameter 'MaxAllowedPacket' must be a number. make: *** [deploy] Error 1
I did look at other similar post on SO such as this, but it did not help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了这个问题。之所以发生这种情况,是因为我早些时候已将
maxallowedpacket
定义为String
,并创建了资源。旧代码:
将其更改为
号码
,试图更新相同的CloudFormation堆栈时它是失败的,因为该堆栈具有maxallowedPacket
作为字符串。为了确保这是问题,我用我的新代码(如下所示)创建了一个新的CF堆栈(以及新的资源),并且效果很好。
I found the issue. This was happening because I had earlier defined
MaxAllowedPacket
asString
and had created the resource with that.Old Code:
After changing it to
Number
, it was failing when trying to update the same CloudFormation Stack because that Stack was havingMaxAllowedPacket
as String.To ensure this was the issue, I created a new CF Stack (and hence new resource) with my new code (as shown on the question here) and it worked fine.