Testing the implementation
Testing the implementation
- Switch back to the productsservice project. Package the project into a JAR using Gradle.

- Open the Dockerfile and create an image tag named productsservice:1.3.0.

- Once the Docker image build is complete, push it to the ECR Repository with a remote tag of 1.3.0.

- Return to the FCJ2024_CDK project and update the image tag in fargateTaskDefinition.addContainer to 1.3.0.

- Deploy the service using the following command:
cdk deploy --all --require-approval never

- After completing the deployment, access the ECS interface and select Task. Then choose any task from the running tasks.

- In the selected task interface, you can see a sidecar container named XRayProductsService running alongside the productsService container.

- Next, we will test the API in Postman to measure the AWS ECS service using AWS X-Ray.

- Access the CloudWatch interface and select Trace Map to view the request path.

- Finally, to view ECS measurement information, select the ECS icon on the trace map.

- Similarly, with DynamoDB.
