CfnRestApiProps Struct
Properties for defining a CfnRestApi.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
declare const body: any;
declare const policy: any;
const cfnRestApiProps: apigateway.CfnRestApiProps = {
apiKeySourceType: 'apiKeySourceType',
binaryMediaTypes: ['binaryMediaTypes'],
body: body,
bodyS3Location: {
bucket: 'bucket',
eTag: 'eTag',
key: 'key',
version: 'version',
},
cloneFrom: 'cloneFrom',
description: 'description',
disableExecuteApiEndpoint: false,
endpointAccessMode: 'endpointAccessMode',
endpointConfiguration: {
ipAddressType: 'ipAddressType',
types: ['types'],
vpcEndpointIds: ['vpcEndpointIds'],
},
failOnWarnings: false,
minimumCompressionSize: 123,
mode: 'mode',
name: 'name',
parameters: {
parametersKey: 'parameters',
},
policy: policy,
securityPolicy: 'securityPolicy',
tags: [{
key: 'key',
value: 'value',
}],
version: 'version',
};
Properties
apiKeySourceTypeoptionalstringapi_key_source_typeoptionalstrapiKeySourceTypeoptionalStringApiKeySourceTypeoptionalstringApiKeySourceTypeoptional*string#Valid values are: 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 custom authorizer.
binaryMediaTypesoptionalstring[]binary_media_typesoptionaltyping.List[str]binaryMediaTypesoptionalList<String>BinaryMediaTypesoptionalstring[]BinaryMediaTypesoptional*[]*string#By default, the RestApi supports only UTF-8-encoded text payloads.
For YAML templates, you can also provide the specification in YAML format.
bodyS3LocationoptionalIResolvable | CfnRestApi.S3LocationPropertybody_s3_locationoptionaltyping.Union[IResolvable, S3LocationProperty]bodyS3LocationoptionalIResolvableBodyS3LocationoptionalIResolvableBodyS3Locationoptionalinterface{}#cloneFromoptionalstring | IRestApiRefclone_fromoptionaltyping.Union[str, IRestApiRef]cloneFromoptionalStringCloneFromoptionalstringCloneFromoptionalinterface{}#descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#disableExecuteApiEndpointoptionalboolean | IResolvabledisable_execute_api_endpointoptionaltyping.Union[bool, IResolvable]disableExecuteApiEndpointoptionalBooleanDisableExecuteApiEndpointoptionalboolDisableExecuteApiEndpointoptionalinterface{}#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
endpointAccessModeoptionalstringendpoint_access_modeoptionalstrendpointAccessModeoptionalStringEndpointAccessModeoptionalstringEndpointAccessModeoptional*string#endpointConfigurationoptionalIResolvable | CfnRestApi.EndpointConfigurationPropertyendpoint_configurationoptionaltyping.Union[IResolvable, EndpointConfigurationProperty]endpointConfigurationoptionalIResolvableEndpointConfigurationoptionalIResolvableEndpointConfigurationoptionalinterface{}#Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using the Parameters property.
failOnWarningsoptionalboolean | IResolvablefail_on_warningsoptionaltyping.Union[bool, IResolvable]failOnWarningsoptionalBooleanFailOnWarningsoptionalboolFailOnWarningsoptionalinterface{}#The default value is false .
minimumCompressionSizeoptionalnumberminimum_compression_sizeoptionalint | floatminimumCompressionSizeoptionalNumberMinimumCompressionSizeoptionaldoubleMinimumCompressionSizeoptional*float64#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.
notes
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.
A name is required if the REST API is not based on an OpenAPI specification.
parametersoptionalIResolvable | { [key: string]: string }parametersoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]parametersoptionalIResolvableParametersoptionalIResolvableParametersoptionalinterface{}#notes
For example, to exclude DocumentationParts from an imported API, set ignore=documentation as a parameters value, as in the AWS CLI command of aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json' .
policyoptionalanypolicyoptionalAnypolicyoptionalObjectPolicyoptionalobjectPolicyoptionalinterface{}#To set the ARN for the policy, use the !Join intrinsic function with "" as delimiter and values of "execute-api:/" and "*" .
securityPolicyoptionalstringsecurity_policyoptionalstrsecurityPolicyoptionalStringSecurityPolicyoptionalstringSecurityPolicyoptional*string#tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag#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.
versionoptionalstringversionoptionalstrversionoptionalStringVersionoptionalstringVersionoptional*string#