Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[infra] Remove temp DB public endpoint

Manav Rathi9125ba6c5ac8
diff --git a/infra/copycat-db/src/backup.sh b/infra/copycat-db/src/backup.sh
index d2b29680ee..df0fb27bb1 100755
--- a/infra/copycat-db/src/backup.sh
+++ b/infra/copycat-db/src/backup.sh
@@ -55,6 +55,20 @@ else
fi
scw rdb instance wait "$BACKUP_INSTANCE_ID" timeout=12h
+
+ PUBLIC_ENDPOINT_ID="$(
+ scw rdb endpoint list "$BACKUP_INSTANCE_ID" -o json \
+ | jq -er '
+ map(select(.load_balancer != null))
+ | if length == 1 then .[0].id
+ else error("copycat-db: expected exactly one public endpoint on temp instance")
+ end
+ '
+ )"
+
+ scw rdb endpoint delete endpoint-id="$PUBLIC_ENDPOINT_ID" instance-id="$BACKUP_INSTANCE_ID"
+ scw rdb instance wait "$BACKUP_INSTANCE_ID" timeout=12h
+
DELETE_INSTANCE_ID=$BACKUP_INSTANCE_ID
fi