AWS Classic
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:
- Api
Id string The API identifier.
- Dictionary<string, string>
A map of resource tags.
- Api
Id string The API identifier.
- map[string]string
A map of resource tags.
- api
Id String The API identifier.
- Map
A map of resource tags.
- api
Id string The API identifier.
- {[key: string]: string}
A map of resource tags.
- api_
id str The API identifier.
- Mapping[str, str]
A map of resource tags.
- api
Id String The API identifier.
- Map
A map of resource tags.
getApi Result
The following output properties are available:
- Api
Endpoint string The 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
The ARN of the API.
- Cors
Configurations List<GetApi Cors Configuration> The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
The description of the API.
- Disable
Execute boolApi Endpoint Whether clients can invoke the API by using the default
execute-api
endpoint.- Execution
Arn string The 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
The name of the API.
- Protocol
Type string The API protocol.
- Route
Selection stringExpression The route selection expression for the API.
- Dictionary<string, string>
A map of resource tags.
- Version string
A version identifier for the API.
- Api
Endpoint string The 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
The ARN of the API.
- Cors
Configurations []GetApi Cors Configuration The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- Description string
The description of the API.
- Disable
Execute boolApi Endpoint Whether clients can invoke the API by using the default
execute-api
endpoint.- Execution
Arn string The 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
The name of the API.
- Protocol
Type string The API protocol.
- Route
Selection stringExpression The route selection expression for the API.
- map[string]string
A map of resource tags.
- Version string
A version identifier for the API.
- api
Endpoint String The 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
The ARN of the API.
- cors
Configurations ListApi Cors Configuration> The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
The description of the API.
- disable
Execute BooleanApi Endpoint Whether clients can invoke the API by using the default
execute-api
endpoint.- execution
Arn String The 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
The name of the API.
- protocol
Type String The API protocol.
- route
Selection StringExpression The route selection expression for the API.
- Map
A map of resource tags.
- version String
A version identifier for the API.
- api
Endpoint string The 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
The ARN of the API.
- cors
Configurations GetApi Cors Configuration[] The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description string
The description of the API.
- disable
Execute booleanApi Endpoint Whether clients can invoke the API by using the default
execute-api
endpoint.- execution
Arn string The 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
The name of the API.
- protocol
Type string The API protocol.
- route
Selection stringExpression The route selection expression for the API.
- {[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 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
The ARN of the API.
- cors_
configurations Sequence[GetApi Cors Configuration] The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description str
The description of the API.
- disable_
execute_ boolapi_ endpoint 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
'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
The name of the API.
- protocol_
type str The API protocol.
- route_
selection_ strexpression The route selection expression for the API.
- Mapping[str, str]
A map of resource tags.
- version str
A version identifier for the API.
- api
Endpoint String The 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
The ARN of the API.
- cors
Configurations List The cross-origin resource sharing (CORS) configuration. Applicable for HTTP APIs.
- description String
The description of the API.
- disable
Execute BooleanApi Endpoint Whether clients can invoke the API by using the default
execute-api
endpoint.- execution
Arn String The 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
The name of the API.
- protocol
Type String The API protocol.
- route
Selection StringExpression The route selection expression for the API.
- Map
A map of resource tags.
- version String
A version identifier for the API.
Supporting Types
GetApiCorsConfiguration
- Allow
Credentials bool Whether credentials are included in the CORS request.
- Allow
Headers List<string> The set of allowed HTTP headers.
- Allow
Methods List<string> The set of allowed HTTP methods.
- Allow
Origins List<string> The set of allowed origins.
- Expose
Headers List<string> The set of exposed HTTP headers.
- Max
Age int 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 []string The set of allowed HTTP headers.
- Allow
Methods []string The set of allowed HTTP methods.
- Allow
Origins []string The set of allowed origins.
- Expose
Headers []string The set of exposed HTTP headers.
- Max
Age int The 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 The set of allowed HTTP headers.
- allow
Methods List The set of allowed HTTP methods.
- allow
Origins List The set of allowed origins.
- expose
Headers List The set of exposed HTTP headers.
- max
Age Integer The 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[] The set of allowed HTTP headers.
- allow
Methods string[] The set of allowed HTTP methods.
- allow
Origins string[] The set of allowed origins.
- expose
Headers string[] The set of exposed HTTP headers.
- max
Age 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.
- allow
Credentials Boolean Whether credentials are included in the CORS request.
- allow
Headers List The set of allowed HTTP headers.
- allow
Methods List The set of allowed HTTP methods.
- allow
Origins List The set of allowed origins.
- expose
Headers List The set of exposed HTTP headers.
- max
Age 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.