VirtualNetworkRuleArgs

data class VirtualNetworkRuleArgs(val ignoreMissingVnetServiceEndpoint: Output<Boolean>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null, val subnetId: Output<String>? = null) : ConvertibleToJava<VirtualNetworkRuleArgs>

Manages a PostgreSQL Virtual Network Rule.

NOTE: PostgreSQL Virtual Network Rules can only be used with SKU Tiers of GeneralPurpose or MemoryOptimized

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.postgresql.Server;
import com.pulumi.azure.postgresql.ServerArgs;
import com.pulumi.azure.postgresql.VirtualNetworkRule;
import com.pulumi.azure.postgresql.VirtualNetworkRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.addressSpaces("10.7.29.0/29")
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.build());
var internal = new Subnet("internal", SubnetArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.7.29.0/29")
.serviceEndpoints("Microsoft.Sql")
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("GP_Gen5_2")
.storageMb(5120)
.backupRetentionDays(7)
.administratorLogin("psqladmin")
.administratorLoginPassword("H@Sh1CoR3!")
.version("9.5")
.sslEnforcementEnabled(true)
.build());
var exampleVirtualNetworkRule = new VirtualNetworkRule("exampleVirtualNetworkRule", VirtualNetworkRuleArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.serverName(exampleServer.name())
.subnetId(internal.id())
.ignoreMissingVnetServiceEndpoint(true)
.build());
}
}

Import

PostgreSQL Virtual Network Rules can be imported using the resource id, e.g.

$ pulumi import azure:postgresql/virtualNetworkRule:VirtualNetworkRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.DBforPostgreSQL/servers/myserver/virtualNetworkRules/vnetrulename

Constructors

Link copied to clipboard
fun VirtualNetworkRuleArgs(ignoreMissingVnetServiceEndpoint: Output<Boolean>? = null, name: Output<String>? = null, resourceGroupName: Output<String>? = null, serverName: Output<String>? = null, subnetId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): VirtualNetworkRuleArgs

Properties

Link copied to clipboard

Should the Virtual Network Rule be created before the Subnet has the Virtual Network Service Endpoint enabled?

Link copied to clipboard
val name: Output<String>? = null

The name of the PostgreSQL virtual network rule. Cannot be empty and must only contain alphanumeric characters and hyphens. Cannot start with a number, and cannot start or end with a hyphen. Changing this forces a new resource to be created.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group where the PostgreSQL server resides. Changing this forces a new resource to be created.

Link copied to clipboard
val serverName: Output<String>? = null

The name of the SQL Server to which this PostgreSQL virtual network rule will be applied to. Changing this forces a new resource to be created.

Link copied to clipboard
val subnetId: Output<String>? = null

The ID of the subnet that the PostgreSQL server will be connected to.