codedeploy: cannot configure blue/green deployment for ServerDeploymentGroup
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
### Describe the bug
There are no options in CDK to set the deployment type from inplace to blue/green deployment. On the console, you can easily switch
### Expected Behavior
i expected some configuration options in the class ServerDeploymentGroup, but there are none.
### Current Behavior
only inplace deployments are possible
### Reproduction Steps
this is all that can be configured:
`const vpc = new Vpc(this, "connect4-vpc-ec2", {
vpcName: "connect4-vpc-ec2",
maxAzs: 2,
subnetConfiguration: [
{
cidrMask: 24,
name: 'ingress',
subnetType: SubnetType.PUBLIC,
}]
})
const asgC4Backend = new AutoScalingGroup(this, "asg", {
vpc,
instanceType: InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.MICRO),
machineImage: MachineImage.latestAmazonLinux2023(),
desiredCapacity: 2,
minCapacity: 1,
maxCapacity: 3
})
Tags.of(asgC4Backend).add("id", "backend-server")
asgC4Backend.role.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'))
const nlb = new NetworkLoadBalancer(this, 'C4-NLB', {
vpc,
internetFacing: true,
});
const listener = nlb.addListener('Listener', {
port: 8001,
});
// Add the Auto Scaling Group as a target
const nlbTargetGroup = listener.addTargets('Targets', {
port: 8001,
targets: [asgC4Backend],
});
const serverApplication = new ServerApplication(this, "serverApplication", {
applicationName: "connect4-server-application-ec2"
})
const deploymentGroup = new ServerDeploymentGroup(this, 'deploymentGroupC4Backend', {
application: serverApplication,
deploymentGroupName: 'deploymentGroupC4Backend',
autoScalingGroups: [asgC4Backend],
installAgent: true,
deploymentConfig: ServerDeploymentConfig.ALL_AT_ONCE,
loadBalancers: [
LoadBalancer.network(nlbTargetGroup),
],
// auto-rollback configuration
autoRollback: {
failedDeployment: true, // default: true
},
});
deploymentGroup.role?.addManagedPolicy(ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'))`
### Possible Solution
include configuration options for blue/green deployment to the ServerDeploymentGroup
### Additional Information/Context
_No response_
### CDK CLI Version
2.144.0 (build 5fb15bc)
### Framework Version
_No response_
### Node.js Version
v20.13.1
### OS
amazon linux 2023
### Language
TypeScript
### Language Version
Typescript (5.4.5)
### Other information
_No response_
Contributor guide
Research direction
Start with the ServerDeploymentGroup API and the AWS CodeDeploy blue/green deployment settings, using the provided TypeScript reproduction to understand the current configuration. Compare the available console options with the CDK construct, then verify that the requested settings can be represented and synthesized for a blue/green deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100