Class StageOptions
Inheritance
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class StageOptions : Object, IStageOptions, IMethodDeploymentOptions
Syntax (vb)
Public Class StageOptions
Inherits Object
Implements IStageOptions, IMethodDeploymentOptions
Remarks
ExampleMetadata: infused
Examples
var logGroup = new LogGroup(this, "ApiGatewayAccessLogs");
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new LogGroupLogDestination(logGroup),
AccessLogFormat = AccessLogFormat.Clf()
}
});
Synopsis
Constructors
StageOptions() |
Properties
AccessLogDestination | The CloudWatch Logs log group or Firehose delivery stream where to write access logs. |
AccessLogFormat | A single line format of access logs of data, as specified by selected $content variables. |
CacheClusterEnabled | Indicates whether cache clustering is enabled for the stage. |
CacheClusterSize | The stage's cache cluster size. |
CacheDataEncrypted | Indicates whether the cached responses are encrypted. |
CacheTtl | Specifies the time to live (TTL), in seconds, for cached responses. |
CachingEnabled | Specifies whether responses should be cached and returned for requests. |
ClientCertificateId | The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage. |
DataTraceEnabled | Specifies whether data trace logging is enabled for this method. |
Description | A description of the purpose of the stage. |
DocumentationVersion | The version identifier of the API documentation snapshot. |
LoggingLevel | Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs. |
MethodOptions | Method deployment options for specific resources/methods. |
MetricsEnabled | Specifies whether Amazon CloudWatch metrics are enabled for this method. |
StageName | The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI). |
ThrottlingBurstLimit | Specifies the throttling burst limit. |
ThrottlingRateLimit | Specifies the throttling rate limit. |
TracingEnabled | Specifies whether Amazon X-Ray tracing is enabled for this method. |
Variables | A map that defines the stage variables. |
Constructors
StageOptions()
public StageOptions()
Properties
AccessLogDestination
The CloudWatch Logs log group or Firehose delivery stream where to write access logs.
public IAccessLogDestination AccessLogDestination { get; set; }
Property Value
Remarks
Default: - No destination
AccessLogFormat
A single line format of access logs of data, as specified by selected $content variables.
public AccessLogFormat AccessLogFormat { get; set; }
Property Value
Remarks
The format must include either AccessLogFormat.contextRequestId()
or AccessLogFormat.contextExtendedRequestId()
.
Default: - Common Log Format
CacheClusterEnabled
Indicates whether cache clustering is enabled for the stage.
public Nullable<bool> CacheClusterEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: - Disabled for the stage.
CacheClusterSize
The stage's cache cluster size.
public string CacheClusterSize { get; set; }
Property Value
System.String
Remarks
Default: 0.5
CacheDataEncrypted
Indicates whether the cached responses are encrypted.
public Nullable<bool> CacheDataEncrypted { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
CacheTtl
Specifies the time to live (TTL), in seconds, for cached responses.
public Duration CacheTtl { get; set; }
Property Value
Remarks
The higher the TTL, the longer the response will be cached.
Default: Duration.minutes(5)
See: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html
CachingEnabled
Specifies whether responses should be cached and returned for requests.
public Nullable<bool> CachingEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
A cache cluster must be enabled on the stage for responses to be cached.
Default: - Caching is Disabled.
ClientCertificateId
The identifier of the client certificate that API Gateway uses to call your integration endpoints in the stage.
public string ClientCertificateId { get; set; }
Property Value
System.String
Remarks
Default: - None.
DataTraceEnabled
Specifies whether data trace logging is enabled for this method.
public Nullable<bool> DataTraceEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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.
Default: false
Description
A description of the purpose of the stage.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: - No description.
DocumentationVersion
The version identifier of the API documentation snapshot.
public string DocumentationVersion { get; set; }
Property Value
System.String
Remarks
Default: - No documentation version.
LoggingLevel
Specifies the logging level for this method, which effects the log entries pushed to Amazon CloudWatch Logs.
public Nullable<MethodLoggingLevel> LoggingLevel { get; set; }
Property Value
System.Nullable<MethodLoggingLevel>
Remarks
Default: - Off
MethodOptions
Method deployment options for specific resources/methods.
public IDictionary<string, IMethodDeploymentOptions> MethodOptions { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, IMethodDeploymentOptions>
Remarks
These will
override common options defined in StageOptions#methodOptions
.
Default: - Common options will be used.
MetricsEnabled
Specifies whether Amazon CloudWatch metrics are enabled for this method.
public Nullable<bool> MetricsEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
StageName
The name of the stage, which API Gateway uses as the first path segment in the invoked Uniform Resource Identifier (URI).
public string StageName { get; set; }
Property Value
System.String
Remarks
Default: - "prod"
ThrottlingBurstLimit
Specifies the throttling burst limit.
public Nullable<double> ThrottlingBurstLimit { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The total rate of all requests in your AWS account is limited to 5,000 requests.
Default: - No additional restriction.
See: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html
ThrottlingRateLimit
Specifies the throttling rate limit.
public Nullable<double> ThrottlingRateLimit { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The total rate of all requests in your AWS account is limited to 10,000 requests per second (rps).
Default: - No additional restriction.
See: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html
TracingEnabled
Specifies whether Amazon X-Ray tracing is enabled for this method.
public Nullable<bool> TracingEnabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Variables
A map that defines the stage variables.
public IDictionary<string, string> Variables { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Variable names must consist of alphanumeric characters, and the values must match the following regular expression: [A-Za-z0-9-._~:/?#&=,]+.
Default: - No stage variables.