Issue an error for missing property names
This commit is contained in:
parent
a82a49291b
commit
069342fef6
|
@ -71,9 +71,9 @@ services:
|
|||
DestinationCidrBlock: destinationCidrBlock
|
||||
RouteTableId: routeTable
|
||||
InternetGatewayId: internetGateway
|
||||
VpnGatewayId: vpnGateway
|
||||
InstanceId: instance
|
||||
NatGatewayId: natGateway
|
||||
NetworkInterfaceId: networkInterface
|
||||
VpcPeeringConnectionId: vpcPeeringConnection
|
||||
#VpnGatewayId: vpnGateway
|
||||
#InstanceId: instance
|
||||
#NatGatewayId: natGateway
|
||||
#NetworkInterfaceId: networkInterface
|
||||
#VpcPeeringConnectionId: vpcPeeringConnection
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ services:
|
|||
resource: "AWS::EC2::RouteTable"
|
||||
properties:
|
||||
VpcId: vpc
|
||||
Tags: tag
|
||||
Tags: tags
|
||||
{{if has .Properties "name" -}}
|
||||
extraProperties:
|
||||
Tags:
|
||||
|
|
|
@ -42,8 +42,7 @@ services:
|
|||
CidrBlock: cidrBlock
|
||||
EnableDnsSupport: enableDnsSupport
|
||||
InstanceTenancy: instanceTenancy
|
||||
EnableDnsHostnames: EnableDnsHostnames
|
||||
InstanceTenancy: instanceTenancy
|
||||
EnableDnsHostnames: enableDnsHostnames
|
||||
Tags: tags
|
||||
{{if has .Properties "name" -}}
|
||||
extraProperties:
|
||||
|
|
|
@ -27,5 +27,5 @@ services:
|
|||
properties:
|
||||
VpcId: vpc
|
||||
InternetGatewayId: internetGateway
|
||||
VpnGatewayId: vpnGateway
|
||||
#VpnGatewayId: vpnGateway
|
||||
|
||||
|
|
|
@ -309,6 +309,13 @@ func (c *awsCloud) genCFIntrinsicServiceTemplate(comp core.Compiland, stack *ast
|
|||
from := cf.Properties.StringStringMap[to]
|
||||
if p, has := stack.BoundPropertyValues[from]; has {
|
||||
resProps[to] = c.propertyLiteralToValue(p)
|
||||
} else {
|
||||
// It's ok if there is no bound property for this; that just means the caller didn't supply a value, which
|
||||
// is totally legal for optional properties. But at least make sure the property refers to a valid property
|
||||
// name, otherwise this could be a mistake (mispelled name, etc).
|
||||
if _, has := stack.Properties[from]; !has {
|
||||
c.Diag().Errorf(ErrorPropertyNotFound.At(stack), from)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,12 @@ var ErrorMarshalingCloudFormationTemplate = &diag.Diag{
|
|||
Message: "An error occurred when marshaling the output AWS CloudFormation template: %v",
|
||||
}
|
||||
|
||||
var ErrorDuplicateExtraProperty = &diag.Diag{
|
||||
var ErrorPropertyNotFound = &diag.Diag{
|
||||
ID: 10001,
|
||||
Message: "Extra property %v conflicts with an existing auto-mapped property; did you mean to use skipProperties?",
|
||||
Message: "Property %v was not found within this stack",
|
||||
}
|
||||
|
||||
var ErrorDuplicateExtraProperty = &diag.Diag{
|
||||
ID: 10002,
|
||||
Message: "Extra property %v conflicts with an existing mapped property",
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue