Samples icon indicating copy to clipboard operation
Samples copied to clipboard

Auto-apply firewall changes to CSB-provisioned services to allow access

Open ccheetham opened this issue 2 years ago • 1 comments

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

ccheetham avatar Jan 12 '23 13:01 ccheetham

This particular issue is probably not very relevant anymore, but if you happen to be reading it because you have .NET apps and want to use any of the cloud service brokers (for Azure, AWS or GCP) please add a comment so we can prioritize work in that space!

TimHess avatar May 08 '25 21:05 TimHess