Creating an Azure vNet Peering Connection
Since security is vital in Viridian Dedicated, your clusters are installed within a private virtual network and cannot be accessed unless you choose Public Access on cluster creation. So to connect private Azure Hazelcast Clusters, you need to establish a vNet peering connection between your network and Hazelcast Cluster network.
Before you Begin
Download the Hazelcast Viridian CLI from Github.
Download the Azure CLI and make sure you have the correct permissions.
Creating a Peering Connection
-
Create the peering connection.
hzcloud azure-peering create \ --cluster-id={YOUR_CLUSTER_ID} \ --tenant-id={YOUR_TENANT_ID} \ --subscription-id={YOUR_SUBSCRIPTION_ID} \ --resource-group={YOUR_RESOURCE_GROUP} \ --vnet={YOUR_VNET_NAME}
Make sure to replace the following placeholders:
-
YOUR_CLUSTER_ID
with the ID of your cluster.To get your cluster ID, use the
hzcloud enterprise-cluster list
command of the Hazelcast Viridian CLI. -
YOUR_TENANT_ID
with the ID of your tenant which contains your subscription.To get your tenant ID, use the
az account list
command of the Azure CLI. -
YOUR_SUBSCRIPTION_ID
with the ID of your subscription which contains your resource group.To get your subscription ID, use the
az account list
command of the Azure CLI. -
YOUR_RESOURCE_GROUP
with the Name of your resource group which contains your vNet.To get your resource group name, use the
az network vnet list
command of the Azure CLI. -
YOUR_VNET_NAME
with the name of your Virtual Network that you will make vNet peering.To get your vnet name, use the
az network vnet list
command of the Azure CLI.This command will create a service principal on your account and assign the
Network Contributor
role to it. Then, it will create peering for both sides. This command may take up to 5 minutes to finish.The CIDR of your Viridian Dedicated cluster and the CIDR of your VPC should not be overlapped otherwise, it will fail.
-
-
Check for active peerings from the Peerings tab after you select your Virtual Network on Azure for your side of peering. You can filter by its peer, which will be
cl-<CLUSTER_ID>
. On the example below, it iscl53949
because the cluster ID was53949
Listing Peering Connections
You can list Azure vNet peerings from the Hazelcast Viridian console by going to Settings > vNet. You can check where the connection established by checking the name of the vNet with it’s CIDR from this list.
Also, you can use the Go SDK or Hazelcast Viridian CLI for listing vNet peerings as shown below.
hzcloud azure-peering list --cluster-id={YOUR_CLUSTER_ID}
client, _, _ := hazelcastcloud.New()
peerings, _, _ := client.AzurePeering.List(context.Background(), &models.ListAzurePeeringsInput{
ClusterId: "YOUR_CLUSTER_ID",
},
)
for _,peer := range *peerings {
fmt.Println(peer.Id)
fmt.Println(peer.VpcId)
fmt.Println(peer.VpcCidr)
}