1. Packages
  2. Azure Native
  3. API Docs
  4. dbforpostgresql
  5. SingleServerVirtualNetworkRule
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

azure-native.dbforpostgresql.SingleServerVirtualNetworkRule

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi

A virtual network rule.

Uses Azure REST API version 2017-12-01.

Example Usage

Create or update a virtual network rule

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var singleServerVirtualNetworkRule = new AzureNative.DBforPostgreSQL.SingleServerVirtualNetworkRule("singleServerVirtualNetworkRule", new()
    {
        IgnoreMissingVnetServiceEndpoint = false,
        ResourceGroupName = "TestGroup",
        ServerName = "vnet-test-svr",
        VirtualNetworkRuleName = "vnet-firewall-rule",
        VirtualNetworkSubnetId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet",
    });

});
Copy
package main

import (
	dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := dbforpostgresql.NewSingleServerVirtualNetworkRule(ctx, "singleServerVirtualNetworkRule", &dbforpostgresql.SingleServerVirtualNetworkRuleArgs{
			IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
			ResourceGroupName:                pulumi.String("TestGroup"),
			ServerName:                       pulumi.String("vnet-test-svr"),
			VirtualNetworkRuleName:           pulumi.String("vnet-firewall-rule"),
			VirtualNetworkSubnetId:           pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.SingleServerVirtualNetworkRule;
import com.pulumi.azurenative.dbforpostgresql.SingleServerVirtualNetworkRuleArgs;
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 singleServerVirtualNetworkRule = new SingleServerVirtualNetworkRule("singleServerVirtualNetworkRule", SingleServerVirtualNetworkRuleArgs.builder()
            .ignoreMissingVnetServiceEndpoint(false)
            .resourceGroupName("TestGroup")
            .serverName("vnet-test-svr")
            .virtualNetworkRuleName("vnet-firewall-rule")
            .virtualNetworkSubnetId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const singleServerVirtualNetworkRule = new azure_native.dbforpostgresql.SingleServerVirtualNetworkRule("singleServerVirtualNetworkRule", {
    ignoreMissingVnetServiceEndpoint: false,
    resourceGroupName: "TestGroup",
    serverName: "vnet-test-svr",
    virtualNetworkRuleName: "vnet-firewall-rule",
    virtualNetworkSubnetId: "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

single_server_virtual_network_rule = azure_native.dbforpostgresql.SingleServerVirtualNetworkRule("singleServerVirtualNetworkRule",
    ignore_missing_vnet_service_endpoint=False,
    resource_group_name="TestGroup",
    server_name="vnet-test-svr",
    virtual_network_rule_name="vnet-firewall-rule",
    virtual_network_subnet_id="/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")
Copy
resources:
  singleServerVirtualNetworkRule:
    type: azure-native:dbforpostgresql:SingleServerVirtualNetworkRule
    properties:
      ignoreMissingVnetServiceEndpoint: false
      resourceGroupName: TestGroup
      serverName: vnet-test-svr
      virtualNetworkRuleName: vnet-firewall-rule
      virtualNetworkSubnetId: /subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet
Copy

Create SingleServerVirtualNetworkRule Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SingleServerVirtualNetworkRule(name: string, args: SingleServerVirtualNetworkRuleArgs, opts?: CustomResourceOptions);
@overload
def SingleServerVirtualNetworkRule(resource_name: str,
                                   args: SingleServerVirtualNetworkRuleArgs,
                                   opts: Optional[ResourceOptions] = None)

@overload
def SingleServerVirtualNetworkRule(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   resource_group_name: Optional[str] = None,
                                   server_name: Optional[str] = None,
                                   virtual_network_subnet_id: Optional[str] = None,
                                   ignore_missing_vnet_service_endpoint: Optional[bool] = None,
                                   virtual_network_rule_name: Optional[str] = None)
func NewSingleServerVirtualNetworkRule(ctx *Context, name string, args SingleServerVirtualNetworkRuleArgs, opts ...ResourceOption) (*SingleServerVirtualNetworkRule, error)
public SingleServerVirtualNetworkRule(string name, SingleServerVirtualNetworkRuleArgs args, CustomResourceOptions? opts = null)
public SingleServerVirtualNetworkRule(String name, SingleServerVirtualNetworkRuleArgs args)
public SingleServerVirtualNetworkRule(String name, SingleServerVirtualNetworkRuleArgs args, CustomResourceOptions options)
type: azure-native:dbforpostgresql:SingleServerVirtualNetworkRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SingleServerVirtualNetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SingleServerVirtualNetworkRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SingleServerVirtualNetworkRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SingleServerVirtualNetworkRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SingleServerVirtualNetworkRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var azure_nativeSingleServerVirtualNetworkRuleResource = new AzureNative.DBforPostgreSQL.SingleServerVirtualNetworkRule("azure-nativeSingleServerVirtualNetworkRuleResource", new()
{
    ResourceGroupName = "string",
    ServerName = "string",
    VirtualNetworkSubnetId = "string",
    IgnoreMissingVnetServiceEndpoint = false,
    VirtualNetworkRuleName = "string",
});
Copy
example, err := dbforpostgresql.NewSingleServerVirtualNetworkRule(ctx, "azure-nativeSingleServerVirtualNetworkRuleResource", &dbforpostgresql.SingleServerVirtualNetworkRuleArgs{
	ResourceGroupName:                pulumi.String("string"),
	ServerName:                       pulumi.String("string"),
	VirtualNetworkSubnetId:           pulumi.String("string"),
	IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
	VirtualNetworkRuleName:           pulumi.String("string"),
})
Copy
var azure_nativeSingleServerVirtualNetworkRuleResource = new SingleServerVirtualNetworkRule("azure-nativeSingleServerVirtualNetworkRuleResource", SingleServerVirtualNetworkRuleArgs.builder()
    .resourceGroupName("string")
    .serverName("string")
    .virtualNetworkSubnetId("string")
    .ignoreMissingVnetServiceEndpoint(false)
    .virtualNetworkRuleName("string")
    .build());
Copy
azure_native_single_server_virtual_network_rule_resource = azure_native.dbforpostgresql.SingleServerVirtualNetworkRule("azure-nativeSingleServerVirtualNetworkRuleResource",
    resource_group_name="string",
    server_name="string",
    virtual_network_subnet_id="string",
    ignore_missing_vnet_service_endpoint=False,
    virtual_network_rule_name="string")
Copy
const azure_nativeSingleServerVirtualNetworkRuleResource = new azure_native.dbforpostgresql.SingleServerVirtualNetworkRule("azure-nativeSingleServerVirtualNetworkRuleResource", {
    resourceGroupName: "string",
    serverName: "string",
    virtualNetworkSubnetId: "string",
    ignoreMissingVnetServiceEndpoint: false,
    virtualNetworkRuleName: "string",
});
Copy
type: azure-native:dbforpostgresql:SingleServerVirtualNetworkRule
properties:
    ignoreMissingVnetServiceEndpoint: false
    resourceGroupName: string
    serverName: string
    virtualNetworkRuleName: string
    virtualNetworkSubnetId: string
Copy

SingleServerVirtualNetworkRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The SingleServerVirtualNetworkRule resource accepts the following input properties:

ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
VirtualNetworkSubnetId This property is required. string
The ARM resource id of the virtual network subnet.
IgnoreMissingVnetServiceEndpoint bool
Create firewall rule before the virtual network has vnet service endpoint enabled.
VirtualNetworkRuleName Changes to this property will trigger replacement. string
The name of the virtual network rule.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
VirtualNetworkSubnetId This property is required. string
The ARM resource id of the virtual network subnet.
IgnoreMissingVnetServiceEndpoint bool
Create firewall rule before the virtual network has vnet service endpoint enabled.
VirtualNetworkRuleName Changes to this property will trigger replacement. string
The name of the virtual network rule.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
virtualNetworkSubnetId This property is required. String
The ARM resource id of the virtual network subnet.
ignoreMissingVnetServiceEndpoint Boolean
Create firewall rule before the virtual network has vnet service endpoint enabled.
virtualNetworkRuleName Changes to this property will trigger replacement. String
The name of the virtual network rule.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
serverName
This property is required.
Changes to this property will trigger replacement.
string
The name of the server.
virtualNetworkSubnetId This property is required. string
The ARM resource id of the virtual network subnet.
ignoreMissingVnetServiceEndpoint boolean
Create firewall rule before the virtual network has vnet service endpoint enabled.
virtualNetworkRuleName Changes to this property will trigger replacement. string
The name of the virtual network rule.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
server_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the server.
virtual_network_subnet_id This property is required. str
The ARM resource id of the virtual network subnet.
ignore_missing_vnet_service_endpoint bool
Create firewall rule before the virtual network has vnet service endpoint enabled.
virtual_network_rule_name Changes to this property will trigger replacement. str
The name of the virtual network rule.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serverName
This property is required.
Changes to this property will trigger replacement.
String
The name of the server.
virtualNetworkSubnetId This property is required. String
The ARM resource id of the virtual network subnet.
ignoreMissingVnetServiceEndpoint Boolean
Create firewall rule before the virtual network has vnet service endpoint enabled.
virtualNetworkRuleName Changes to this property will trigger replacement. String
The name of the virtual network rule.

Outputs

All input properties are implicitly available as output properties. Additionally, the SingleServerVirtualNetworkRule resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
State string
Virtual Network Rule State
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
State string
Virtual Network Rule State
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
state String
Virtual Network Rule State
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
state string
Virtual Network Rule State
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
state str
Virtual Network Rule State
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
state String
Virtual Network Rule State
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:dbforpostgresql:SingleServerVirtualNetworkRule vnet-firewall-rule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.2.0 published on Monday, Apr 14, 2025 by Pulumi