【发布时间】:2020-01-10 19:46:37
【问题描述】:
我正在尝试构建我的第一个更大的 Cloudformation 模板;但是,我一直遇到图像选择过程的问题,因为它不喜欢我当前的配置。
我正在尝试让用户选择一个 Windows 操作系统版本,然后让 CFN 模板选择与此 Windows 版本匹配的 AMI。
yaml
Mappings:
ImageMapping:
WindowsImage:
Windows2008R2: ami-0d8a5c68b4550ced5
Windows2012: ami-0196cda9251876643
Windows2012R2: ami-0196cda9251876643
Windows2016: ami-04ad37d2932b886c0
Windows2019: ami-04ad37d2932b886c0
Parameters:
ImageIdParameters:
AllowedValues:
- Windows2019
- Windows2016
- Windows2012R2
- Windows2012
- Windows2008R2
Default: Windows2019
Description: "Enter Windows OS Version. Default Windows 2019"
Type: String
Rescources:
EC2Instance:
Properties:
ImageId: !FindInMap [ImageMapping, !Ref "WindowsImage", !Ref ImageIdParameters]
模板包含错误。:模板格式错误:模板的资源块中未解决的资源依赖项 [WindowsImage]
【问题讨论】:
标签: yaml amazon-cloudformation