Skip to content

Data Source: awsApigatewayv2Api

Provides details about a specific Amazon API Gateway Version 2 API.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.dataAwsApigatewayv2Api.DataAwsApigatewayv2Api(this, "example", {
  apiId: "aabbccddee",
});

Argument Reference

The arguments of this data source act as filters for querying the available APIs in the current region. The given filters must match exactly one API whose data will be exported as attributes.

The following arguments are supported:

  • apiId - (Required) API identifier.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • apiEndpoint - URI of the API, of the form https://{apiId}ExecuteApi.{region}AmazonawsCom for HTTP APIs and wss://{apiId}ExecuteApi.{region}AmazonawsCom for WebSocket APIs.
  • apiKeySelectionExpression - An API key selection expression. Applicable for WebSocket APIs.
  • arn - ARN of the API.
  • corsConfiguration - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
  • description - Description of the API.
  • disableExecuteApiEndpoint - Whether clients can invoke the API by using the default executeApi endpoint.
  • executionArn - ARN prefix to be used in an awsLambdaPermission's sourceArn attribute or in an awsIamPolicy to authorize access to the @connections API. See the Amazon API Gateway Developer Guide for details.
  • name - Name of the API.
  • protocolType - API protocol.
  • routeSelectionExpression - The route selection expression for the API.
  • tags - Map of resource tags.
  • version - Version identifier for the API.

The corsConfiguration object supports the following:

  • allowCredentials - Whether credentials are included in the CORS request.
  • allowHeaders - Set of allowed HTTP headers.
  • allowMethods - Set of allowed HTTP methods.
  • allowOrigins - Set of allowed origins.
  • exposeHeaders - Set of exposed HTTP headers.
  • maxAge - Number of seconds that the browser should cache preflight request results.