Skip to content
This repository was archived by the owner on Jan 3, 2022. It is now read-only.
This repository was 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

@ErrorsAndGlitches

Description

@ErrorsAndGlitches

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions