interface DeploymentProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.DeploymentProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#DeploymentProps |
![]() | software.amazon.awscdk.services.apigateway.DeploymentProps |
![]() | aws_cdk.aws_apigateway.DeploymentProps |
![]() | aws-cdk-lib » aws_apigateway » DeploymentProps |
Example
// production stage
const prodLogGroup = new logs.LogGroup(this, "PrdLogs");
const api = new apigateway.RestApi(this, 'books', {
deployOptions: {
accessLogDestination: new apigateway.LogGroupLogDestination(prodLogGroup),
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields(),
},
});
const deployment = new apigateway.Deployment(this, 'Deployment', {api});
// development stage
const devLogGroup = new logs.LogGroup(this, "DevLogs");
new apigateway.Stage(this, 'dev', {
deployment,
accessLogDestination: new apigateway.LogGroupLogDestination(devLogGroup),
accessLogFormat: apigateway.AccessLogFormat.jsonWithStandardFields({
caller: false,
httpMethod: true,
ip: true,
protocol: true,
requestTime: true,
resourcePath: true,
responseLength: true,
status: true,
user: true,
}),
});
Properties
Name | Type | Description |
---|---|---|
api | IRest | The Rest API to deploy. |
description? | string | A description of the purpose of the API Gateway deployment. |
retain | boolean | When an API Gateway model is updated, a new deployment will automatically be created. |
stage | string | The name of the stage the API Gateway deployment deploys to. |
api
Type:
IRest
The Rest API to deploy.
description?
Type:
string
(optional, default: No description.)
A description of the purpose of the API Gateway deployment.
retainDeployments?
Type:
boolean
(optional, default: false)
When an API Gateway model is updated, a new deployment will automatically be created.
If this is true, the old API Gateway Deployment resource will not be deleted. This will allow manually reverting back to a previous deployment in case for example
stageName?
Type:
string
(optional, default: No stage name. If the stageName
property is set but a stage with the
corresponding name does not exist, a new stage resource will be created with the
provided stage name.)
The name of the stage the API Gateway deployment deploys to.