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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws-native:apigatewayv2:getApi
arguments:
# arguments dictionary
The following arguments are supported:
- Api
Id string - The API identifier.
- Api
Id string - The API identifier.
- api
Id String - The API identifier.
- api
Id string - The API identifier.
- api_
id str - The API identifier.
- api
Id String - The API identifier.
getApi Result
The following output properties are available:
- Api
Endpoint string - The default endpoint for an API. For example:
https://abcdef.execute-api.us-west-2.amazonaws.com
. - Api
Id string - The API identifier.
- Api
Key stringSelection Expression - An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- Cors
Configuration 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.
- Disable
Execute boolApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. 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
Body
orS3BodyLocation
. - Route
Selection stringExpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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.
- Api
Endpoint string - The default endpoint for an API. For example:
https://abcdef.execute-api.us-west-2.amazonaws.com
. - Api
Id string - The API identifier.
- Api
Key stringSelection 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 string
- The description of the API.
- Disable
Execute boolApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. 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
Body
orS3BodyLocation
. - Route
Selection stringExpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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.
- api
Endpoint String - The default endpoint for an API. For example:
https://abcdef.execute-api.us-west-2.amazonaws.com
. - api
Id String - The API identifier.
- api
Key StringSelection 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 String
- The description of the API.
- disable
Execute BooleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. 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
Body
orS3BodyLocation
. - route
Selection StringExpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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.
- api
Endpoint string - The default endpoint for an API. For example:
https://abcdef.execute-api.us-west-2.amazonaws.com
. - api
Id string - The API identifier.
- api
Key stringSelection 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 string
- The description of the API.
- disable
Execute booleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. 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
Body
orS3BodyLocation
. - route
Selection stringExpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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-api
endpoint. 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
Body
orS3BodyLocation
. - route_
selection_ strexpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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.
- api
Endpoint String - The default endpoint for an API. For example:
https://abcdef.execute-api.us-west-2.amazonaws.com
. - api
Id String - The API identifier.
- api
Key StringSelection Expression - An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
- cors
Configuration Property Map - A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
- description String
- The description of the API.
- disable
Execute BooleanApi Endpoint - Specifies whether clients can invoke your API by using the default
execute-api
endpoint. 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
Body
orS3BodyLocation
. - route
Selection StringExpression - The route selection expression for the API. For HTTP APIs, the
routeSelectionExpression
must 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
- Allow
Credentials bool - Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- Allow
Headers List<string> - Represents a collection of allowed headers. Supported only for HTTP APIs.
- Allow
Methods List<string> - Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- Allow
Origins List<string> - Represents a collection of allowed origins. Supported only for HTTP APIs.
- Expose
Headers List<string> - 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.
- Allow
Credentials bool - Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- Allow
Headers []string - Represents a collection of allowed headers. Supported only for HTTP APIs.
- Allow
Methods []string - Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- Allow
Origins []string - Represents a collection of allowed origins. Supported only for HTTP APIs.
- Expose
Headers []string - 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.
- allow
Credentials Boolean - Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allow
Headers List<String> - Represents a collection of allowed headers. Supported only for HTTP APIs.
- allow
Methods List<String> - Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allow
Origins List<String> - Represents a collection of allowed origins. Supported only for HTTP APIs.
- expose
Headers List<String> - Represents a collection of exposed headers. Supported only for HTTP APIs.
- max
Age Integer - The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.
- allow
Credentials boolean - Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allow
Headers string[] - Represents a collection of allowed headers. Supported only for HTTP APIs.
- allow
Methods string[] - Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allow
Origins string[] - Represents a collection of allowed origins. Supported only for HTTP APIs.
- expose
Headers string[] - Represents a collection of exposed headers. Supported only for HTTP APIs.
- max
Age 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.
- allow
Credentials Boolean - Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.
- allow
Headers List<String> - Represents a collection of allowed headers. Supported only for HTTP APIs.
- allow
Methods List<String> - Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.
- allow
Origins List<String> - Represents a collection of allowed origins. Supported only for HTTP APIs.
- expose
Headers List<String> - Represents a collection of exposed headers. Supported only for HTTP APIs.
- max
Age 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.