Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Security Group Id for specifying ingress/egress rules creates incorrect JSON #26

Open
ErrorsAndGlitches opened this issue Dec 13, 2017 · 1 comment

Comments

@ErrorsAndGlitches
Copy link

When creating an ingress/egress rule using a security group ID, this creates incorrect JSON. For example, the following:

EC2SecurityGroupRule{
	SourceSecurityGroupIdXXSecurityGroupIngressXOnlyX: Ref(s.elbSecurityGroupLogicalName()).String(),
	IpProtocol:                                        String(tcpProtocol),
	FromPort:                                          Integer(httpsPort),
	ToPort:                                            Integer(httpsPort),
},

Generates the JSON:

{
    "FromPort": 443,
    "IpProtocol": "tcp",
    "SourceSecurityGroupId (SecurityGroupIngress only)": {
        "Ref": "LBSecurityGroupGamma"
    },
    "ToPort": 443
}

The expected output is:

{
    "FromPort": 443,
    "IpProtocol": "tcp",
    "SourceSecurityGroupId": {
        "Ref": "LBSecurityGroupGamma"
    },
    "ToPort": 443
}

This is probably due to how the scraper is scraping the AWS website, causing it to include the (SecurityGroupIngress only) as seen here:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-rule.html#cfn-ec2-security-group-rule-sourcesecuritygroupid

@pchico83
Copy link

@crewjam same issue here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants