A collection of configuration templates for AWS ApiGateway as well as security controls for monitoring and protecting AWS ApiGateway configuration such as Config Rules, CloudWatch Alarms, EventBridge Rules, IAM policies, and more.
This template creates a stage for the `TestDeployment` deployment. The stage specifies the stage name as `Prod` and the description as `Prod Stage`. It also references the `MyRestApi` API, `TestDeployment` deployment, `MyDocumentationVersion` documentation version, and `ClientCertificate` client certificate. The stage includes variables with the value `Prod` for the `Stack` variable. Additionally, it defines method settings for different resource paths and HTTP methods, enabling metrics and disabling data trace. The `/stack` resource path with the `POST` HTTP method has a throttling burst limit of `999`, while the `/stack` resource path with the `GET` HTTP method has a throttling burst limit of `555`.
This template creates an API Gateway VPC link for a REST API to access resources in an Amazon Virtual Private Cloud (VPC). It creates an API Gateway VPC link with the specified description and name. The VPC link is associated with a load balancer and a subnet in the VPC.
This template creates an `AWS::ApiGateway::UsagePlanKey` resource that associates a new API key with a usage plan (usageplan-1234567).
This template creates a usage plan for the Prod API stage, with a quota of 5000 requests per month and a rate limit of 100 requests per second. It includes the properties for the API stages, description, quota, throttle, and usage plan name.
This template imports an API Gateway RestApi resource with an endpoint type of REGIONAL. The RestApi resource is named 'RestApi' and includes a Swagger OpenAPI specification in the 'Body' property. The endpoint type is set to REGIONAL and the RestApi has a name of 'myApi'.
This template creates an API Gateway RestApi resource with an endpoint type. The template includes parameters for 'apiName' and 'type'. The RestApi resource is named 'MyRestApi' and the endpoint type is set to the value of the 'type' parameter.
This template creates a resource in an API. It creates a `stack` resource for the `MyApi` API. The `RestApiId` property is set to the `RestApi` reference. The `ParentId` property is set to the `RootResourceId` of the `RestApi` resource. The `PathPart` property is set to `stack`.
This template creates an `AWS::ApiGateway::Model` resource that defines the structure of a request or response payload for an API method. The model is created with the specified properties, such as the REST API ID, content type, description, name, and schema. The schema is defined using JSON Schema and specifies the structure of the payload.
This template creates a REST API, method, and request validator, and associates the request validator with the method.
This template creates a proxy resource to enable clients to call a Lambda function with a single integration setup on a catch-all ANY method. It sets the `RestApiId` property to the `LambdaSimpleProxy` reference, the `ResourceId` property to the `ProxyResource` reference, the `HttpMethod` property to `ANY`, the `AuthorizationType` property to `NONE`, and the `Integration` property to `AWS_PROXY` with the `IntegrationHttpMethod` property set to `POST` and the `Uri` property set to the ARN of the `LambdaForSimpleProxy` function.
This template creates a mock GET method for the `MyApi` API. It sets the `RestApiId` property to the `MyApi` reference, the `ResourceId` property to the `MyApi`'s root resource ID, the `HttpMethod` property to `GET`, the `AuthorizationType` property to `NONE`, and the `Integration` property to `MOCK`.
This template creates a gateway response for a 404 status code. It sets the response parameters for Access-Control-Allow-Origin and Access-Control-Allow-Headers, and associates it with a specific REST API.
This template creates a custom domain name of `example.mydomain.com` for an API in API Gateway. It uses parameters to specify the domain name, base path, and REST API name. It also creates a certificate, a base path mapping, and a REST API resource.
This template creates a documentation part for an API entity and associates it with a documentation version. It creates a `RestApi` resource with the specified name. Then it creates a `DocumentationPart` resource with the specified location, `RestApiId`, and `Properties`. Finally, it creates a `DocumentationVersion` resource with the specified description, documentation version, and `RestApiId`.
This template creates an API Gateway deployment for the `my-rest-api` API. It deploys the API to a stage named `DummyStage`. The deployment is described as `My deployment`.
This template creates a client certificate that can be used with an API Gateway deployment and stage. The client certificate is created with a description of 'A test client certificate'.
This template creates a custom authorizer for AWS API Gateway. The authorizer is an AWS Lambda function that is activated for methods with authorization enabled. The template sets the properties for the authorizer, including the authorizer credentials, result TTL in seconds, authorizer URI, type, identity source, name, and REST API ID.
This template creates an API key and associates it with the Test stage of the TestAPIDeployment deployment. The API key is named TestApiKey and has a description of CloudFormation API Key V1. It is enabled and associated with the RestApi and Stage resources specified in the template.
This template creates an IAM role that API Gateway can assume to push logs to CloudWatch Logs. The example associates the role with the `AWS::ApiGateway::Account resource`.
Configures a complete API Gateway setup including REST API, deployment, stage, and method settings for logging and metrics.
This Terraform template retrieves an SDK for an AWS API Gateway stage configured for an Android application.
This template connects a custom domain name to a deployed API Gateway, allowing API methods to be accessed via the custom domain.
Deploys an API Gateway REST API configured via OpenAPI specification and sets up a stage for deployment.
Sets up a basic REST API with a mock integration and deploys it, including a stage setup.
This template creates an API Gateway Documentation Part for a specific method and path, along with an API Gateway REST API.
Manages an API Gateway Documentation Version along with its associated REST API and Documentation Part.
Configures an edge-optimized API Gateway with an ACM certificate and sets up a corresponding DNS record using Route53.
Configures a regional API Gateway with an ACM certificate and sets up a corresponding DNS record using Route53.
This template customizes the response for unauthorized requests in an AWS API Gateway REST API.
Creates an API Gateway with a REST API, a resource, a GET method, and a MOCK integration that transforms XML requests to JSON.
This template sets up an API Gateway with a MOCK integration and a method response, transforming JSON to XML.
Creates a basic AWS API Gateway setup with a REST API, a resource, and a GET method.
Sets up a basic API Gateway with a GET method and a mock integration, along with a 200 OK method response.
Configures an API Gateway with a GET method, mock integration, and a 200 OK method response that includes a custom header and a response model.
Creates an API Gateway and a model within it using Terraform.
Creates an API Gateway REST API and a resource within it.
Creates a REST API using an OpenAPI specification with a regional endpoint configuration.
Configures a REST API using an OpenAPI specification with private endpoint configuration in a VPC.
Sets up a basic REST API with specific resources, methods, and a mock integration.
Creates a basic REST API in AWS API Gateway and attaches a custom IAM policy that allows invocation from a specific IP address.
This template sets up an API Gateway with a REST API, deploys it to development and production stages, and configures a usage plan with quota and throttle settings.
This template sets up an API Gateway with a usage plan and an API key, and associates them together.
This template uses quick create to launch an HTTP API resource called HttpApi that's integrated with a Lambda function.
This template creates an `ApiMapping` resource called `MyApiMapping`. It maps a path of a custom domain name to a stage of an API. The `DomainName` property specifies the custom domain name, the `ApiId` property references the API to map, and the `Stage` property references the stage of the API.
This template creates an API resource called MyApi with the following properties: Name: MyApi, ProtocolType: WEBSOCKET, RouteSelectionExpression: $request.body.action, ApiKeySelectionExpression: $request.header.x-api-key
Creates a WebSocket API authorizer using Amazon API Gateway Version 2 linked to a Lambda function.
Sets up an HTTP API authorizer with payload format version 2.0, using Amazon API Gateway Version 2 connected to a Lambda function.
Creates a deployment for an Amazon API Gateway Version 2 with redeployment triggers based on changes to the API's resources.
Integrates API Gateway with a private network load balancer using HTTP_PROXY.
Creates a basic API Gateway Version 2 model with a JSON schema.
Sets up an HTTP API with HTTP Proxy integration to forward requests to a specified backend.
A config rule that checks that Amazon API Gateway APIs are of type as specified (Allowed values are REGIONAL, PRIVATE and EDGE)
A config rule that checks that methods in an Amazon API Gateway stage for deployed APIs have 'loggingLevel' as one of the values specified in the rule parameter 'loggingLevel'.
A config rule that checks that all APIs are private or regional, and not edge optimised.
A config rule that checks that all private APIs uses resource policy restricting to VPC endpoints or VPC in the same AWS account.
A config rule that checks that non-private API GW have a resource based policy which limit their usage based on IP source
A Config rule that checks if a REST API stage uses an Secure Sockets Layer (SSL) certificate. This rule is NON_COMPLIANT if the REST API stage does not have an associated SSL certificate.
A Config rule that checks if X-Ray tracing is enabled on Amazon API Gateway REST APIs. The rule will return COMPLIANT if X-Ray tracing is enabled, NON_COMPLIANT otherwise.
A config rule that checks that Amazon API Gateway APIs are of type as specified (Allowed values are REGIONAL, PRIVATE and EDGE)
Checks if Amazon API Gateway V2 stages have access logging enabled. The rule is NON_COMPLIANT if 'accessLogSettings' is not present in Stage configuration.
Checks if Amazon API Gatewayv2 API routes have an authorization type set. This rule is NON_COMPLIANT if the authorization type is NONE.
Checks if an Amazon API Gateway API stage is using an AWS WAF web access control list (web ACL). The rule is NON_COMPLIANT if an AWS WAF Web ACL is not used or if a used AWS Web ACL does not match what is listed in the rule parameter.