gpt4 book ai didi

amazon-web-services - AWS SAM : An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameters: [IdentityNameParameter] must have values

转载 作者:行者123 更新时间:2023-12-03 16:37:20 32 4
gpt4 key购买 nike

我想开始使用 AWS SAM,但在尝试部署到 AWS 时遇到了这个问题。

我正在尝试部署一个可以找到的“Hello World!”应用程序 here .

这是我遇到的错误:

$ sam package --s3-bucket dolphin-code --s3-prefix prod --output-template-file packaged.yaml --region eu-central-1

上传到 prod/de65208b144ad296cfdc39666a47ad1c 34671/34671.0 (100.00%)
成功打包工件并将输出模板写入文件 packaged.yaml。
执行以下命令部署打包的模板
sam deploy --template-file/builds/gitlab/dohin/apis/hello-world/packaged.yaml --stack-name

$ sam deploy --template-file ./packaged.yaml --stack-name prod --capabilities CAPABILITY_IAM --region eu-central-1
Deploying with following values
===============================
Stack name : prod
Region : eu-central-1
Confirm changeset : False
Deployment s3 bucket : None
Capabilities : ["CAPABILITY_IAM"]
Parameter overrides : {}

Initiating deployment
=====================
Error: Failed to create changeset for the stack: prod, An error occurred (ValidationError) when
calling the CreateChangeSet operation: Parameters: [IdentityNameParameter] must have values
ERROR: Job failed: exit code 1

对我来说,这似乎是 AWS CLI 中的错误,而不是直接在 SAM 中的错误,对吗?

谁能帮我?提前致谢!

最佳答案

您似乎在 sam 模板中使用了一个名为“IdentityNameParameter”的参数,并且它没有默认值,因此 Sam 希望您为其提供一个值。

您可以在使用标志 --parameters-overrides 调用 sam deploy 时设置该值

$ sam deploy --template-file ./packaged.yaml --stack-name prod --capabilities CAPABILITY_IAM --region eu-central-1 --parameter-overrides IdentityNameParameter=xyz

或者在你的 SAM 模板中给它一个默认值

Parameters: 
IdentityNameParameter:
Type: String
Default:"xyz"

您可以在此处阅读有关 sam deploy 命令的更多信息 https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html

关于amazon-web-services - AWS SAM : An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameters: [IdentityNameParameter] must have values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59894901/

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