interface MethodDeploymentOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.MethodDeploymentOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#MethodDeploymentOptions |
![]() | software.amazon.awscdk.services.apigateway.MethodDeploymentOptions |
![]() | aws_cdk.aws_apigateway.MethodDeploymentOptions |
![]() | aws-cdk-lib » aws_apigateway » MethodDeploymentOptions |
Example
const api = new apigateway.RestApi(this, 'books');
const deployment = new apigateway.Deployment(this, 'my-deployment', { api });
const stage = new apigateway.Stage(this, 'my-stage', {
deployment,
methodOptions: {
'/*/*': { // This special path applies to all resource paths and all HTTP methods
throttlingRateLimit: 100,
throttlingBurstLimit: 200
}
}
});
Properties
Name | Type | Description |
---|---|---|
cache | boolean | Indicates whether the cached responses are encrypted. |
cache | Duration | Specifies the time to live (TTL), in seconds, for cached responses. |
caching | boolean | Specifies whether responses should be cached and returned for requests. |
data | boolean | Specifies whether data trace logging is enabled for this method. |
logging | Method | Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. |
metrics | boolean | Specifies whether Amazon CloudWatch metrics are enabled for this method. |
throttling | number | Specifies the throttling burst limit. |
throttling | number | Specifies the throttling rate limit. |
cacheDataEncrypted?
Type:
boolean
(optional, default: false)
Indicates whether the cached responses are encrypted.
cacheTtl?
Type:
Duration
(optional, default: Duration.minutes(5))
Specifies the time to live (TTL), in seconds, for cached responses.
The higher the TTL, the longer the response will be cached.
cachingEnabled?
Type:
boolean
(optional, default: Caching is Disabled.)
Specifies whether responses should be cached and returned for requests.
A cache cluster must be enabled on the stage for responses to be cached.
dataTraceEnabled?
Type:
boolean
(optional, default: false)
Specifies whether data trace logging is enabled for this method.
When enabled, API gateway will log the full API requests and responses. This can be useful to troubleshoot APIs, but can result in logging sensitive data. We recommend that you don't enable this feature for production APIs.
loggingLevel?
Type:
Method
(optional, default: Off)
Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
metricsEnabled?
Type:
boolean
(optional, default: false)
Specifies whether Amazon CloudWatch metrics are enabled for this method.
throttlingBurstLimit?
Type:
number
(optional, default: No additional restriction.)
Specifies the throttling burst limit.
The total rate of all requests in your AWS account is limited to 5,000 requests.
throttlingRateLimit?
Type:
number
(optional, default: No additional restriction.)
Specifies the throttling rate limit.
The total rate of all requests in your AWS account is limited to 10,000 requests per second (rps).