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

VpcEndpointType of AWS::EC2::VPCEndpoint is removed after processing #121

Open
neoghostz opened this issue Sep 28, 2018 · 6 comments
Open
Assignees
Labels
question Further information is requested

Comments

@neoghostz
Copy link

neoghostz commented Sep 28, 2018

Any key:value pair that has a value of "Interface" will be stripped and removed from the CFN definition

  VPCEndpoint:
    Type: AWS::EC2::VPCEndpoint
    Properties:
      VpcId:
        Fn::ImportValue: !Sub "${VPCStack}-VPCid"
      ServiceName: !Ref ServiceEndpoint
      VpcEndpointType: Interface
      SubnetIds:
        - Fn::ImportValue: !Sub "${VPCStack}-Subnet-PerimeterInternal1"
        - Fn::ImportValue: !Sub "${VPCStack}-Subnet-PerimeterInternal2"
        - Fn::ImportValue: !Sub "${VPCStack}-Subnet-PerimeterInternal3"
      SecurityGroupIds:
        - Fn::ImportValue: !Sub "${SecurityStack}-SecGroup-${SecurityGroup}"

If you run through generate or upsert the key is removed from properties.

Currently effects 0.3.7 and 0.3.8, it could effect earlier releases.

@ojkelly
Copy link
Contributor

ojkelly commented Sep 28, 2018

So this isn't working because the definition for that property is set as (in ./pkg/parsers/resources/EC2-VPCEndpoint.go):

	VPCEndpointType     interface{} `yaml:"VPCEndpointType,omitempty"`

The cloudformation docs define it as (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html#cfn-ec2-vpcendpoint-vpcendpointtype):

VpcEndpointType
    The type of endpoint. Valid values are Interface and Gateway.
    Required: No
    Type: String
    Update requires: No interruption

The difference being VPC vs Vpc.

Curiously, it's defined with uppercase in the Cloudformation JSON spec. So I'm inclined to think the actual docs are out of sync with the implementation.

@ojkelly ojkelly assigned ojkelly and iann0036 and unassigned ojkelly Sep 28, 2018
@ojkelly ojkelly added the question Further information is requested label Sep 28, 2018
@ojkelly ojkelly changed the title key:value pairs with a Value of "Interface" are stripped from the Properties object VpcEndpointType of AWS::EC2::VPCEndpoint is removed after processing Sep 28, 2018
@iann0036
Copy link
Member

The CloudFormation team has confirmed the spec is incorrect and will work to amend.

@iann0036
Copy link
Member

iann0036 commented Oct 7, 2018

Workaround in place. Will resolve this when AWS team fixes and we remove the workaround.

@ojkelly ojkelly closed this as completed Nov 21, 2018
@iann0036
Copy link
Member

iann0036 commented Dec 2, 2018

Also defined at aws/aws-cdk#765 and awslabs/goformation#105

@henrysachs
Copy link

hey is there any workaround i can use? i still get this issue with the latest aws-cdk

@ojkelly
Copy link
Contributor

ojkelly commented Feb 21, 2019

Can you try the latest version of kombustion, it was updated recently to pass through everything without doing validation locally. Because, the cfn service is always going to be the source of truth on that, and to better work with macros.

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

No branches or pull requests

4 participants