We recommend new projects start with resources from the AWS provider.
aws-native.apigateway.getRestApi
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
The AWS::ApiGateway::RestApi resource creates a REST API. For more information, see restapi:create in the Amazon API Gateway REST API Reference.
On January 1, 2016, the Swagger Specification was donated to the OpenAPI initiative, becoming the foundation of the OpenAPI Specification.
Using getRestApi
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 getRestApi(args: GetRestApiArgs, opts?: InvokeOptions): Promise<GetRestApiResult>
function getRestApiOutput(args: GetRestApiOutputArgs, opts?: InvokeOptions): Output<GetRestApiResult>def get_rest_api(rest_api_id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRestApiResult
def get_rest_api_output(rest_api_id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetRestApiResult]func LookupRestApi(ctx *Context, args *LookupRestApiArgs, opts ...InvokeOption) (*LookupRestApiResult, error)
func LookupRestApiOutput(ctx *Context, args *LookupRestApiOutputArgs, opts ...InvokeOption) LookupRestApiResultOutput> Note: This function is named LookupRestApi in the Go SDK.
public static class GetRestApi 
{
    public static Task<GetRestApiResult> InvokeAsync(GetRestApiArgs args, InvokeOptions? opts = null)
    public static Output<GetRestApiResult> Invoke(GetRestApiInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRestApiResult> getRestApi(GetRestApiArgs args, InvokeOptions options)
public static Output<GetRestApiResult> getRestApi(GetRestApiArgs args, InvokeOptions options)
fn::invoke:
  function: aws-native:apigateway:getRestApi
  arguments:
    # arguments dictionaryThe following arguments are supported:
- RestApi stringId 
- The string identifier of the associated RestApi.
- RestApi stringId 
- The string identifier of the associated RestApi.
- restApi StringId 
- The string identifier of the associated RestApi.
- restApi stringId 
- The string identifier of the associated RestApi.
- rest_api_ strid 
- The string identifier of the associated RestApi.
- restApi StringId 
- The string identifier of the associated RestApi.
getRestApi Result
The following output properties are available:
- ApiKey stringSource Type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- BinaryMedia List<string>Types 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- Description string
- The description of the RestApi.
- DisableExecute boolApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- EndpointConfiguration Pulumi.Aws Native. Api Gateway. Outputs. Rest Api Endpoint Configuration 
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- MinimumCompression intSize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- Name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- Policy object
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- RestApi stringId 
- The string identifier of the associated RestApi.
- RootResource stringId 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- 
List<Pulumi.Aws Native. Outputs. Tag> 
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
- ApiKey stringSource Type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- BinaryMedia []stringTypes 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- Description string
- The description of the RestApi.
- DisableExecute boolApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- EndpointConfiguration RestApi Endpoint Configuration 
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- MinimumCompression intSize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- Name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- Policy interface{}
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- RestApi stringId 
- The string identifier of the associated RestApi.
- RootResource stringId 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- Tag
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
- apiKey StringSource Type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- binaryMedia List<String>Types 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- description String
- The description of the RestApi.
- disableExecute BooleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- endpointConfiguration RestApi Endpoint Configuration 
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- minimumCompression IntegerSize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- name String
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- policy Object
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- restApi StringId 
- The string identifier of the associated RestApi.
- rootResource StringId 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- List<Tag>
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
- apiKey stringSource Type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- binaryMedia string[]Types 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- description string
- The description of the RestApi.
- disableExecute booleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- endpointConfiguration RestApi Endpoint Configuration 
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- minimumCompression numberSize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- name string
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- policy any
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- restApi stringId 
- The string identifier of the associated RestApi.
- rootResource stringId 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- Tag[]
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
- api_key_ strsource_ type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- binary_media_ Sequence[str]types 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- description str
- The description of the RestApi.
- disable_execute_ boolapi_ endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- endpoint_configuration RestApi Endpoint Configuration 
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- minimum_compression_ intsize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- name str
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- policy Any
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- rest_api_ strid 
- The string identifier of the associated RestApi.
- root_resource_ strid 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- Sequence[root_Tag]
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
- apiKey StringSource Type 
- The source of the API key for metering requests according to a usage plan. Valid values are: HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer.
- binaryMedia List<String>Types 
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
- description String
- The description of the RestApi.
- disableExecute BooleanApi Endpoint 
- Specifies whether clients can invoke your API by using the default execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint
- endpointConfiguration Property Map
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parametersproperty.
- minimumCompression NumberSize 
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
- name String
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- policy Any
- A policy document that contains the permissions for the - RestApiresource. To set the ARN for the policy, use the- !Joinintrinsic function with- ""as delimiter and values of- "execute-api:/"and- "*".- Search the CloudFormation User Guide for - AWS::ApiGateway::RestApifor more information about the expected schema for this property.
- restApi StringId 
- The string identifier of the associated RestApi.
- rootResource StringId 
- The root resource ID for a RestApiresource, such asa0bc123d4e.
- List<Property Map>
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws:. The tag value can be up to 256 characters.
Supporting Types
RestApiEndpointConfiguration   
- IpAddress stringType 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- Types List<string>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- VpcEndpoint List<string>Ids 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
- IpAddress stringType 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- Types []string
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- VpcEndpoint []stringIds 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
- ipAddress StringType 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- types List<String>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- vpcEndpoint List<String>Ids 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
- ipAddress stringType 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- types string[]
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- vpcEndpoint string[]Ids 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
- ip_address_ strtype 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- types Sequence[str]
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- vpc_endpoint_ Sequence[str]ids 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
- ipAddress StringType 
- The IP address types that can invoke an API (RestApi). Use ipv4to allow only IPv4 addresses to invoke an API, or usedualstackto allow both IPv4 and IPv6 addresses to invoke an API. For thePRIVATEendpoint type, onlydualstackis supported.
- types List<String>
- A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type isREGIONAL. For a private API, the endpoint type isPRIVATE.
- vpcEndpoint List<String>Ids 
- A list of VpcEndpointIds of an API (RestApi) against which to create Route53 ALIASes. It is only supported for PRIVATEendpoint type.
Tag
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.