---
type: resource-type
title: RestApi
description: aws resource type AWS::ApiGateway::RestApi
name: RestApi
lexicon: aws
resource_type: AWS::ApiGateway::RestApi
---
`AWS::ApiGateway::RestApi`, a resource type of the aws lexicon.

## Properties

- `ApiKeySourceType` (`string`, optional)
- `BinaryMediaTypes` (`string[]`, optional)
- `Body` (`Record<string, unknown>`, optional): An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.
- `BodyS3Location` (`RestApi_S3Location`, optional): The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.
- `CloneFrom` (`string`, optional)
- `Description` (`string`, optional)
- `DisableExecuteApiEndpoint` (`boolean`, optional)
- `EndpointAccessMode` (`string`, optional)
- `EndpointConfiguration` (`RestApi_EndpointConfiguration`, optional): A list of the endpoint types and IP address types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the ``Parameters`` property.
- `FailOnWarnings` (`boolean`, optional)
- `MinimumCompressionSize` (`number`, optional)
- `Mode` (`string`, optional): This property applies only when you use OpenAPI to define your REST API. The ``Mode`` determines how API Gateway handles resource updates. Valid values are ``overwrite`` or ``merge``. For ``overwrite``, the new API definition replaces the existing one. The existing API identifier remains unchanged. For ``merge``, the new API definition is merged with the existing API. If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default is ``overwrite``. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use the default mode to define top-level ``RestApi`` properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties.
- `Name` (`string`, optional): The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.
- `Parameters` (`Record<string, unknown>`, optional)
- `Policy` (`Record<string, unknown>`, optional): A policy document that contains the permissions for the ``RestApi`` resource. To set the ARN for the policy, use the ``!Join`` intrinsic function with ``""`` as delimiter and values of ``"execute-api:/"`` and ``"*"``.
- `RestApiId` (`string`, optional)
- `RootResourceId` (`string`, optional)
- `SecurityPolicy` (`string`, optional)
- `Tags` (`RestApi_Tag[]`, optional)

## Attributes

- `RestApiId`
- `RootResourceId`
