Interface IRestApiProps
Props to create a new instance of RestApi.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IRestApiProps : IResourceOptions, IRestApiBaseProps
Syntax (vb)
Public Interface IRestApiProps
Inherits IResourceOptions, IRestApiBaseProps
Remarks
ExampleMetadata: infused
Examples
var destinationBucket = new Bucket(this, "Bucket");
var deliveryStreamRole = new Role(this, "Role", new RoleProps {
AssumedBy = new ServicePrincipal("firehose.amazonaws.com")
});
var stream = new CfnDeliveryStream(this, "MyStream", new CfnDeliveryStreamProps {
DeliveryStreamName = "amazon-apigateway-delivery-stream",
S3DestinationConfiguration = new S3DestinationConfigurationProperty {
BucketArn = destinationBucket.BucketArn,
RoleArn = deliveryStreamRole.RoleArn
}
});
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new FirehoseLogDestination(stream),
AccessLogFormat = AccessLogFormat.JsonWithStandardFields()
}
});
Synopsis
Properties
ApiKeySourceType | The source of the API key for metering requests according to a usage plan. |
BinaryMediaTypes | The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream". |
CloneFrom | The ID of the API Gateway RestApi resource that you want to clone. |
EndpointConfiguration | The EndpointConfiguration property type specifies the endpoint types of a REST API. |
MinCompressionSize | A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API. |
MinimumCompressionSize | (deprecated) A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API. |
Properties
ApiKeySourceType
The source of the API key for metering requests according to a usage plan.
virtual Nullable<ApiKeySourceType> ApiKeySourceType { get; }
Property Value
System.Nullable<ApiKeySourceType>
Remarks
Default: - Metering is disabled.
BinaryMediaTypes
The list of binary media mime-types that are supported by the RestApi resource, such as "image/png" or "application/octet-stream".
virtual string[] BinaryMediaTypes { get; }
Property Value
System.String[]
Remarks
Default: - RestApi supports only UTF-8-encoded text payloads.
CloneFrom
The ID of the API Gateway RestApi resource that you want to clone.
virtual IRestApi CloneFrom { get; }
Property Value
Remarks
Default: - None.
EndpointConfiguration
The EndpointConfiguration property type specifies the endpoint types of a REST API.
virtual IEndpointConfiguration EndpointConfiguration { get; }
Property Value
Remarks
Default: EndpointType.EDGE
MinCompressionSize
A Size(in bytes, kibibytes, mebibytes etc) that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
virtual Size MinCompressionSize { get; }
Property Value
Remarks
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.
Default: - Compression is disabled.
MinimumCompressionSize
(deprecated) A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (when undefined) on an API.
virtual Nullable<double> MinimumCompressionSize { get; }
Property Value
System.Nullable<System.Double>
Remarks
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.
Default: - Compression is disabled.
Stability: Deprecated