0

I have two ECS services. UI(http://<LB>/SS_UI/) and API(http://<LB>/webservice/). UI calls API and it's config file will have references to the API e.g.

public static springURL = "http://<LB>/webservice/"

The documentation for blue green deployment for ECS(https://cicd-pipeline-cdk-eks-bluegreen.workshop.aws/en/ecsbg/serviceupd.html) suggests creating two listener on the load balancer and two target groups

<LB>:80 -> Original set with live traffic
<LB>:8080 -> Replacement set for testing

This works if I want to test changes to individual projects. I commit to API. Old version of API is on port 80. New version is on port 8080. After testing http://<LB>:8080/webservice/ the switchover can happen after pre-defined time(pic) enter image description here

But it doesn't work if I want to test from the UI because UI references the old version of API on port 80

If I commit changes to the UI project by referencing http://<LB>:8080/webservice/, even though I can test from UI at http://<LB>:8080/SS_UI/, I cannot allow the replacement set for UI to become the original set because API on port 8080 will eventually get deleted. How can I ensure that as soon as replacement set for API at port 8080 moves to port 80, the UI also starts referencing API of port 80?

1 Answer 1

0

I don't think CodeDeploy is designed to include these type of use cases (also because the ramifications and options of allowing that flexibility are pretty much infinite). CodeDeploy is designed to manage B/G deployments for a single micro-service and not for a complex app like you are describing (sure your app isn't very complex but where do you stop supporting complex configurations?). In the context of CodeDeploy these would be two separate B/G deployments (and you'd need to test the back end service via API).

The only alternative I can think of to make this work is to create an additional (hidden/secured?) path in your front-end (e.g. /SS_UI-8080 or perhaps passing a parameter to the /SS_UI path?) that allows you to modify (in your code) the port to use to connect to the back end service via the LB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.