This message was deleted.
s
This message was deleted.
b
do you have code to share?
r
Here is the relevant code blocks. They appear one after the other
Copy code
const service = new aws.ecs.Service("fake-backend-build", {
            cluster: ecsCluster.id,
            // taskDefinition: taskDefinition.arn,
            enableExecuteCommand: true,
            desiredCount: autoscaling_parsed.desired,
            launchType: "FARGATE",
            deploymentController: {
                type: "CODE_DEPLOY",
            },
            networkConfiguration: {
                subnets:[ subnetA, subnetB ],
                assignPublicIp: false,
                securityGroups: [ sg ],
            },
            // waitForSteadyState: true,
            loadBalancers: [{
                targetGroupArn: targetGroupA.arn,
                containerName: "backend-build-container", // Replace with your container name
                containerPort: 80 // Replace with the port your container is listening on
            }],
            tags: {
                "application" : "fake-backend-build",
                "service" : "backend"
            },
        });

        // Create the CodeDeploy Deployment Group with the Load Balancer.
    const deploymentGroup = new aws.codedeploy.DeploymentGroup("fake-backend-build", {
            appName: codedeployApplication.name,
            deploymentConfigName: "CodeDeployDefault.ECSAllAtOnce",
            deploymentGroupName: "fake-backend-build",
            serviceRoleArn: codedeployIamRole.arn, // replace with your actual service role ARN
            
            ////
            autoRollbackConfiguration: {
                enabled: true,
                events: ["DEPLOYMENT_FAILURE"],
            },
            blueGreenDeploymentConfig: {
                deploymentReadyOption: {
                    actionOnTimeout: "CONTINUE_DEPLOYMENT",
                },
                terminateBlueInstancesOnDeploymentSuccess: {
                    action: "TERMINATE",
                    terminationWaitTimeInMinutes: 5,
                },
            },
            deploymentStyle: {
                deploymentOption: "WITH_TRAFFIC_CONTROL",
                deploymentType: "BLUE_GREEN",
            },
            ecsService: {
                serviceName: service.name,
                clusterName: ecsCluster.name,
            },
            loadBalancerInfo: {
                targetGroupPairInfo: {
                    prodTrafficRoute: {
                        listenerArns: [listener.arn],
                    },
                    targetGroups: [
                        {
                            name: targetGroupA.name,
                        },
                        {
                            name: targetGroupB.name,
                        },
                    ],
                },
            },
            tags: {
                "application" : "fake-backend-build",
                "service" : "backend"
            },
        });
Happy to share the full file if needed
b
I have this working, but need to fish out the example 😅
r
Amazing, thank you thank you!
b
I’m just getting back from PTO so might be a day or so
r
No problem, the help is appriciated!
Thank you
b
Just booked time for us to connect Wednesday! Thank you Lee and Greg
r
You may want to check with Lee. He may have a solution for my problem worked out already. If that's the case, I'm still happy to meet with you but we may not need the tech help
b
Lee is invited to the call to address! Yes! And yes - we do need to chat about the teams account as well so its perfect timing
b
@rough-jewelry-40643 Unfortunately the code was committed to a customer repo, so I’ll have to rebuild the example. it’ll take a little while longer, I’m afraid
r
No worries, again thank you. Can you point me in a direction or a document I can look at to figure this out my self.
211 Views