interface StageOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.APIGateway.StageOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#StageOptions |
Java | software.amazon.awscdk.services.apigateway.StageOptions |
Python | aws_cdk.aws_apigateway.StageOptions |
TypeScript (source) | aws-cdk-lib » aws_apigateway » StageOptions |
Example
const logGroup = new logs.LogGroup(this, "ApiGatewayAccessLogs");
const api = new apigateway.RestApi(this, 'books', {
deployOptions: {
accessLogDestination: new apigateway.LogGroupLogDestination(logGroup),
accessLogFormat: apigateway.AccessLogFormat.clf(),
}});
Properties
Name | Type | Description |
---|---|---|
access | IAccess | The CloudWatch Logs log group or Firehose delivery stream where to write access logs. |
access | Access | A single line format of access logs of data, as specified by selected $content variables. |
cache | boolean | Indicates whether cache clustering is enabled for the stage. |
cache | string | The stage's cache cluster size. |
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. |
client | string | The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage. |
data | boolean | Specifies whether data trace logging is enabled for this method. |
description? | string | A description of the purpose of the stage. |
documentation | string | The version identifier of the API documentation snapshot. |
logging | Method | Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. |
method | { [string]: Method } | Method deployment options for specific resources/methods. |
metrics | boolean | Specifies whether Amazon CloudWatch metrics are enabled for this method. |
stage | string | The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI). |
throttling | number | Specifies the throttling burst limit. |
throttling | number | Specifies the throttling rate limit. |
tracing | boolean | Specifies whether Amazon X-Ray tracing is enabled for this method. |
variables? | { [string]: string } | A map that defines the stage variables. |
accessLogDestination?
Type:
IAccess
(optional, default: No destination)
The CloudWatch Logs log group or Firehose delivery stream where to write access logs.
accessLogFormat?
Type:
Access
(optional, default: Common Log Format)
A single line format of access logs of data, as specified by selected $content variables.
The format must include either AccessLogFormat.contextRequestId()
or AccessLogFormat.contextExtendedRequestId()
.
cacheClusterEnabled?
Type:
boolean
(optional, default: Disabled for the stage.)
Indicates whether cache clustering is enabled for the stage.
cacheClusterSize?
Type:
string
(optional, default: 0.5)
The stage's cache cluster size.
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.
See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
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.
clientCertificateId?
Type:
string
(optional, default: None.)
The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.
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.
description?
Type:
string
(optional, default: No description.)
A description of the purpose of the stage.
documentationVersion?
Type:
string
(optional, default: No documentation version.)
The version identifier of the API documentation snapshot.
loggingLevel?
Type:
Method
(optional, default: Off)
Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
methodOptions?
Type:
{ [string]:
Method
}
(optional, default: Common options will be used.)
Method deployment options for specific resources/methods.
These will
override common options defined in StageOptions#methodOptions
.
metricsEnabled?
Type:
boolean
(optional, default: false)
Specifies whether Amazon CloudWatch metrics are enabled for this method.
stageName?
Type:
string
(optional, default: "prod")
The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).
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.
See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html
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).
See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html
tracingEnabled?
Type:
boolean
(optional, default: false)
Specifies whether Amazon X-Ray tracing is enabled for this method.
variables?
Type:
{ [string]: string }
(optional, default: No stage variables.)
A map that defines the stage variables.
Variable names must consist of alphanumeric characters, and the values must match the following regular expression: [A-Za-z0-9-._~:/?#&=,]+.