gpt4 book ai didi

amazon-web-services - 部署堆栈时某些给定参数未解析 "not found"

转载 作者:行者123 更新时间:2023-12-03 07:28:49 29 4
gpt4 key购买 nike

我想要创建并部署一个模板,该模板本身会部署 AWS 服务目录中的产品。这是我的模板:

Parameters:
ProductId:
Type: String
ProvisioningArtifactName:
Type: String
Description:
Type: String
Region:
Type: CommaDelimitedList
VpcSize:
Type: String
BastionHostKeyName:
Type: String
ProvisioningArtifactName:
Type: String
Resources:
VPCAndMore:
Type: AWS::ServiceCatalog::CloudFormationProvisionedProduct
Properties:
ProductId: ProductId
ProvisioningArtifactName: ProvisioningArtifactName
ProvisioningParameters:
- Key: Description
Value: Description
- Key: AvailabilityZones
Value: Region
- Key: VpcSize
Value: VpcSize
- Key: BastionHostKeyName
Value: BastionHostKeyName

当我尝试手动部署它时,我输入所有参数值。它们绝对是正确的并且来自正确的类型。但是一旦我部署它,我就会收到这样的错误:

Product ProductId not found. (Service: ServiceCatalog, Status Code: 400, Request ID: 35f27a2a-1317-48d0-815e-16ebe949d039, Extended Request ID: null)

由于某种原因,ProductId 参数似乎未解析。

我错过了什么?或者 CF 不支持 ProvisioningParameters 之外的参数解析?

最佳答案

对于Intrinsic function Ref需要引用如下定义的值:

Parameters:
ProductId:
Type: String
ProvisioningArtifactName:
Type: String
Description:
Type: String
Region:
Type: CommaDelimitedList
VpcSize:
Type: String
BastionHostKeyName:
Type: String
ProvisioningArtifactName:
Type: String
Resources:
VPCAndMore:
Type: AWS::ServiceCatalog::CloudFormationProvisionedProduct
Properties:
ProductId: !Ref ProductId
ProvisioningArtifactName: !Ref ProvisioningArtifactName
ProvisioningParameters:
- Key: Description
Value: !Ref Description
- Key: AvailabilityZones
Value: !Ref Region
- Key: VpcSize
Value: !Ref VpcSize
- Key: BastionHostKeyName
Value: !Ref BastionHostKeyName

关于amazon-web-services - 部署堆栈时某些给定参数未解析 "not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65814925/

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