aws.apigateway.RestApi
Explore with Pulumi AI
Manages an API Gateway REST API. The REST API can be configured via importing an OpenAPI specification in the body
argument (with other arguments serving as overrides) or via other provider resources to manage the resources (aws.apigateway.Resource
resource), methods (aws.apigateway.Method
resource), integrations (aws.apigateway.Integration
resource), etc. of the REST API. Once the REST API is configured, the aws.apigateway.Deployment
resource can be used along with the aws.apigateway.Stage
resource to publish the REST API.
Note: Amazon API Gateway Version 1 resources are used for creating and deploying REST APIs. To create and deploy WebSocket and HTTP APIs, use Amazon API Gateway Version 2 resources.
!> WARN: When importing Open API Specifications with the body
argument, by default the API Gateway REST API will be replaced with the Open API Specification thus removing any existing methods, resources, integrations, or endpoints. Endpoint mutations are asynchronous operations, and race conditions with DNS are possible. To overcome this limitation, use the put_rest_api_mode
attribute and set it to merge
.
Example Usage
Create RestApi Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RestApi(name: string, args?: RestApiArgs, opts?: CustomResourceOptions);
@overload
def RestApi(resource_name: str,
args: Optional[RestApiArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def RestApi(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_key_source: Optional[str] = None,
binary_media_types: Optional[Sequence[str]] = None,
body: Optional[str] = None,
description: Optional[str] = None,
disable_execute_api_endpoint: Optional[bool] = None,
endpoint_configuration: Optional[RestApiEndpointConfigurationArgs] = None,
fail_on_warnings: Optional[bool] = None,
minimum_compression_size: Optional[str] = None,
name: Optional[str] = None,
parameters: Optional[Mapping[str, str]] = None,
policy: Optional[str] = None,
put_rest_api_mode: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
func NewRestApi(ctx *Context, name string, args *RestApiArgs, opts ...ResourceOption) (*RestApi, error)
public RestApi(string name, RestApiArgs? args = null, CustomResourceOptions? opts = null)
public RestApi(String name, RestApiArgs args)
public RestApi(String name, RestApiArgs args, CustomResourceOptions options)
type: aws:apigateway:RestApi
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RestApiArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var restApiResource = new Aws.ApiGateway.RestApi("restApiResource", new()
{
ApiKeySource = "string",
BinaryMediaTypes = new[]
{
"string",
},
Body = "string",
Description = "string",
DisableExecuteApiEndpoint = false,
EndpointConfiguration = new Aws.ApiGateway.Inputs.RestApiEndpointConfigurationArgs
{
Types = "string",
VpcEndpointIds = new[]
{
"string",
},
},
FailOnWarnings = false,
MinimumCompressionSize = "string",
Name = "string",
Parameters =
{
{ "string", "string" },
},
Policy = "string",
PutRestApiMode = "string",
Tags =
{
{ "string", "string" },
},
});
example, err := apigateway.NewRestApi(ctx, "restApiResource", &apigateway.RestApiArgs{
ApiKeySource: pulumi.String("string"),
BinaryMediaTypes: pulumi.StringArray{
pulumi.String("string"),
},
Body: pulumi.String("string"),
Description: pulumi.String("string"),
DisableExecuteApiEndpoint: pulumi.Bool(false),
EndpointConfiguration: &apigateway.RestApiEndpointConfigurationArgs{
Types: pulumi.String("string"),
VpcEndpointIds: pulumi.StringArray{
pulumi.String("string"),
},
},
FailOnWarnings: pulumi.Bool(false),
MinimumCompressionSize: pulumi.String("string"),
Name: pulumi.String("string"),
Parameters: pulumi.StringMap{
"string": pulumi.String("string"),
},
Policy: pulumi.String("string"),
PutRestApiMode: pulumi.String("string"),
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var restApiResource = new RestApi("restApiResource", RestApiArgs.builder()
.apiKeySource("string")
.binaryMediaTypes("string")
.body("string")
.description("string")
.disableExecuteApiEndpoint(false)
.endpointConfiguration(RestApiEndpointConfigurationArgs.builder()
.types("string")
.vpcEndpointIds("string")
.build())
.failOnWarnings(false)
.minimumCompressionSize("string")
.name("string")
.parameters(Map.of("string", "string"))
.policy("string")
.putRestApiMode("string")
.tags(Map.of("string", "string"))
.build());
rest_api_resource = aws.apigateway.RestApi("restApiResource",
api_key_source="string",
binary_media_types=["string"],
body="string",
description="string",
disable_execute_api_endpoint=False,
endpoint_configuration={
"types": "string",
"vpcEndpointIds": ["string"],
},
fail_on_warnings=False,
minimum_compression_size="string",
name="string",
parameters={
"string": "string",
},
policy="string",
put_rest_api_mode="string",
tags={
"string": "string",
})
const restApiResource = new aws.apigateway.RestApi("restApiResource", {
apiKeySource: "string",
binaryMediaTypes: ["string"],
body: "string",
description: "string",
disableExecuteApiEndpoint: false,
endpointConfiguration: {
types: "string",
vpcEndpointIds: ["string"],
},
failOnWarnings: false,
minimumCompressionSize: "string",
name: "string",
parameters: {
string: "string",
},
policy: "string",
putRestApiMode: "string",
tags: {
string: "string",
},
});
type: aws:apigateway:RestApi
properties:
apiKeySource: string
binaryMediaTypes:
- string
body: string
description: string
disableExecuteApiEndpoint: false
endpointConfiguration:
types: string
vpcEndpointIds:
- string
failOnWarnings: false
minimumCompressionSize: string
name: string
parameters:
string: string
policy: string
putRestApiMode: string
tags:
string: string
RestApi Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The RestApi resource accepts the following input properties:
- Api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Binary
Media List<string>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - Description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Disable
Execute boolApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- Fail
On boolWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- Minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - Parameters Dictionary<string, string>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Binary
Media []stringTypes - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - Description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Disable
Execute boolApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Endpoint
Configuration RestApi Endpoint Configuration Args - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- Fail
On boolWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- Minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - Parameters map[string]string
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- api
Key StringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - binary
Media List<String>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body String
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - description String
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute BooleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- fail
On BooleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression StringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name String
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Map<String,String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy String
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest StringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - binary
Media string[]Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute booleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- fail
On booleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters {[key: string]: string}
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- api_
key_ strsource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - binary_
media_ Sequence[str]types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body str
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - description str
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable_
execute_ boolapi_ endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint_
configuration RestApi Endpoint Configuration Args - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- fail_
on_ boolwarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum_
compression_ strsize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name str
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Mapping[str, str]
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy str
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put_
rest_ strapi_ mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- api
Key StringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - binary
Media List<String>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body String
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - description String
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute BooleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration Property Map - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- fail
On BooleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression StringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name String
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Map<String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy String
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest StringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the RestApi resource produces the following output properties:
- Arn string
- ARN
- Created
Date string - Creation date of the REST API
- Execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - Id string
- The provider-assigned unique ID for this managed resource.
- Root
Resource stringId - Resource ID of the REST API's root
- Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Arn string
- ARN
- Created
Date string - Creation date of the REST API
- Execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - Id string
- The provider-assigned unique ID for this managed resource.
- Root
Resource stringId - Resource ID of the REST API's root
- map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN
- created
Date String - Creation date of the REST API
- execution
Arn String - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - id String
- The provider-assigned unique ID for this managed resource.
- root
Resource StringId - Resource ID of the REST API's root
- Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn string
- ARN
- created
Date string - Creation date of the REST API
- execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - id string
- The provider-assigned unique ID for this managed resource.
- root
Resource stringId - Resource ID of the REST API's root
- {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn str
- ARN
- created_
date str - Creation date of the REST API
- execution_
arn str - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - id str
- The provider-assigned unique ID for this managed resource.
- root_
resource_ strid - Resource ID of the REST API's root
- Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- arn String
- ARN
- created
Date String - Creation date of the REST API
- execution
Arn String - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - id String
- The provider-assigned unique ID for this managed resource.
- root
Resource StringId - Resource ID of the REST API's root
- Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Look up Existing RestApi Resource
Get an existing RestApi resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RestApiState, opts?: CustomResourceOptions): RestApi
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_key_source: Optional[str] = None,
arn: Optional[str] = None,
binary_media_types: Optional[Sequence[str]] = None,
body: Optional[str] = None,
created_date: Optional[str] = None,
description: Optional[str] = None,
disable_execute_api_endpoint: Optional[bool] = None,
endpoint_configuration: Optional[RestApiEndpointConfigurationArgs] = None,
execution_arn: Optional[str] = None,
fail_on_warnings: Optional[bool] = None,
minimum_compression_size: Optional[str] = None,
name: Optional[str] = None,
parameters: Optional[Mapping[str, str]] = None,
policy: Optional[str] = None,
put_rest_api_mode: Optional[str] = None,
root_resource_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> RestApi
func GetRestApi(ctx *Context, name string, id IDInput, state *RestApiState, opts ...ResourceOption) (*RestApi, error)
public static RestApi Get(string name, Input<string> id, RestApiState? state, CustomResourceOptions? opts = null)
public static RestApi get(String name, Output<String> id, RestApiState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Arn string
- ARN
- Binary
Media List<string>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - Created
Date string - Creation date of the REST API
- Description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Disable
Execute boolApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- Execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - Fail
On boolWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- Minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - Parameters Dictionary<string, string>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Root
Resource stringId - Resource ID of the REST API's root
- Dictionary<string, string>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Dictionary<string, string>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- Api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Arn string
- ARN
- Binary
Media []stringTypes - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - Created
Date string - Creation date of the REST API
- Description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Disable
Execute boolApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Endpoint
Configuration RestApi Endpoint Configuration Args - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- Execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - Fail
On boolWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- Minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - Parameters map[string]string
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - Policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - Root
Resource stringId - Resource ID of the REST API's root
- map[string]string
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - map[string]string
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- api
Key StringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - arn String
- ARN
- binary
Media List<String>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body String
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - created
Date String - Creation date of the REST API
- description String
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute BooleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- execution
Arn String - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - fail
On BooleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression StringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name String
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Map<String,String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy String
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest StringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - root
Resource StringId - Resource ID of the REST API's root
- Map<String,String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String,String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- api
Key stringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - arn string
- ARN
- binary
Media string[]Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body string
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - created
Date string - Creation date of the REST API
- description string
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute booleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration RestApi Endpoint Configuration - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- execution
Arn string - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - fail
On booleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression stringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name string
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters {[key: string]: string}
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy string
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest stringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - root
Resource stringId - Resource ID of the REST API's root
- {[key: string]: string}
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - {[key: string]: string}
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- api_
key_ strsource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - arn str
- ARN
- binary_
media_ Sequence[str]types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body str
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - created_
date str - Creation date of the REST API
- description str
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable_
execute_ boolapi_ endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint_
configuration RestApi Endpoint Configuration Args - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- execution_
arn str - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - fail_
on_ boolwarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum_
compression_ strsize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name str
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Mapping[str, str]
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy str
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put_
rest_ strapi_ mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - root_
resource_ strid - Resource ID of the REST API's root
- Mapping[str, str]
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Mapping[str, str]
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
- api
Key StringSource - Source of the API key for requests. Valid values are
HEADER
(default) andAUTHORIZER
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-api-key-source
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - arn String
- ARN
- binary
Media List<String>Types - List of binary media types supported by the REST API. By default, the REST API supports only UTF-8-encoded text payloads. If importing an OpenAPI specification via the
body
argument, this corresponds to thex-amazon-apigateway-binary-media-types
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - body String
- OpenAPI specification that defines the set of routes and integrations to create as part of the REST API. This configuration, and any updates to it, will replace all REST API configuration except values overridden in this resource configuration and other resource updates applied after this resource but before any
aws.apigateway.Deployment
creation. More information about REST API OpenAPI support can be found in the API Gateway Developer Guide. - created
Date String - Creation date of the REST API
- description String
- Description of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.description
field. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - disable
Execute BooleanApi Endpoint - Whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint. Defaults to
false
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensiondisableExecuteApiEndpoint
property. If the argument value istrue
and is different than the OpenAPI value, the argument value will override the OpenAPI value. - endpoint
Configuration Property Map - Configuration block defining API endpoint configuration including endpoint type. Defined below.
- execution
Arn String - Execution ARN part to be used in
lambda_permission
'ssource_arn
when allowing API Gateway to invoke a Lambda function, e.g.,arn:aws:execute-api:eu-west-2:123456789012:z4675bid1j
, which can be concatenated with allowed stage, method and resource path. - fail
On BooleanWarnings - Whether warnings while API Gateway is creating or updating the resource should return an error or not. Defaults to
false
- minimum
Compression StringSize - Minimum response size to compress for the REST API. String containing an integer value between
-1
and10485760
(10MB).-1
will disable an existing compression configuration, and all other values will enable compression with the configured size. New resources can simply omit this argument to disable compression, rather than setting the value to-1
. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-minimum-compression-size
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - name String
- Name of the REST API. If importing an OpenAPI specification via the
body
argument, this corresponds to theinfo.title
field. If the argument value is different than the OpenAPI value, the argument value will override the OpenAPI value. - parameters Map<String>
- Map of customizations for importing the specification in the
body
argument. For example, to exclude DocumentationParts from an imported API, setignore
equal todocumentation
. Additional documentation, including other parameters such asbasepath
, can be found in the API Gateway Developer Guide. - policy String
- JSON formatted policy document that controls access to the API Gateway. For more information about building AWS IAM policy documents with Pulumi, see the AWS IAM Policy Document Guide. The provider will only perform drift detection of its value when present in a configuration. We recommend using the
aws.apigateway.RestApiPolicy
resource instead. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-policy
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - put
Rest StringApi Mode - Mode of the PutRestApi operation when importing an OpenAPI specification via the
body
argument (create or update operation). Valid values aremerge
andoverwrite
. If unspecificed, defaults tooverwrite
(for backwards compatibility). This corresponds to thex-amazon-apigateway-put-integration-method
extension. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value. - root
Resource StringId - Resource ID of the REST API's root
- Map<String>
- Key-value map of resource tags. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level. - Map<String>
- Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
RestApiEndpointConfiguration, RestApiEndpointConfigurationArgs
- Types string
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - Vpc
Endpoint List<string>Ids - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
- Types string
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - Vpc
Endpoint []stringIds - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
- types String
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - vpc
Endpoint List<String>Ids - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
- types string
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - vpc
Endpoint string[]Ids - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
- types str
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - vpc_
endpoint_ Sequence[str]ids - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
- types String
- List of endpoint types. This resource currently only supports managing a single value. Valid values:
EDGE
,REGIONAL
orPRIVATE
. If unspecified, defaults toEDGE
. If set toPRIVATE
recommend to setput_rest_api_mode
=merge
to not cause the endpoints and associated Route53 records to be deleted. Refer to the documentation for more information on the difference between edge-optimized and regional APIs. - vpc
Endpoint List<String>Ids - Set of VPC Endpoint identifiers. It is only supported for
PRIVATE
endpoint type. If importing an OpenAPI specification via thebody
argument, this corresponds to thex-amazon-apigateway-endpoint-configuration
extensionvpcEndpointIds
property. If the argument value is provided and is different than the OpenAPI value, the argument value will override the OpenAPI value.
Import
Using pulumi import
, import aws_api_gateway_rest_api
using the REST API ID. For example:
$ pulumi import aws:apigateway/restApi:RestApi example 12345abcde
~> NOTE: Resource import does not currently support the body
attribute.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.