Skip to content

Commit 1f1a7bf

Browse files
authored
Deploy Lambda Pet Clinic in EKS CDK (#149)
*Issue #, if available:* Some of the metrics used by SLO stack in EKS CDK is generated from the lambda pet clinic. In order for the SLO stack to be deployed successfully, the lambda pet clinic is a pre-requisite *Description of changes:* Deploy the lambda pet clinic cdk before deploying EKS stacks. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 722d260 commit 1f1a7bf

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

cdk/eks/eks-cdk.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ fi
5858

5959
# Deploy or destroy all stacks in the app
6060
if [[ "$ACTION" == "deploy" ]]; then
61+
# The SLO stack requires metrics from lambda pet clinic.
62+
cd ../../lambda-petclinic/cdk
63+
if ./deploy.sh; then
64+
echo "Lambda pet clinic was deployed successfully"
65+
else
66+
echo "Lambda pet clinic deployment failed"
67+
./destroy.sh
68+
exit 1
69+
fi
70+
cd ../../cdk/eks
6171

6272
# update vets service config to use the otlp collector when use-otlp is true
6373
MANIFEST_FILE="./lib/manifests/sample-app/vets-service-deployment.yaml"
@@ -104,9 +114,13 @@ if [[ "$ACTION" == "deploy" ]]; then
104114
exit 1
105115
fi
106116
elif [[ "$ACTION" == "destroy" ]]; then
107-
echo "Starting CDK destroy for all stacks in the app"
117+
echo "Starting CDK destroy for all stacks in the eks app"
108118
cdk destroy --context enableSlo=True --all --force --verbose
109-
echo "Destroy complete for all stacks in the app"
119+
echo "Destroy complete for all stacks in the eks app"
120+
echo "Starting CDK destroy for all stacks in the lambda app"
121+
cd ../../lambda-petclinic/cdk
122+
./destroy.sh
123+
echo "Destroy complete for all stacks in the lambda app"
110124
else
111125
echo "Invalid action: $ACTION. Please use 'synth', 'deploy', or 'destroy'."
112126
exit 1

0 commit comments

Comments
 (0)