We recommend new projects start with resources from the AWS provider.
aws-native.apigatewayv2.getApi
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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 in the API Gateway Developer Guide. For more information about HTTP APIs, see HTTP APIs in the API Gateway Developer Guide.
Using getApi
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getApi(args: GetApiArgs, opts?: InvokeOptions): Promise<GetApiResult>
function getApiOutput(args: GetApiOutputArgs, opts?: InvokeOptions): Output<GetApiResult>def get_api(api_id: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> GetApiResult
def get_api_output(api_id: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[GetApiResult]func LookupApi(ctx *Context, args *LookupApiArgs, opts ...InvokeOption) (*LookupApiResult, error)
func LookupApiOutput(ctx *Context, args *LookupApiOutputArgs, opts ...InvokeOption) LookupApiResultOutput> Note: This function is named LookupApi in the Go SDK.
public static class GetApi 
{
    public static Task<GetApiResult> InvokeAsync(GetApiArgs args, InvokeOptions? opts = null)
    public static Output<GetApiResult> Invoke(GetApiInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetApiResult> getApi(GetApiArgs args, InvokeOptions options)
public static Output<GetApiResult> getApi(GetApiArgs args, InvokeOptions options)
fn::invoke:
  function: aws-native:apigatewayv2:getApi
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ApiId string
- The API identifier.
- ApiId string
- The API identifier.
- apiId String
- The API identifier.
- apiId string
- The API identifier.
- api_id str
- The API identifier.
- apiId String
- The API identifier.
getApi Result
The following output properties are available:
- ApiEndpoint string
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- ApiId string
- The API identifier.
- ApiKey stringSelection Expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- CorsConfiguration Pulumi.Aws Native. Api Gateway V2. Outputs. Api Cors 
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- Description string
- The description of the API.
- DisableExecute boolApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- Name string
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- RouteSelection stringExpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- Dictionary<string, string>
- The collection of tags. Each tag element is associated with a given resource.
- Version string
- A version identifier for the API.
- ApiEndpoint string
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- ApiId string
- The API identifier.
- ApiKey stringSelection Expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- CorsConfiguration ApiCors 
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- Description string
- The description of the API.
- DisableExecute boolApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- Name string
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- RouteSelection stringExpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- map[string]string
- The collection of tags. Each tag element is associated with a given resource.
- Version string
- A version identifier for the API.
- apiEndpoint String
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- apiId String
- The API identifier.
- apiKey StringSelection Expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- corsConfiguration ApiCors 
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- description String
- The description of the API.
- disableExecute BooleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- name String
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- routeSelection StringExpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- Map<String,String>
- The collection of tags. Each tag element is associated with a given resource.
- version String
- A version identifier for the API.
- apiEndpoint string
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- apiId string
- The API identifier.
- apiKey stringSelection Expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- corsConfiguration ApiCors 
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- description string
- The description of the API.
- disableExecute booleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- name string
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- routeSelection stringExpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- {[key: string]: string}
- The collection of tags. Each tag element is associated with a given resource.
- version string
- A version identifier for the API.
- api_endpoint str
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- api_id str
- The API identifier.
- api_key_ strselection_ expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- cors_configuration ApiCors 
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- description str
- The description of the API.
- disable_execute_ boolapi_ endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- name str
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- route_selection_ strexpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- Mapping[str, str]
- The collection of tags. Each tag element is associated with a given resource.
- version str
- A version identifier for the API.
- apiEndpoint String
- The default endpoint for an API. For example: https://abcdef.execute-api.us-west-2.amazonaws.com.
- apiId String
- The API identifier.
- apiKey StringSelection Expression 
- An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- corsConfiguration Property Map
- A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- description String
- The description of the API.
- disableExecute BooleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
- name String
- The name of the API. Required unless you specify an OpenAPI definition for BodyorS3BodyLocation.
- routeSelection StringExpression 
- The route selection expression for the API. For HTTP APIs, the routeSelectionExpressionmust be${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
- Map<String>
- The collection of tags. Each tag element is associated with a given resource.
- version String
- A version identifier for the API.
Supporting Types
ApiCors 
- AllowCredentials bool
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- AllowHeaders List<string>
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- AllowMethods List<string>
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- AllowOrigins List<string>
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- ExposeHeaders List<string>
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- MaxAge int
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- AllowCredentials bool
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- AllowHeaders []string
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- AllowMethods []string
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- AllowOrigins []string
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- ExposeHeaders []string
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- MaxAge int
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- allowCredentials Boolean
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allowHeaders List<String>
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- allowMethods List<String>
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allowOrigins List<String>
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- exposeHeaders List<String>
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- maxAge Integer
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- allowCredentials boolean
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allowHeaders string[]
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- allowMethods string[]
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allowOrigins string[]
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- exposeHeaders string[]
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- maxAge number
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- allow_credentials bool
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allow_headers Sequence[str]
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- allow_methods Sequence[str]
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allow_origins Sequence[str]
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- expose_headers Sequence[str]
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- max_age int
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- allowCredentials Boolean
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allowHeaders List<String>
- Represents a collection of allowed headers. Supported only for HTTP APIs.
- allowMethods List<String>
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allowOrigins List<String>
- Represents a collection of allowed origins. Supported only for HTTP APIs.
- exposeHeaders List<String>
- Represents a collection of exposed headers. Supported only for HTTP APIs.
- maxAge Number
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.