AWS v6.60.0 published on Tuesday, Nov 19, 2024 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:apigatewayv2/getApi:getApi
arguments:
# arguments dictionary
The following arguments are supported:
- Api
Id string - API identifier.
- Dictionary<string, string>
- Map of resource tags.
- Api
Id string - API identifier.
- map[string]string
- Map of resource tags.
- api
Id String - API identifier.
- Map<String,String>
- Map of resource tags.
- api
Id string - API identifier.
- {[key: string]: string}
- Map of resource tags.
- api_
id str - API identifier.
- Mapping[str, str]
- Map of resource tags.
- api
Id String - API identifier.
- Map<String>
- Map of resource tags.
getApi Result
The following output properties are available:
- Api
Endpoint string - URI of the API, of the form
https://{api-id}.execute-api.{region}.amazonaws.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for WebSocket APIs. - Api
Id string - Api
Key stringSelection Expression - An API key selection expression. Applicable for WebSocket APIs.
- Arn string
- ARN of the API.
- Cors
Configurations List<GetApi Cors Configuration> - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
- Description of the API.
- Disable
Execute boolApi Endpoint - Whether clients can invoke the API by using the default
execute-api
endpoint. - Execution
Arn string - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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.
- Protocol
Type string - API protocol.
- Route
Selection stringExpression - The route selection expression for the API.
- Dictionary<string, string>
- Map of resource tags.
- Version string
- Version identifier for the API.
- Api
Endpoint string - URI of the API, of the form
https://{api-id}.execute-api.{region}.amazonaws.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for WebSocket APIs. - Api
Id string - Api
Key stringSelection Expression - An API key selection expression. Applicable for WebSocket APIs.
- Arn string
- ARN of the API.
- Cors
Configurations []GetApi Cors Configuration - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
- Description of the API.
- Disable
Execute boolApi Endpoint - Whether clients can invoke the API by using the default
execute-api
endpoint. - Execution
Arn string - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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.
- Protocol
Type string - API protocol.
- Route
Selection stringExpression - The route selection expression for the API.
- map[string]string
- Map of resource tags.
- Version string
- Version identifier for the API.
- api
Endpoint String - URI of the API, of the form
https://{api-id}.execute-api.{region}.amazonaws.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for WebSocket APIs. - api
Id String - api
Key StringSelection Expression - An API key selection expression. Applicable for WebSocket APIs.
- arn String
- ARN of the API.
- cors
Configurations List<GetApi Cors Configuration> - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
- Description of the API.
- disable
Execute BooleanApi Endpoint - Whether clients can invoke the API by using the default
execute-api
endpoint. - execution
Arn String - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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.
- protocol
Type String - API protocol.
- route
Selection StringExpression - The route selection expression for the API.
- Map<String,String>
- Map of resource tags.
- version String
- Version identifier for the API.
- api
Endpoint string - URI of the API, of the form
https://{api-id}.execute-api.{region}.amazonaws.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for WebSocket APIs. - api
Id string - api
Key stringSelection Expression - An API key selection expression. Applicable for WebSocket APIs.
- arn string
- ARN of the API.
- cors
Configurations GetApi Cors Configuration[] - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description string
- Description of the API.
- disable
Execute booleanApi Endpoint - Whether clients can invoke the API by using the default
execute-api
endpoint. - execution
Arn string - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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.
- protocol
Type string - API protocol.
- route
Selection 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.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for 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-api
endpoint. - execution_
arn str - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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_ strexpression - The route selection expression for the API.
- Mapping[str, str]
- Map of resource tags.
- version str
- Version identifier for the API.
- api
Endpoint String - URI of the API, of the form
https://{api-id}.execute-api.{region}.amazonaws.com
for HTTP APIs andwss://{api-id}.execute-api.{region}.amazonaws.com
for WebSocket APIs. - api
Id String - api
Key StringSelection Expression - An API key selection expression. Applicable for WebSocket APIs.
- arn String
- ARN of the API.
- cors
Configurations List<Property Map> - Cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
- Description of the API.
- disable
Execute BooleanApi Endpoint - Whether clients can invoke the API by using the default
execute-api
endpoint. - execution
Arn String - ARN prefix to be used in an
aws.lambda.Permission
'ssource_arn
attribute or in anaws.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.
- protocol
Type String - API protocol.
- route
Selection StringExpression - The route selection expression for the API.
- Map<String>
- Map of resource tags.
- version String
- Version identifier for the API.
Supporting Types
GetApiCorsConfiguration
- Allow
Credentials bool - Whether credentials are included in the CORS request.
- Allow
Headers List<string> - Set of allowed HTTP headers.
- Allow
Methods List<string> - Set of allowed HTTP methods.
- Allow
Origins List<string> - Set of allowed origins.
- Expose
Headers List<string> - Set of exposed HTTP headers.
- Max
Age int - Number of seconds that the browser should cache preflight request results.
- Allow
Credentials bool - Whether credentials are included in the CORS request.
- Allow
Headers []string - Set of allowed HTTP headers.
- Allow
Methods []string - Set of allowed HTTP methods.
- Allow
Origins []string - Set of allowed origins.
- Expose
Headers []string - Set of exposed HTTP headers.
- Max
Age int - Number of seconds that the browser should cache preflight request results.
- allow
Credentials Boolean - Whether credentials are included in the CORS request.
- allow
Headers List<String> - Set of allowed HTTP headers.
- allow
Methods List<String> - Set of allowed HTTP methods.
- allow
Origins List<String> - Set of allowed origins.
- expose
Headers List<String> - Set of exposed HTTP headers.
- max
Age Integer - Number of seconds that the browser should cache preflight request results.
- allow
Credentials boolean - Whether credentials are included in the CORS request.
- allow
Headers string[] - Set of allowed HTTP headers.
- allow
Methods string[] - Set of allowed HTTP methods.
- allow
Origins string[] - Set of allowed origins.
- expose
Headers string[] - Set of exposed HTTP headers.
- max
Age 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.
- allow
Credentials Boolean - Whether credentials are included in the CORS request.
- allow
Headers List<String> - Set of allowed HTTP headers.
- allow
Methods List<String> - Set of allowed HTTP methods.
- allow
Origins List<String> - Set of allowed origins.
- expose
Headers List<String> - Set of exposed HTTP headers.
- max
Age 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.