amazon-web-services - 部署“未找到”堆栈时,某些给定参数未解析
问题描述
我想创建和部署一个模板,该模板本身会部署 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
?
解决方案
对于内部函数 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
推荐阅读
- reactjs - 重新获取特定 GraphQL 可观察查询的问题
- android - 当 Studio 找不到时,我如何在 Mac 上找到 Android SDK?
- python - 获取分组数据框中的行数
- python - 用标题值填充列
- python - 逻辑回归和 sklearn 的问题
- python - 如何在python中删除句子中井号(#)后面的句子
- ios - Xcode Playground:“错误:执行被中断,原因:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)”
- spring-boot - Spring Boot 版本小于 2.x 可以搭建 GraphQL 服务器吗?
- r - 如何绘制图表意味着随着时间的推移?
- javascript - 使用 javascript 从网页上的元素保存文本