Open daTobiGit opened 3 weeks ago
it seems the aws cli does support those parameters:
aws deploy create-deployment-group \ --application-name MyCodeDeployApp \ --deployment-group-name MyDeploymentGroup \ --deployment-config-name CodeDeployDefault.AllAtOnce \ --auto-scaling-groups MyAutoScalingGroup \ --service-role-arn arn:aws:iam::123456789012:role/CodeDeployRole \ --deployment-style deploymentType=BLUE_GREEN,deploymentOption=WITH_TRAFFIC_CONTROL \ --blue-green-deployment-configuration file://blue-green-deployment-config.json \ --load-balancer-info elbInfoList=[{name=MyLoadBalancer}]
Hi @daTobiGit , thanks for reaching out.
I see that cloudformation supports this blue/green deployment , can be seen here in L1 Construct -
Is this what you are looking for ??
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.
Hi @khushail , thank you for your response.
i already tried it out with the cfn class, but unfortunately it also doesnt work
`// const roleC4DeploymentApp = new Role(this, "roleC4DeploymentApp", {
// assumedBy: new ServicePrincipal('codedeploy.amazonaws.com'),
// managedPolicies: [
// ManagedPolicy.fromAwsManagedPolicyName('AdministratorAccess'),
// ],
// });
// const serverApplication2 = new ServerApplication(this, "serverApplicationEC2Deploy", {
// applicationName: "c4ec2deploymentApp"
// })
// const dg2 = new CfnDeploymentGroup( this, "dg2",{
// applicationName: serverApplication2.applicationName,
// deploymentGroupName: 'C4BackendDeployment',
// // deploymentConfigName: 'deploymentConfigName',
// serviceRoleArn: roleC4DeploymentApp.roleArn,
// autoRollbackConfiguration: {
// enabled: true,
// events: ['DEPLOYMENT_FAILURE'],
// },
// autoScalingGroups: [asgC4Backend.autoScalingGroupName],
// blueGreenDeploymentConfiguration: {
// deploymentReadyOption: {
// actionOnTimeout: 'CONTINUE_DEPLOYMENT',
// waitTimeInMinutes: 0, // Immediate switch
// },
// greenFleetProvisioningOption: {
// action: 'COPY_AUTO_SCALING_GROUP',
// },
// terminateBlueInstancesOnDeploymentSuccess: {
// action: 'TERMINATE',
// terminationWaitTimeInMinutes: 1,
// },
// },
// // loadBalancerInfo: {
// // targetGroupPairInfoList: [{
// // targetGroups: [{ name: nlbTargetGroup.targetGroupName }],
// // prodTrafficRoute: {
// // listenerArns: [listener.listenerArn],
// // },
// // testTrafficRoute: {
// // listenerArns: [listener.listenerArn],
// // },
// // }],
// // },
// deploymentStyle: {
// deploymentOption: 'WITH_TRAFFIC_CONTROL',
// deploymentType: 'BLUE_GREEN',
// }
// })
// const deploymentGroup2 = ServerDeploymentGroup.fromServerDeploymentGroupAttributes( this, 'ExistingCodeDeployDeploymentGroup', {
// application : serverApplication2,
// deploymentGroupName: dg2.ref,
// });`
when i configure the "deploymentStyle" attribute, i must not specify the AutoScalingGroups , LoadBalancerInfo , or Deployment properties. But CDK says: "one ASG has to be configured". This problem seems to be known: aws repost
My Bad, thanks for sharing the article. I see the CDK Docs also mention about this -
Amazon ECS blue/green deployments through CodeDeploy do not use the AWS::CodeDeploy::DeploymentGroup resource. To perform Amazon ECS blue/green deployments, use the AWS::CodeDeploy::BlueGreen hook. See [Perform Amazon ECS blue/green deployments through CodeDeploy using AWS CloudFormation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/blue-green.html) for more information.
In that case, you could file a FR with Cloudformation team ,by adding this on their Cloudformation coverage roadmap. .
let me know if you need any other help! Thanks!
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, }] })
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