AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.apigatewayv2.getApi
Explore with Pulumi AI
Provides details about a specific Amazon API Gateway Version 2 API.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.apigatewayv2.getApi({
    apiId: "aabbccddee",
});
import pulumi
import pulumi_aws as aws
example = aws.apigatewayv2.get_api(api_id="aabbccddee")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/apigatewayv2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apigatewayv2.LookupApi(ctx, &apigatewayv2.LookupApiArgs{
			ApiId: "aabbccddee",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = Aws.ApiGatewayV2.GetApi.Invoke(new()
    {
        ApiId = "aabbccddee",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.apigatewayv2.Apigatewayv2Functions;
import com.pulumi.aws.apigatewayv2.inputs.GetApiArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var example = Apigatewayv2Functions.getApi(GetApiArgs.builder()
            .apiId("aabbccddee")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:apigatewayv2:getApi
      arguments:
        apiId: aabbccddee
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,
            tags: Optional[Mapping[str, str]] = None,
            opts: Optional[InvokeOptions] = None) -> GetApiResult
def get_api_output(api_id: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Mapping[str, 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:apigatewayv2/getApi:getApi
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ApiId string
- API identifier.
- Dictionary<string, string>
- Map of resource tags.
- ApiId string
- API identifier.
- map[string]string
- Map of resource tags.
- apiId String
- API identifier.
- Map<String,String>
- Map of resource tags.
- apiId string
- API identifier.
- {[key: string]: string}
- Map of resource tags.
- api_id str
- API identifier.
- Mapping[str, str]
- Map of resource tags.
- apiId String
- API identifier.
- Map<String>
- Map of resource tags.
getApi Result
The following output properties are available:
- ApiEndpoint string
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- ApiId string
- ApiKey stringSelection Expression 
- An API key selection expression. Applicable for WebSocket APIs.
- Arn string
- ARN of the API.
- CorsConfigurations List<GetApi Cors Configuration> 
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
- Description of the API.
- DisableExecute boolApi Endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- ExecutionArn string
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the API.
- ProtocolType string
- API protocol.
- RouteSelection stringExpression 
- The route selection expression for the API.
- Dictionary<string, string>
- Map of resource tags.
- Version string
- Version identifier for the API.
- ApiEndpoint string
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- ApiId string
- ApiKey stringSelection Expression 
- An API key selection expression. Applicable for WebSocket APIs.
- Arn string
- ARN of the API.
- CorsConfigurations []GetApi Cors Configuration 
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
- Description of the API.
- DisableExecute boolApi Endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- ExecutionArn string
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the API.
- ProtocolType string
- API protocol.
- RouteSelection stringExpression 
- The route selection expression for the API.
- map[string]string
- Map of resource tags.
- Version string
- Version identifier for the API.
- apiEndpoint String
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- apiId String
- apiKey StringSelection Expression 
- An API key selection expression. Applicable for WebSocket APIs.
- arn String
- ARN of the API.
- corsConfigurations List<GetApi Cors Configuration> 
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
- Description of the API.
- disableExecute BooleanApi Endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- executionArn String
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the API.
- protocolType String
- API protocol.
- routeSelection StringExpression 
- The route selection expression for the API.
- Map<String,String>
- Map of resource tags.
- version String
- Version identifier for the API.
- apiEndpoint string
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- apiId string
- apiKey stringSelection Expression 
- An API key selection expression. Applicable for WebSocket APIs.
- arn string
- ARN of the API.
- corsConfigurations GetApi Cors Configuration[] 
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description string
- Description of the API.
- disableExecute booleanApi Endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- executionArn string
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Name of the API.
- protocolType string
- API protocol.
- routeSelection stringExpression 
- The route selection expression for the API.
- {[key: string]: string}
- Map of resource tags.
- version string
- Version identifier for the API.
- api_endpoint str
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- api_id str
- api_key_ strselection_ expression 
- An API key selection expression. Applicable for WebSocket APIs.
- arn str
- ARN of the API.
- cors_configurations Sequence[GetApi Cors Configuration] 
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description str
- Description of the API.
- disable_execute_ boolapi_ endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- execution_arn str
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Name of the API.
- protocol_type str
- API protocol.
- route_selection_ strexpression 
- The route selection expression for the API.
- Mapping[str, str]
- Map of resource tags.
- version str
- Version identifier for the API.
- apiEndpoint String
- URI of the API, of the form https://{api-id}.execute-api.{region}.amazonaws.comfor HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.comfor WebSocket APIs.
- apiId String
- apiKey StringSelection Expression 
- An API key selection expression. Applicable for WebSocket APIs.
- arn String
- ARN of the API.
- corsConfigurations List<Property Map>
- Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
- Description of the API.
- disableExecute BooleanApi Endpoint 
- Whether clients can invoke the API by using the default execute-apiendpoint.
- executionArn String
- ARN prefix to be used in an aws.lambda.Permission'ssource_arnattribute or in anaws.iam.Policyto authorize access to the@connectionsAPI. See the Amazon API Gateway Developer Guide for details.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the API.
- protocolType String
- API protocol.
- routeSelection StringExpression 
- The route selection expression for the API.
- Map<String>
- Map of resource tags.
- version String
- Version identifier for the API.
Supporting Types
GetApiCorsConfiguration   
- AllowCredentials bool
- Whether credentials are included in the CORS request.
- AllowHeaders List<string>
- Set of allowed HTTP headers.
- AllowMethods List<string>
- Set of allowed HTTP methods.
- AllowOrigins List<string>
- Set of allowed origins.
- ExposeHeaders List<string>
- Set of exposed HTTP headers.
- MaxAge int
- Number of seconds that the browser should cache preflight request results.
- AllowCredentials bool
- Whether credentials are included in the CORS request.
- AllowHeaders []string
- Set of allowed HTTP headers.
- AllowMethods []string
- Set of allowed HTTP methods.
- AllowOrigins []string
- Set of allowed origins.
- ExposeHeaders []string
- Set of exposed HTTP headers.
- MaxAge int
- Number of seconds that the browser should cache preflight request results.
- allowCredentials Boolean
- Whether credentials are included in the CORS request.
- allowHeaders List<String>
- Set of allowed HTTP headers.
- allowMethods List<String>
- Set of allowed HTTP methods.
- allowOrigins List<String>
- Set of allowed origins.
- exposeHeaders List<String>
- Set of exposed HTTP headers.
- maxAge Integer
- Number of seconds that the browser should cache preflight request results.
- allowCredentials boolean
- Whether credentials are included in the CORS request.
- allowHeaders string[]
- Set of allowed HTTP headers.
- allowMethods string[]
- Set of allowed HTTP methods.
- allowOrigins string[]
- Set of allowed origins.
- exposeHeaders string[]
- Set of exposed HTTP headers.
- maxAge number
- 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]
- Set of allowed HTTP headers.
- allow_methods Sequence[str]
- Set of allowed HTTP methods.
- allow_origins Sequence[str]
- Set of allowed origins.
- expose_headers Sequence[str]
- Set of exposed HTTP headers.
- max_age int
- Number of seconds that the browser should cache preflight request results.
- allowCredentials Boolean
- Whether credentials are included in the CORS request.
- allowHeaders List<String>
- Set of allowed HTTP headers.
- allowMethods List<String>
- Set of allowed HTTP methods.
- allowOrigins List<String>
- Set of allowed origins.
- exposeHeaders List<String>
- Set of exposed HTTP headers.
- maxAge Number
- Number of seconds that the browser should cache preflight request results.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.