SteeltoeOSS / Samples

Steeltoe samples and reference application collection
https://steeltoe.io/
Apache License 2.0
641 stars 250 forks source link

configure firewall to allow access to test databases #273

Open ccheetham opened 1 year ago

ccheetham commented 1 year ago

Per chat with @bart-vmware ...

Get service guid

# sample
$ GUID=$(cf service myPostgreSqlService | grep '^guid:' | awk '{print $2}')
$ echo GUID
e0d6db7e-83a0-4f77-8951-0faca24486a6

PostgreSQL

$ az postgres server firewall-rule create --name GCP1 --resource-group cotati --server-name csb-postgresql-$GUID --start-ip-address 34.0.0.0 --end-ip-address 35.255.255.255
$ az postgres server firewall-rule create --name GCP2 --resource-group cotati --server-name csb-postgresql-$GUID --start-ip-address 104.0.0.0 --end-ip-address 107.255.255.255

SQL Server

$ az sql server firewall-rule create --name GCP1 --resource-group cotati --server csb-azsql-$GUID --start-ip-address 34.0.0.0 --end-ip-address 35.255.255.255
$ az sql server firewall-rule create --name GCP2 --resource-group cotati --server csb-azsql-$GUID --start-ip-address 104.0.0.0 --end-ip-address 107.255.255.255

CosmosDB

$ az cosmosdb update --resource-group cotati --name csb$GUID --ip-range-filter 34.0.0.0/7,104.0.0.0/6

MongoDB

$ az cosmosdb update --resource-group cotati --name csb$GUID --ip-range-filter 34.0.0.0/7,104.0.0.0/6