AWS Fundamentals Logo
AWS Fundamentals
AWS::ApiGatewayV2::Api

ApiGatewayV2 Api

The AWS::ApiGatewayV2::Api resource creates an API. WebSocket APIs and HTTP APIs are supported. For more information about WebSocket APIs, see [About WebSocket APIs in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-overview.html) in the *API Gateway Developer Guide*. For more information about HTTP APIs, see [HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api.html) in the *API Gateway Developer Guide.*

Properties

18 configurable properties. Click a row to see details.

Filter:
PropertyTypeFlags
ApiKeySelectionExpression
string
BasePath
string
Write-only
Body
object
Write-only
BodyS3Location
BodyS3Location
Write-only
CorsConfiguration
Cors
CredentialsArn
string
Write-only
Description
string
DisableExecuteApiEndpoint
boolean
DisableSchemaValidation
boolean
Write-only
FailOnWarnings
boolean
Write-only
IpAddressType
string
Name
string
ProtocolType
string
Create-only
RouteKey
string
Write-only
RouteSelectionExpression
string
Tags
object
Target
string
Write-only
Version
string

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
ApiEndpointstring-
ApiIdstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::ApiGatewayV2::Api

Resources:
  MyResource:
    Type: AWS::ApiGatewayV2::Api
    Properties:
      Tags:
        - Key: Environment
          Value: Production
      Description: !Ref "AWS::StackName"
      Name: !Ref "AWS::StackName"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

apigateway:POSTapigateway:PUTs3:getObject

update

apigateway:PATCHapigateway:GETapigateway:PUTapigateway:POSTs3:getObject

read

apigateway:GETs3:getObject

delete

apigateway:GETapigateway:DELETEs3:getObject

list

apigateway:GETs3:getObject

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

ServiceApiGatewayV2
Properties20
Required0
TaggingSupported
Primary IDApiId

Supported Operations

CreateUpdateReadDeleteList

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

ProtocolType

External Links