Api

Manages an Amazon API Gateway Version 2 API.

Note: Amazon API Gateway Version 2 resources are used for creating and deploying WebSocket and HTTP APIs. To create and deploy REST APIs, use Amazon API Gateway Version 1.

Example Usage

Basic WebSocket API

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.ApiGatewayV2.Api("example", new Aws.ApiGatewayV2.ApiArgs
        {
            ProtocolType = "WEBSOCKET",
            RouteSelectionExpression = "$request.body.action",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigatewayv2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigatewayv2.NewApi(ctx, "example", &apigatewayv2.ApiArgs{
			ProtocolType:             pulumi.String("WEBSOCKET"),
			RouteSelectionExpression: pulumi.String(fmt.Sprintf("%v%v", "$", "request.body.action")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.Api("example",
    protocol_type="WEBSOCKET",
    route_selection_expression="$request.body.action")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigatewayv2.Api("example", {
    protocolType: "WEBSOCKET",
    routeSelectionExpression: "$request.body.action",
});

Basic HTTP API

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.ApiGatewayV2.Api("example", new Aws.ApiGatewayV2.ApiArgs
        {
            ProtocolType = "HTTP",
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/apigatewayv2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigatewayv2.NewApi(ctx, "example", &apigatewayv2.ApiArgs{
			ProtocolType: pulumi.String("HTTP"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.Api("example", protocol_type="HTTP")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.apigatewayv2.Api("example", {
    protocolType: "HTTP",
});

Create a Api Resource

new Api(name: string, args: ApiArgs, opts?: CustomResourceOptions);
@overload
def Api(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        api_key_selection_expression: Optional[str] = None,
        body: Optional[str] = None,
        cors_configuration: Optional[ApiCorsConfigurationArgs] = None,
        credentials_arn: Optional[str] = None,
        description: Optional[str] = None,
        disable_execute_api_endpoint: Optional[bool] = None,
        fail_on_warnings: Optional[bool] = None,
        name: Optional[str] = None,
        protocol_type: Optional[str] = None,
        route_key: Optional[str] = None,
        route_selection_expression: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        target: Optional[str] = None,
        version: Optional[str] = None)
@overload
def Api(resource_name: str,
        args: ApiArgs,
        opts: Optional[ResourceOptions] = None)
func NewApi(ctx *Context, name string, args ApiArgs, opts ...ResourceOption) (*Api, error)
public Api(string name, ApiArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ApiArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ApiArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ApiArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ApiArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Api Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Api resource accepts the following input properties:

ProtocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
ApiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
Body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
CorsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
CredentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
Description string
The description of the API. Must be less than or equal to 1024 characters in length.
DisableExecuteApiEndpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
FailOnWarnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
Name string
The name of the API. Must be less than or equal to 128 characters in length.
RouteKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
RouteSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
Tags Dictionary<string, string>
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
Version string
A version identifier for the API. Must be between 1 and 64 characters in length.
ProtocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
ApiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
Body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
CorsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
CredentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
Description string
The description of the API. Must be less than or equal to 1024 characters in length.
DisableExecuteApiEndpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
FailOnWarnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
Name string
The name of the API. Must be less than or equal to 128 characters in length.
RouteKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
RouteSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
Tags map[string]string
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
Version string
A version identifier for the API. Must be between 1 and 64 characters in length.
protocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
apiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
corsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
credentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
description string
The description of the API. Must be less than or equal to 1024 characters in length.
disableExecuteApiEndpoint boolean
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
failOnWarnings boolean
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
name string
The name of the API. Must be less than or equal to 128 characters in length.
routeKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
routeSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
tags {[key: string]: string}
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
version string
A version identifier for the API. Must be between 1 and 64 characters in length.
protocol_type str
The API protocol. Valid values: HTTP, WEBSOCKET.
api_key_selection_expression str
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
body str
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
cors_configuration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
credentials_arn str
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
description str
The description of the API. Must be less than or equal to 1024 characters in length.
disable_execute_api_endpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
fail_on_warnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
name str
The name of the API. Must be less than or equal to 128 characters in length.
route_key str
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
route_selection_expression str
The route selection expression for the API. Defaults to $request.method $request.path.
tags Mapping[str, str]
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
target str
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
version str
A version identifier for the API. Must be between 1 and 64 characters in length.

Outputs

All input properties are implicitly available as output properties. Additionally, the Api resource produces the following output properties:

ApiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
Arn string
The ARN of the API.
ExecutionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
ApiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
Arn string
The ARN of the API.
ExecutionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
apiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
arn string
The ARN of the API.
executionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
api_endpoint str
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
arn str
The ARN of the API.
execution_arn str
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .

Look up an Existing Api Resource

Get an existing Api resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApiState, opts?: CustomResourceOptions): Api
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        api_endpoint: Optional[str] = None,
        api_key_selection_expression: Optional[str] = None,
        arn: Optional[str] = None,
        body: Optional[str] = None,
        cors_configuration: Optional[ApiCorsConfigurationArgs] = None,
        credentials_arn: Optional[str] = None,
        description: Optional[str] = None,
        disable_execute_api_endpoint: Optional[bool] = None,
        execution_arn: Optional[str] = None,
        fail_on_warnings: Optional[bool] = None,
        name: Optional[str] = None,
        protocol_type: Optional[str] = None,
        route_key: Optional[str] = None,
        route_selection_expression: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        target: Optional[str] = None,
        version: Optional[str] = None) -> Api
func GetApi(ctx *Context, name string, id IDInput, state *ApiState, opts ...ResourceOption) (*Api, error)
public static Api Get(string name, Input<string> id, ApiState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

ApiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
ApiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
Arn string
The ARN of the API.
Body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
CorsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
CredentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
Description string
The description of the API. Must be less than or equal to 1024 characters in length.
DisableExecuteApiEndpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
ExecutionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
FailOnWarnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
Name string
The name of the API. Must be less than or equal to 128 characters in length.
ProtocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
RouteKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
RouteSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
Tags Dictionary<string, string>
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider .
Target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
Version string
A version identifier for the API. Must be between 1 and 64 characters in length.
ApiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
ApiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
Arn string
The ARN of the API.
Body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
CorsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
CredentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
Description string
The description of the API. Must be less than or equal to 1024 characters in length.
DisableExecuteApiEndpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
ExecutionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
FailOnWarnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
Name string
The name of the API. Must be less than or equal to 128 characters in length.
ProtocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
RouteKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
RouteSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
Tags map[string]string
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider .
Target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
Version string
A version identifier for the API. Must be between 1 and 64 characters in length.
apiEndpoint string
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
apiKeySelectionExpression string
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
arn string
The ARN of the API.
body string
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
corsConfiguration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
credentialsArn string
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
description string
The description of the API. Must be less than or equal to 1024 characters in length.
disableExecuteApiEndpoint boolean
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
executionArn string
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
failOnWarnings boolean
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
name string
The name of the API. Must be less than or equal to 128 characters in length.
protocolType string
The API protocol. Valid values: HTTP, WEBSOCKET.
routeKey string
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
routeSelectionExpression string
The route selection expression for the API. Defaults to $request.method $request.path.
tags {[key: string]: string}
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider .
target string
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
version string
A version identifier for the API. Must be between 1 and 64 characters in length.
api_endpoint str
The URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
api_key_selection_expression str
An API key selection expression. Valid values: $context.authorizer.usageIdentifierKey, $request.header.x-api-key. Defaults to $request.header.x-api-key. Applicable for WebSocket APIs.
arn str
The ARN of the API.
body str
An OpenAPI specification that defines the set of routes and integrations to create as part of the HTTP APIs. Supported only for HTTP APIs.
cors_configuration ApiCorsConfigurationArgs
The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
credentials_arn str
Part of quick create. Specifies any credentials required for the integration. Applicable for HTTP APIs.
description str
The description of the API. Must be less than or equal to 1024 characters in length.
disable_execute_api_endpoint bool
Whether clients can invoke the API by using the default execute-api endpoint. By default, clients can invoke the API with the default {api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke the API, disable the default endpoint.
execution_arn str
The ARN prefix to be used in an aws.lambda.Permission’s source_arn attribute or in an aws.iam.Policy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
fail_on_warnings bool
Whether warnings should return an error while API Gateway is creating or updating the resource using an OpenAPI specification. Defaults to false. Applicable for HTTP APIs.
name str
The name of the API. Must be less than or equal to 128 characters in length.
protocol_type str
The API protocol. Valid values: HTTP, WEBSOCKET.
route_key str
Part of quick create. Specifies any route key. Applicable for HTTP APIs.
route_selection_expression str
The route selection expression for the API. Defaults to $request.method $request.path.
tags Mapping[str, str]
A map of tags to assign to the API. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider .
target str
Part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Applicable for HTTP APIs.
version str
A version identifier for the API. Must be between 1 and 64 characters in length.

Supporting Types

ApiCorsConfiguration

AllowCredentials bool
Whether credentials are included in the CORS request.
AllowHeaders List<string>
The set of allowed HTTP headers.
AllowMethods List<string>
The set of allowed HTTP methods.
AllowOrigins List<string>
The set of allowed origins.
ExposeHeaders List<string>
The set of exposed HTTP headers.
MaxAge int
The number of seconds that the browser should cache preflight request results.
AllowCredentials bool
Whether credentials are included in the CORS request.
AllowHeaders []string
The set of allowed HTTP headers.
AllowMethods []string
The set of allowed HTTP methods.
AllowOrigins []string
The set of allowed origins.
ExposeHeaders []string
The set of exposed HTTP headers.
MaxAge int
The number of seconds that the browser should cache preflight request results.
allowCredentials boolean
Whether credentials are included in the CORS request.
allowHeaders string[]
The set of allowed HTTP headers.
allowMethods string[]
The set of allowed HTTP methods.
allowOrigins string[]
The set of allowed origins.
exposeHeaders string[]
The set of exposed HTTP headers.
maxAge number
The number of seconds that the browser should cache preflight request results.
allow_credentials bool
Whether credentials are included in the CORS request.
allow_headers Sequence[str]
The set of allowed HTTP headers.
allow_methods Sequence[str]
The set of allowed HTTP methods.
allow_origins Sequence[str]
The set of allowed origins.
expose_headers Sequence[str]
The set of exposed HTTP headers.
max_age int
The number of seconds that the browser should cache preflight request results.

Import

aws_apigatewayv2_api can be imported by using the API identifier, e.g.,

 $ pulumi import aws:apigatewayv2/api:Api example aabbccddee

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.