'AWS Cloudformation - How to attach vpc link / NLB to method in api gateway?
This has been such a pain in the backend to waste hours and still unable to get one line of AWS CloudFormation syntax clear.
If the AWS guys can write their documentation slightly better - just pay a little bit more attention to it - it would make like easier for the developers.
I am trying to use CloudFormation to deploy API Gateway with VPC Link and NLB. The Goal is to proxy pass all requests to the NLB:
ApiProxyMethod:
Type: AWS::ApiGateway::Method
Properties:
RestApiId: !Ref ApiGatewayRestApi
ResourceId: !Ref ApiProxyResource
# AuthorizationScopes: # https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-method.html#cfn-apigateway-method-authorizationscopes
AuthorizationType: COGNITO_USER_POOLS
AuthorizerId: !Ref ApiAuthorizer
HttpMethod: ANY
OperationName: "ProxyAllRequests"
Integration:
ConnectionType: VPC_LINK
ConnectionId: !Ref ApiGatewayVpcLink
IntegrationHttpMethod: ANY
PassthroughBehavior: String
Type: "VPC_LINK" # Member must satisfy enum value set: [HTTP, AWS_PROXY, HTTP_PROXY, AWS]
Uri: "http://NLB-myapp-internal-beta-12345.elb.ap-northeast-1.amazonaws.com/{proxy}"
However, this fails and it complains about wrong Type value: Member must satisfy enum value set: [HTTP, AWS_PROXY, HTTP_PROXY, AWS]
Now, which one of them is for VPC_Link / NLB?
They could have listed these values in the documentation of AWS::ApiGateway::Method Integration, but they choose not to.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
