From 3d3c4a396f810c0805f789d83b58c3c0696222e6 Mon Sep 17 00:00:00 2001 From: Alan Moran Date: Mon, 10 Jun 2024 18:18:44 +0200 Subject: [PATCH] Sets security group --- .../assets/multiapps-postgres-security-group.json | 8 ++++++++ .../scripts/deploy-multiapps-controller.sh | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 ci/infrastructure/assets/multiapps-postgres-security-group.json diff --git a/ci/infrastructure/assets/multiapps-postgres-security-group.json b/ci/infrastructure/assets/multiapps-postgres-security-group.json new file mode 100644 index 0000000000..68ef07ed16 --- /dev/null +++ b/ci/infrastructure/assets/multiapps-postgres-security-group.json @@ -0,0 +1,8 @@ + [ + { + "protocol": "tcp", + "destination": "10.0.255.0/24", + "ports": "5524", + "description": "Allow postgres traffic from" + } + ] diff --git a/ci/infrastructure/scripts/deploy-multiapps-controller.sh b/ci/infrastructure/scripts/deploy-multiapps-controller.sh index ef0d9f5034..d7e5f3cff4 100755 --- a/ci/infrastructure/scripts/deploy-multiapps-controller.sh +++ b/ci/infrastructure/scripts/deploy-multiapps-controller.sh @@ -26,6 +26,15 @@ function deploy_multiapps_controller() { cf push -f manifest.yml } +function add_postrgres_security_group() { + pushd ${CI_DIR}/infrastructure/assets + cf create-security-group multiapps-postgres-security-group multiapps-postgres-security-group.json + cf update-security-group multiapps-postgres-security-group multiapps-postgres-security-group.json + cf unbind-security-group multiapps-postgres-security-group ${cf_org} --space ${cf_space} + cf bind-security-group multiapps-postgres-security-group ${cf_org} --space ${cf_space} + popd +} + function cleanup_multiapps_controller() { cf delete -f multiapps-controller cf delete-service -f deploy-service-database @@ -35,4 +44,5 @@ load_bbl_vars cf_login cleanup_multiapps_controller create_postgres_service +add_postrgres_security_group deploy_multiapps_controller