Show / Hide Table of Contents

Class StageProps

Inheritance
System.Object
StageProps
Implements
IStageProps
IStageOptions
IMethodDeploymentOptions
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class StageProps : Object, IStageProps, IStageOptions, IMethodDeploymentOptions
Syntax (vb)
Public Class StageProps
    Inherits Object
    Implements IStageProps, IStageOptions, IMethodDeploymentOptions
Remarks

ExampleMetadata: infused

Examples
// production stage
var prdLogGroup = new LogGroup(this, "PrdLogs");
var api = new RestApi(this, "books", new RestApiProps {
    DeployOptions = new StageOptions {
        AccessLogDestination = new LogGroupLogDestination(prdLogGroup),
        AccessLogFormat = AccessLogFormat.JsonWithStandardFields()
    }
});
var deployment = new Deployment(this, "Deployment", new DeploymentProps { Api = api });

// development stage
var devLogGroup = new LogGroup(this, "DevLogs");
new Stage(this, "dev", new StageProps {
    Deployment = deployment,
    AccessLogDestination = new LogGroupLogDestination(devLogGroup),
    AccessLogFormat = AccessLogFormat.JsonWithStandardFields(new JsonWithStandardFieldProps {
        Caller = false,
        HttpMethod = true,
        Ip = true,
        Protocol = true,
        RequestTime = true,
        ResourcePath = true,
        ResponseLength = true,
        Status = true,
        User = true
    })
});

Synopsis

Constructors

StageProps()

Properties

AccessLogDestination

The CloudWatch Logs log group.

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.

Deployment

The deployment that this stage points to [disable-awslint:ref-via-interface].

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

StageProps()

public StageProps()

Properties

AccessLogDestination

The CloudWatch Logs log group.

public IAccessLogDestination AccessLogDestination { get; set; }
Property Value

IAccessLogDestination

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

AccessLogFormat

Remarks

The format must include either AccessLogFormat.contextRequestId() or AccessLogFormat.contextExtendedRequestId().

Default: - Common Log Format

See: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference

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

Duration

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

Deployment

The deployment that this stage points to [disable-awslint:ref-via-interface].

public Deployment Deployment { get; set; }
Property Value

Deployment

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.

Implements

IStageProps
IStageOptions
IMethodDeploymentOptions
Back to top Generated by DocFX