- Copy the product microservice load balancer DNS name from the AWS console.
- Update the login microservice code to redirect authenticated users to the product service endpoint.
- Push the change to trigger your CI/CD pipeline (build → image → deploy).
- Verify the integration by logging in and confirming the redirect.
/welcome or /welcome-page) to use as the redirect target.

app.py and update the login POST handler so that on successful authentication it redirects to the product microservice load balancer URL.
Below is an improved example that:
- uses an environment variable for the product URL (so you avoid hard-coding in source),
- shows the login route and redirect handler,
- keeps the login flow simple for clarity.
Do not hard-code external service URLs or secrets in production code. Use environment variables, a configuration system, or service discovery (e.g., AWS Cloud Map or Route 53). Never store plaintext passwords — use a secure password hashing mechanism such as
bcrypt and validate credentials by comparing hashes.master or main). This will trigger your CI/CD pipeline (e.g., AWS CodePipeline) to build a new Docker image and deploy the updated login service.

Expected result: after a successful login, the browser should redirect to the product microservice endpoint (e.g.
http://.../welcome), demonstrating that the two services are connected but still independently deployable.
Step 5 — Confirm services are running in ECS
Verify both microservices are running in your cluster (for example, an Amazon ECS cluster). You should see the product service (crypto-app) and the login service (login-app-microservice) as separate services with running tasks.

- AWS Cloud9 — in-browser IDE for editing your microservice code.
- AWS CodePipeline (CI/CD) — example pipeline for build and deploy.
- Amazon ECS — container orchestration to run microservice tasks.
- Route 53 — for managing DNS names instead of hard-coded ELB URLs.
- bcrypt documentation — use for secure password hashing.
By redirecting authenticated users to the product microservice load balancer, the login service remains decoupled from the product implementation. This enables independent development, testing, and deployment. For production, prefer configuration via environment variables, DNS-based routing (Route 53), or a service discovery mechanism rather than embedding ELB URLs in source code.