aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(aws-apigateway): specifying REGIONAL results in EDGE optimized api-gateway

Open codernaive opened this issue 6 years ago • 3 comments

Specifying REGIONAL endpointType results in api-gateway being created as EDGE optimized. This worked yesterday - doesn't work today. Seems odd.

Reproduction Steps

this.apiDomainNameOptions = {
            domainName,
            certificate,
            securityPolicy: agw.SecurityPolicy.TLS_1_2,
            mtls: {
                bucket,
                key: 'truststore.pem',
            },
            endpointType: agw.EndpointType.REGIONAL,
        };

What did you expect to happen?

REGIONAL api-gateway created

What actually happened?

Edge optimized gateway created

7:35:24 PM | CREATE_FAILED        | AWS::ApiGateway::BasePathMapping | books-api/CustomDo...ckbooksapi6501FC16
Mutual TLS authentication is supported for Regional APIs only (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: ac7028b1-4d40-46ad-ba42-01006182
c9d7; Proxy: null)

Environment

  • CDK CLI Version : 1.75
  • Framework Version: 1.75.0 (build 7708242)
  • Node.js Version: v10.22.1
  • OS : Ubuntu 20.04
  • Language (Version): TypeScript 3.7.5

Other


This is :bug: Bug Report

codernaive avatar Nov 25 '20 03:11 codernaive

Double checked synth creation yaml and confirm that yaml specifies REGIONAL

booksapiCustomDomainXXXXXXXX:
    Type: AWS::ApiGateway::DomainName
    Properties:
      DomainName: api.inflectionpoint.org
      EndpointConfiguration:
        Types:
          - REGIONAL
      MutualTlsAuthentication:
        TruststoreUri: s3://1234567890-auth-store/truststore.pem
      RegionalCertificateArn:
        Fn::GetAtt:
          - apicertCertificateRequestorResourceXXXXXXXX
          - Arn
      SecurityPolicy: TLS_1_2

codernaive avatar Nov 25 '20 03:11 codernaive

Unfortunately, the CDK goes only as far as synthesizing the CloudFormation template. If the template is correct and the behaviour is still incorrect, you will need to reach out to the API Gateway service team via AWS support.

nija-at avatar Nov 30 '20 11:11 nija-at

If anyone comes across this issue, this was fixed by an internal AWS team. If you see this again it is likely an issue with AWS and not aws-cdk per se as mentioned by nija-at.

codernaive avatar Dec 11 '20 14:12 codernaive