1. Packages
  2. AWS Classic
  3. API Docs
  4. apigatewayv2
  5. getApi

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.apigatewayv2.getApi

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:apigatewayv2/getApi:getApi
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ApiId string
    API identifier.
    Tags Dictionary<string, string>
    Map of resource tags.
    ApiId string
    API identifier.
    Tags map[string]string
    Map of resource tags.
    apiId String
    API identifier.
    tags Map<String,String>
    Map of resource tags.
    apiId string
    API identifier.
    tags {[key: string]: string}
    Map of resource tags.
    api_id str
    API identifier.
    tags Mapping[str, str]
    Map of resource tags.
    apiId String
    API identifier.
    tags 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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    ApiId string
    ApiKeySelectionExpression string
    An API key selection expression. Applicable for WebSocket APIs.
    Arn string
    ARN of the API.
    CorsConfigurations List<GetApiCorsConfiguration>
    Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
    Description string
    Description of the API.
    DisableExecuteApiEndpoint bool
    Whether clients can invoke the API by using the default execute-api endpoint.
    ExecutionArn string
    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.
    Name string
    Name of the API.
    ProtocolType string
    API protocol.
    RouteSelectionExpression string
    The route selection expression for the API.
    Tags 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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    ApiId string
    ApiKeySelectionExpression string
    An API key selection expression. Applicable for WebSocket APIs.
    Arn string
    ARN of the API.
    CorsConfigurations []GetApiCorsConfiguration
    Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
    Description string
    Description of the API.
    DisableExecuteApiEndpoint bool
    Whether clients can invoke the API by using the default execute-api endpoint.
    ExecutionArn string
    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.
    Name string
    Name of the API.
    ProtocolType string
    API protocol.
    RouteSelectionExpression string
    The route selection expression for the API.
    Tags 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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    apiId String
    apiKeySelectionExpression String
    An API key selection expression. Applicable for WebSocket APIs.
    arn String
    ARN of the API.
    corsConfigurations List<GetApiCorsConfiguration>
    Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
    description String
    Description of the API.
    disableExecuteApiEndpoint Boolean
    Whether clients can invoke the API by using the default execute-api endpoint.
    executionArn String
    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.
    name String
    Name of the API.
    protocolType String
    API protocol.
    routeSelectionExpression String
    The route selection expression for the API.
    tags 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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    apiId string
    apiKeySelectionExpression string
    An API key selection expression. Applicable for WebSocket APIs.
    arn string
    ARN of the API.
    corsConfigurations GetApiCorsConfiguration[]
    Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
    description string
    Description of the API.
    disableExecuteApiEndpoint boolean
    Whether clients can invoke the API by using the default execute-api endpoint.
    executionArn string
    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.
    name string
    Name of the API.
    protocolType string
    API protocol.
    routeSelectionExpression string
    The route selection expression for the API.
    tags {[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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    api_id str
    api_key_selection_expression str
    An API key selection expression. Applicable for WebSocket APIs.
    arn str
    ARN of the API.
    cors_configurations Sequence[GetApiCorsConfiguration]
    Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
    description str
    Description of the API.
    disable_execute_api_endpoint bool
    Whether clients can invoke the API by using the default execute-api endpoint.
    execution_arn str
    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.
    name str
    Name of the API.
    protocol_type str
    API protocol.
    route_selection_expression str
    The route selection expression for the API.
    tags 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.com for HTTP APIs and wss://{api-id}.execute-api.{region}.amazonaws.com for WebSocket APIs.
    apiId String
    apiKeySelectionExpression String
    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.
    disableExecuteApiEndpoint Boolean
    Whether clients can invoke the API by using the default execute-api endpoint.
    executionArn String
    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.
    name String
    Name of the API.
    protocolType String
    API protocol.
    routeSelectionExpression String
    The route selection expression for the API.
    tags 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 aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi