Skip to content
v2.274.0

MethodDeploymentOptions Struct ​

Example ​

ts
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 ​

cacheDataEncryptedbooleancache_data_encryptedboolcacheDataEncryptedBooleanCacheDataEncryptedboolCacheDataEncrypted*bool= false#
Indicates whether the cached responses are encrypted.
cacheTtlDurationcache_ttlDurationcacheTtlDurationCacheTtlDurationCacheTtlDuration= 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.

cachingEnabledbooleancaching_enabledboolcachingEnabledBooleanCachingEnabledboolCachingEnabled*bool#
Specifies whether responses should be cached and returned for requests.

Default: Caching is Disabled.

A cache cluster must be enabled on the stage for responses to be cached.

dataTraceEnabledbooleandata_trace_enabledbooldataTraceEnabledBooleanDataTraceEnabledboolDataTraceEnabled*bool= 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.

loggingLevelMethodLoggingLevellogging_levelMethodLoggingLevelloggingLevelMethodLoggingLevelLoggingLevelMethodLoggingLevelLoggingLevelMethodLoggingLevel= Off#
Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
metricsEnabledbooleanmetrics_enabledboolmetricsEnabledBooleanMetricsEnabledboolMetricsEnabled*bool= false#
Specifies whether Amazon CloudWatch metrics are enabled for this method.
throttlingBurstLimitnumberthrottling_burst_limitint | floatthrottlingBurstLimitNumberThrottlingBurstLimitdoubleThrottlingBurstLimit*float64#
Specifies the throttling burst limit.

Default: No additional restriction.

The total rate of all requests in your AWS account is limited to 5,000 requests.

throttlingRateLimitnumberthrottling_rate_limitint | floatthrottlingRateLimitNumberThrottlingRateLimitdoubleThrottlingRateLimit*float64#
Specifies the throttling rate limit.

Default: No additional restriction.

The total rate of all requests in your AWS account is limited to 10,000 requests per second (rps).