【发布时间】:2017-12-23 15:13:15
【问题描述】:
考虑云形成模板的这一部分:
# VPC
myVPC:
Type: "AWS::EC2::VPC"
Properties:
CidrBlock: 10.99.99.0/24
# Security group
http_sec_group:
Type: "AWS::EC2::SecurityGroup"
Properties:
GroupName: http_in
GroupDescription: "Allow http traffic inbound"
VpcId: !Ref myVPC
SecurityGroupIngress:
- ToPort: 80
IpProtocol: tcp
验证它会返回此错误:
调用ValidateTemplate操作时发生错误(ValidationError):无效的模板资源属性'myVPC'
语法看起来正确,但为什么引用返回错误?
【问题讨论】:
-
我的 yml 文件没有使用引号:类型:AWS::EC2::VPC。 yml 格式是否正确?
-
您分享的模板看起来不错。如果您可以共享整个模板,将会很有帮助。