Search code examples
amazon-web-servicesaws-lambdaterraformaws-api-gatewayterraform-provider-aws

Terraform apigatewayv2 IP protection (lambda)


Is there a way to IP Protect the HTTP API Endpoint of the API Gateway?

I tried to add an IAM Policy that allows IP's to the Lambda execution role but that didn't seem to work.

This is the high level structure of the API.

Route 53 Domain --> API Gateway V2 --> Lambda

I know the V1 (REST API) has functionality for a Resource based policy, but is there something similar for the V2 HTTP API?


Solution

  • is there something similar for the V2 HTTP API?

    There is not. Only REST API supports resource policies, as well as WAF. But you could setup Amazon Cognito for HTTP API, if you don't want to switch to REST API.