Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(apigatewayv2): VpcLink subnet selection ignored #12083

Closed
ronaldslc opened this issue Dec 15, 2020 · 3 comments · Fixed by #12401
Closed

(apigatewayv2): VpcLink subnet selection ignored #12083

ronaldslc opened this issue Dec 15, 2020 · 3 comments · Fixed by #12401
Assignees
Labels
@aws-cdk/aws-apigatewayv2 Related to Amazon API Gateway v2 bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@ronaldslc
Copy link

new apiGateway.VpcLink(stack, 'VpcLink', {
   vpc: props.vpc,
   vpcLinkName: 'VpcLink',
   subnets: []
})

would result in all VPC subnets being added

  VpcLink66988216:
    Type: AWS::ApiGatewayV2::VpcLink
    Properties:
      Name: VpcLink
      SubnetIds:
        - Ref: XXXSubnet1SubnetC63F3793
        - Ref: XXXSubnet2SubnetB84D1BD7
        - Ref: XXXSubnet3Subnet6C7F7A39
      SecurityGroupIds: []

while

new apiGateway.VpcLink(stack, 'VpcLink', {
   vpc: props.vpc,
   vpcLinkName: 'VpcLink',
   subnets: [subnet2, subnet3]
})

would result in all VPC subnets being added PLUS the extras repeated

  VpcLink66988216:
    Type: AWS::ApiGatewayV2::VpcLink
    Properties:
      Name: VpcLink
      SubnetIds:
        - Ref: XXXSubnet1SubnetC63F3793
        - Ref: XXXSubnet2SubnetB84D1BD7
        - Ref: XXXSubnet3Subnet6C7F7A39
        - Ref: XXXSubnet2SubnetB84D1BD7
        - Ref: XXXSubnet3Subnet6C7F7A39
      SecurityGroupIds: []

Reproduction Steps

What did you expect to happen?

Select only specific subnets to deploy link to to resolve an issue with
Subnet 'subnet-0dfd3813bb77f3d7a' is in Availability Zone 'ape1-az1' where service is not available (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; happening for unknown reasons

What actually happened?

Cannot make workaround as the problematic subnet remains in the list in CloudFormation

Environment

  • CDK CLI Version : 1.78
  • Framework Version: 1.78
  • Node.js Version: 12.20.0
  • OS : MacOS 10.15.7
  • Language (Version): Typescript 3.9.7

Other


This is 🐛 Bug Report

@ronaldslc ronaldslc added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 15, 2020
@github-actions github-actions bot added the @aws-cdk/aws-apigatewayv2 Related to Amazon API Gateway v2 label Dec 15, 2020
@nija-at nija-at added p1 and removed p1 labels Dec 18, 2020
@nija-at
Copy link
Contributor

nija-at commented Jan 7, 2021

@ayush987goyal - are you able to take a look at this?

@ayush987goyal
Copy link
Contributor

@nija-at Let me check it out

@mergify mergify bot closed this as completed in #12401 Jan 7, 2021
mergify bot pushed a commit that referenced this issue Jan 7, 2021
…es private subnets to be included (#12401)

fix(apigatewayv2): specifying subnets to vpclink explicitly adds extra subnets

BREAKING CHANGE: `subnets` prop in `VpcLink` resource now takes `SubnetSelection` instead of `ISubnet[]`

closes #12083


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Jan 7, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-apigatewayv2 Related to Amazon API Gateway v2 bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants