Class Stage
Inherited Members
Namespace: Amazon.CDK.AWS.APIGateway
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Stage : StageBase, IStage, IResource, IStageRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class Stage Inherits StageBase Implements IStage, IResource, IStageRef, IConstruct, IDependable, IEnvironmentAware
Remarks
ExampleMetadata: infused
Examples
// production stage
var prodLogGroup = new LogGroup(this, "PrdLogs");
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new LogGroupLogDestination(prodLogGroup),
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
| Stage(Construct, string, IStageProps) |
Properties
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
| RestApi | RestApi to which this stage is associated. |
| StageName | Name of this stage. |
Methods
| FromStageAttributes(Construct, string, IStageAttributes) | Import a Stage by its attributes. |
Constructors
Stage(Construct, string, IStageProps)
public Stage(Construct scope, string id, IStageProps props)
Parameters
- scope Construct
- id string
- props IStageProps
Remarks
ExampleMetadata: infused
Examples
// production stage
var prodLogGroup = new LogGroup(this, "PrdLogs");
var api = new RestApi(this, "books", new RestApiProps {
DeployOptions = new StageOptions {
AccessLogDestination = new LogGroupLogDestination(prodLogGroup),
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
})
});
Properties
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
ExampleMetadata: infused
RestApi
RestApi to which this stage is associated.
public override IRestApi RestApi { get; }
Property Value
Overrides
Remarks
ExampleMetadata: infused
StageName
Name of this stage.
public override string StageName { get; }
Property Value
Overrides
Remarks
ExampleMetadata: infused
Methods
FromStageAttributes(Construct, string, IStageAttributes)
Import a Stage by its attributes.
public static IStage FromStageAttributes(Construct scope, string id, IStageAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IStageAttributes
Returns
Remarks
ExampleMetadata: infused
Implements
Constructs.IConstruct
Constructs.IDependable