AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getApi

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

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Aws.ApiGatewayV2.GetApi.InvokeAsync(new Aws.ApiGatewayV2.GetApiArgs
        {
            ApiId = "aabbccddee",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(Apigatewayv2Functions.getApi(GetApiArgs.builder()
            .apiId("aabbccddee")
            .build()));

        }
}
import pulumi
import pulumi_aws as aws

example = aws.apigatewayv2.get_api(api_id="aabbccddee")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = pulumi.output(aws.apigatewayv2.getApi({
    apiId: "aabbccddee",
}));
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

The API identifier.

Tags Dictionary<string, string>

A map of resource tags.

ApiId string

The API identifier.

Tags map[string]string

A map of resource tags.

apiId String

The API identifier.

tags Map

A map of resource tags.

apiId string

The API identifier.

tags {[key: string]: string}

A map of resource tags.

api_id str

The API identifier.

tags Mapping[str, str]

A map of resource tags.

apiId String

The API identifier.

tags Map

A map of resource tags.

getApi Result

The following output properties are available:

ApiEndpoint string

The 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

The ARN of the API.

CorsConfigurations List<GetApiCorsConfiguration>

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

Description string

The description of the API.

DisableExecuteApiEndpoint bool

Whether clients can invoke the API by using the default execute-api endpoint.

ExecutionArn string

The 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

The name of the API.

ProtocolType string

The API protocol.

RouteSelectionExpression string

The route selection expression for the API.

Tags Dictionary<string, string>

A map of resource tags.

Version string

A version identifier for the API.

ApiEndpoint string

The 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

The ARN of the API.

CorsConfigurations []GetApiCorsConfiguration

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

Description string

The description of the API.

DisableExecuteApiEndpoint bool

Whether clients can invoke the API by using the default execute-api endpoint.

ExecutionArn string

The 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

The name of the API.

ProtocolType string

The API protocol.

RouteSelectionExpression string

The route selection expression for the API.

Tags map[string]string

A map of resource tags.

Version string

A version identifier for the API.

apiEndpoint String

The 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

The ARN of the API.

corsConfigurations ListApiCorsConfiguration>

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

description String

The description of the API.

disableExecuteApiEndpoint Boolean

Whether clients can invoke the API by using the default execute-api endpoint.

executionArn String

The 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

The name of the API.

protocolType String

The API protocol.

routeSelectionExpression String

The route selection expression for the API.

tags Map

A map of resource tags.

version String

A version identifier for the API.

apiEndpoint string

The 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

The ARN of the API.

corsConfigurations GetApiCorsConfiguration[]

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

description string

The description of the API.

disableExecuteApiEndpoint boolean

Whether clients can invoke the API by using the default execute-api endpoint.

executionArn string

The 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

The name of the API.

protocolType string

The API protocol.

routeSelectionExpression string

The route selection expression for the API.

tags {[key: string]: string}

A map of resource tags.

version string

A version identifier for the API.

api_endpoint str

The 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

The ARN of the API.

cors_configurations Sequence[GetApiCorsConfiguration]

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

description str

The 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

The 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

The name of the API.

protocol_type str

The API protocol.

route_selection_expression str

The route selection expression for the API.

tags Mapping[str, str]

A map of resource tags.

version str

A version identifier for the API.

apiEndpoint String

The 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

The ARN of the API.

corsConfigurations List

The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.

description String

The description of the API.

disableExecuteApiEndpoint Boolean

Whether clients can invoke the API by using the default execute-api endpoint.

executionArn String

The 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

The name of the API.

protocolType String

The API protocol.

routeSelectionExpression String

The route selection expression for the API.

tags Map

A map of resource tags.

version String

A version identifier for the API.

Supporting Types

GetApiCorsConfiguration

AllowCredentials bool

Whether credentials are included in the CORS request.

AllowHeaders List<string>

The set of allowed HTTP headers.

AllowMethods List<string>

The set of allowed HTTP methods.

AllowOrigins List<string>

The set of allowed origins.

ExposeHeaders List<string>

The set of exposed HTTP headers.

MaxAge int

The number of seconds that the browser should cache preflight request results.

AllowCredentials bool

Whether credentials are included in the CORS request.

AllowHeaders []string

The set of allowed HTTP headers.

AllowMethods []string

The set of allowed HTTP methods.

AllowOrigins []string

The set of allowed origins.

ExposeHeaders []string

The set of exposed HTTP headers.

MaxAge int

The number of seconds that the browser should cache preflight request results.

allowCredentials Boolean

Whether credentials are included in the CORS request.

allowHeaders List

The set of allowed HTTP headers.

allowMethods List

The set of allowed HTTP methods.

allowOrigins List

The set of allowed origins.

exposeHeaders List

The set of exposed HTTP headers.

maxAge Integer

The number of seconds that the browser should cache preflight request results.

allowCredentials boolean

Whether credentials are included in the CORS request.

allowHeaders string[]

The set of allowed HTTP headers.

allowMethods string[]

The set of allowed HTTP methods.

allowOrigins string[]

The set of allowed origins.

exposeHeaders string[]

The set of exposed HTTP headers.

maxAge number

The 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]

The set of allowed HTTP headers.

allow_methods Sequence[str]

The set of allowed HTTP methods.

allow_origins Sequence[str]

The set of allowed origins.

expose_headers Sequence[str]

The set of exposed HTTP headers.

max_age int

The number of seconds that the browser should cache preflight request results.

allowCredentials Boolean

Whether credentials are included in the CORS request.

allowHeaders List

The set of allowed HTTP headers.

allowMethods List

The set of allowed HTTP methods.

allowOrigins List

The set of allowed origins.

exposeHeaders List

The set of exposed HTTP headers.

maxAge Number

The number of seconds that the browser should cache preflight request results.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.