@@ -75,9 +75,8 @@ for i in {1..20}; do
7575 sleep 5
7676done
7777
78- API_ID=$( aws apigateway get-rest-apis --query " items[?name=='unicornstore-thread-dump-api'].id" --output text)
79- VPCE_ID=$( aws ec2 describe-vpc-endpoints --filters " Name=service-name,Values=com.amazonaws.${AWS_REGION} .execute-api" --query " VpcEndpoints[0].VpcEndpointId" --output text)
80- LAMBDA_URL=" https://${API_ID} -${VPCE_ID} .execute-api.${AWS_REGION} .vpce.amazonaws.com/prod"
78+ VPCE_DNS=$( aws ec2 describe-vpc-endpoints --filters " Name=service-name,Values=com.amazonaws.${AWS_REGION} .execute-api" --query " VpcEndpoints[0].DnsEntries[0].DnsName" --output text)
79+ APIGW_URL=" https://${VPCE_DNS} /prod"
8180
8281log " 📁 Creating folder '$FOLDER_NAME '..."
8382FOLDER_RESPONSE=$( curl -s -X POST -H " Content-Type: application/json" \
@@ -193,7 +192,7 @@ if [[ -z "$EXISTING_CONTACT" ]]; then
193192 \" name\" : \" $CONTACT_POINT_NAME \" ,
194193 \" type\" : \" webhook\" ,
195194 \" settings\" : {
196- \" url\" : \" $LAMBDA_URL \" ,
195+ \" url\" : \" $APIGW_URL \" ,
197196 \" httpMethod\" : \" POST\" ,
198197 \" username\" : \" $WEBHOOK_USER \" ,
199198 \" password\" : \" $WEBHOOK_PASSWORD \" ,
@@ -259,7 +258,7 @@ ALERT_PAYLOAD="{
259258 \" annotations\" : {
260259 \" summary\" : \" High JVM Threads\" ,
261260 \" description\" : \" High number of JVM threads detected. Triggering Lambda thread dump.\" ,
262- \" webhookUrl\" : \" $LAMBDA_URL \"
261+ \" webhookUrl\" : \" $APIGW_URL \"
263262 },
264263 \" labels\" : {
265264 \" severity\" : \" critical\" ,
0 commit comments