@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.133Z") @Stability(value=Stable) public interface CfnRestApiProps extends software.amazon.jsii.JsiiSerializable
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;
Object body;
Object policy;
CfnRestApiProps cfnRestApiProps = CfnRestApiProps.builder()
.apiKeySourceType("apiKeySourceType")
.binaryMediaTypes(List.of("binaryMediaTypes"))
.body(body)
.bodyS3Location(S3LocationProperty.builder()
.bucket("bucket")
.eTag("eTag")
.key("key")
.version("version")
.build())
.cloneFrom("cloneFrom")
.description("description")
.disableExecuteApiEndpoint(false)
.endpointConfiguration(EndpointConfigurationProperty.builder()
.types(List.of("types"))
.vpcEndpointIds(List.of("vpcEndpointIds"))
.build())
.failOnWarnings(false)
.minimumCompressionSize(123)
.mode("mode")
.name("name")
.parameters(Map.of(
"parametersKey", "parameters"))
.policy(policy)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnRestApiProps.Builder
A builder for
CfnRestApiProps |
static class |
CfnRestApiProps.Jsii$Proxy
An implementation for
CfnRestApiProps |
| Modifier and Type | Method and Description |
|---|---|
static CfnRestApiProps.Builder |
builder() |
default String |
getApiKeySourceType()
The source of the API key for metering requests according to a usage plan.
|
default List<String> |
getBinaryMediaTypes()
The list of binary media types that are supported by the `RestApi` resource.
|
default Object |
getBody()
An OpenAPI specification that defines a set of RESTful APIs in JSON format.
|
default Object |
getBodyS3Location()
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.
|
default String |
getCloneFrom()
The ID of the `RestApi` resource that you want to clone.
|
default String |
getDescription()
A description of the `RestApi` resource.
|
default Object |
getDisableExecuteApiEndpoint()
Specifies whether clients can invoke your API by using the default `execute-api` endpoint.
|
default Object |
getEndpointConfiguration()
A list of the endpoint types of the API.
|
default Object |
getFailOnWarnings()
Indicates whether to roll back the resource if a warning occurs while API Gateway is creating the `RestApi` resource.
|
default Number |
getMinimumCompressionSize()
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.
|
default String |
getMode()
This property applies only when you use OpenAPI to define your REST API.
|
default String |
getName()
A name for the `RestApi` resource.
|
default Object |
getParameters()
Custom header parameters for the request.
|
default Object |
getPolicy()
A policy document that contains the permissions for the `RestApi` resource.
|
default List<CfnTag> |
getTags()
An array of arbitrary tags (key-value pairs) to associate with the API.
|
@Stability(value=Stable) @Nullable default String getApiKeySourceType()
HEADER to read the API key from the X-API-Key header of a request.AUTHORIZER to read the API key from the UsageIdentifierKey from a Lambda authorizer.@Stability(value=Stable) @Nullable default List<String> getBinaryMediaTypes()
Use ~1 instead of / in the media types, for example image~1png or application~1octet-stream . By default, RestApi supports only UTF-8-encoded text payloads. Duplicates are not allowed. For more information, see Enable Support for Binary Payloads in API Gateway in the API Gateway Developer Guide .
@Stability(value=Stable) @Nullable default Object getBody()
For YAML templates, you can also provide the specification in YAML format.
@Stability(value=Stable) @Nullable default Object getBodyS3Location()
@Stability(value=Stable) @Nullable default String getCloneFrom()
@Stability(value=Stable) @Nullable default String getDescription()
@Stability(value=Stable) @Nullable default Object getDisableExecuteApiEndpoint()
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.
@Stability(value=Stable) @Nullable default Object getEndpointConfiguration()
Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parameters property.
@Stability(value=Stable) @Nullable default Object getFailOnWarnings()
@Stability(value=Stable) @Nullable default Number getMinimumCompressionSize()
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.
@Stability(value=Stable) @Nullable default String getMode()
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 takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API. Use merge 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.
If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default is overwrite . Otherwise, the default value is merge .
@Stability(value=Stable) @Nullable default String getName()
@Stability(value=Stable) @Nullable default Object getParameters()
@Stability(value=Stable) @Nullable default Object getPolicy()
To set the ARN for the policy, use the !Join intrinsic function with "" as delimiter and values of "execute-api:/" and "*" .
@Stability(value=Stable) @Nullable default List<CfnTag> getTags()
@Stability(value=Stable) static CfnRestApiProps.Builder builder()
CfnRestApiProps.Builder of CfnRestApiPropsCopyright © 2022. All rights reserved.