Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Create virtual network peerings using Pulumi in Golang and CosmosDb config
peerings, err := getRegionPeerings(params)
for _, p := range peerings {
_, err = network.NewVirtualNetworkPeering(ctx, p.Region+"-to-"+p.Name+"-vnet", &network.VirtualNetworkPeeringArgs{
Name: pulumi.StringPtr("to-" + p.Region + "-vnet-" + p.Name),
ResourceGroupName: pulumi.String("ctus-assets"),
VirtualNetworkName: pulumi.String(p.Region + "-vnet"),
RemoteVirtualNetwork: network.SubResourcePtrInput(&network.SubResourceArgs{
Id: pulumi.StringPtr(fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", p.SubscriptionID, p.Name, p.Region+"-vnet")),
AllowVirtualNetworkAccess: pulumi.BoolPtr(true),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment