Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cdk-blue-green-container-deployment): support DeploymentConfig creation #114

Merged
merged 15 commits into from Aug 24, 2021

Conversation

kimisme9386
Copy link
Contributor

@kimisme9386 kimisme9386 commented Aug 20, 2021

Reference issue #115

fix #115

@hupe1980
Copy link
Member

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?

@kimisme9386
Copy link
Contributor Author

kimisme9386 commented Aug 23, 2021

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

@hupe1980
Copy link
Member

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?

@kimisme9386
Copy link
Contributor Author

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

@hupe1980 hupe1980 self-requested a review August 24, 2021 16:40
Copy link
Member

@hupe1980 hupe1980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thx

@hupe1980 hupe1980 merged commit e9aab02 into cloudcomponents:master Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Support DeploymentConfig creation
2 participants