Closed kimisme9386 closed 3 years ago
DeploymentConfig is directly supported by Cloudformation. Let's build our own construct from this (-> Wrapper over CfnDeploymentConfig) and pass it to the DeploymentGroup Construct? This is cleaner than a createDeploymentConfigInput parameter.
import { EcsDeploymentGroup, EcsDeploymentConfiguration, /**...**/ } from '@cloudcomponents/cdk-blue-green-container-deployment';
const deploymentConfigurattion =new EcsDeploymentConfiguration(this, 'DeploymentConfiguration', {
deploymentConfigName: 'blue-green-config',
trafficRoutingConfig: {
type: "TimeBasedCanary",
timeBasedCanary: {
canaryInterval: 5,
canaryPercentage: 20,
},
},
}
const deploymentGroup = new EcsDeploymentGroup(this, 'DeploymentGroup', {
applicationName: 'blue-green-application',
deploymentGroupName: 'blue-green-deployment-group',
deploymentConfiguration,
//...
});
How do you find that?
Although DeploymentConfig is directly supported by Cloudformation, but in the Construct EcsDeploymentGroup class which leverage CustomResource to create DeploymentGroup by AWS SDK in Lambda.
For consistency purposes, the PR use AWS SDK to create DeploymentConfig as well. The createDeploymentConfigInput props refer to AWS SDK naming which document is in here. The content of createDeploymentConfigInput props is equal to content of CfnDeploymentConfigProps.
Perhaps the createDeploymentConfigInput naming is not good enough. Do you prefer deploymentConfiguration props naming to createDeploymentConfigInput ? @hupe1980
I only implemented the DeploymentGroup with a custom resource because the ecs bluegreeen usecase is not directly supported by Cloudformation. As far as I know, this does not apply to the DeploymentConfiguration. The DeploymentConfiguration is also an independent object. So why not as a separate construct?
After chewing on independent object for DeploymentConfiguration, it's better way to decouple dependency. Thank you for your suggestions.
I have pushed some commitments. Please review it, thanks. @hupe1980
Reference issue https://github.com/cloudcomponents/cdk-constructs/issues/115
fix https://github.com/cloudcomponents/cdk-constructs/issues/115