1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. VirtualNetworkRule
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.33.0 published on Friday, Mar 22, 2024 by Pulumi

azure-native.sql.VirtualNetworkRule

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.33.0 published on Friday, Mar 22, 2024 by Pulumi

    A virtual network rule. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.

    Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.

    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 virtualNetworkRule = new AzureNative.Sql.VirtualNetworkRule("virtualNetworkRule", new()
        {
            IgnoreMissingVnetServiceEndpoint = false,
            ResourceGroupName = "Default",
            ServerName = "vnet-test-svr",
            VirtualNetworkRuleName = "vnet-firewall-rule",
            VirtualNetworkSubnetId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewVirtualNetworkRule(ctx, "virtualNetworkRule", &sql.VirtualNetworkRuleArgs{
    			IgnoreMissingVnetServiceEndpoint: pulumi.Bool(false),
    			ResourceGroupName:                pulumi.String("Default"),
    			ServerName:                       pulumi.String("vnet-test-svr"),
    			VirtualNetworkRuleName:           pulumi.String("vnet-firewall-rule"),
    			VirtualNetworkSubnetId:           pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.VirtualNetworkRule;
    import com.pulumi.azurenative.sql.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 virtualNetworkRule = new VirtualNetworkRule("virtualNetworkRule", VirtualNetworkRuleArgs.builder()        
                .ignoreMissingVnetServiceEndpoint(false)
                .resourceGroupName("Default")
                .serverName("vnet-test-svr")
                .virtualNetworkRuleName("vnet-firewall-rule")
                .virtualNetworkSubnetId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_network_rule = azure_native.sql.VirtualNetworkRule("virtualNetworkRule",
        ignore_missing_vnet_service_endpoint=False,
        resource_group_name="Default",
        server_name="vnet-test-svr",
        virtual_network_rule_name="vnet-firewall-rule",
        virtual_network_subnet_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualNetworkRule = new azure_native.sql.VirtualNetworkRule("virtualNetworkRule", {
        ignoreMissingVnetServiceEndpoint: false,
        resourceGroupName: "Default",
        serverName: "vnet-test-svr",
        virtualNetworkRuleName: "vnet-firewall-rule",
        virtualNetworkSubnetId: "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet",
    });
    
    resources:
      virtualNetworkRule:
        type: azure-native:sql:VirtualNetworkRule
        properties:
          ignoreMissingVnetServiceEndpoint: false
          resourceGroupName: Default
          serverName: vnet-test-svr
          virtualNetworkRuleName: vnet-firewall-rule
          virtualNetworkSubnetId: /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet
    

    Create VirtualNetworkRule Resource

    new VirtualNetworkRule(name: string, args: VirtualNetworkRuleArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualNetworkRule(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           ignore_missing_vnet_service_endpoint: Optional[bool] = None,
                           resource_group_name: Optional[str] = None,
                           server_name: Optional[str] = None,
                           virtual_network_rule_name: Optional[str] = None,
                           virtual_network_subnet_id: Optional[str] = None)
    @overload
    def VirtualNetworkRule(resource_name: str,
                           args: VirtualNetworkRuleArgs,
                           opts: Optional[ResourceOptions] = None)
    func NewVirtualNetworkRule(ctx *Context, name string, args VirtualNetworkRuleArgs, opts ...ResourceOption) (*VirtualNetworkRule, error)
    public VirtualNetworkRule(string name, VirtualNetworkRuleArgs args, CustomResourceOptions? opts = null)
    public VirtualNetworkRule(String name, VirtualNetworkRuleArgs args)
    public VirtualNetworkRule(String name, VirtualNetworkRuleArgs args, CustomResourceOptions options)
    
    type: azure-native:sql:VirtualNetworkRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args VirtualNetworkRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VirtualNetworkRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VirtualNetworkRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VirtualNetworkRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VirtualNetworkRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    VirtualNetworkRule Resource Properties

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

    Inputs

    The VirtualNetworkRule resource accepts the following input properties:

    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    VirtualNetworkSubnetId 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 string
    The name of the virtual network rule.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    ServerName string
    The name of the server.
    VirtualNetworkSubnetId 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 string
    The name of the virtual network rule.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    virtualNetworkSubnetId 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 String
    The name of the virtual network rule.
    resourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName string
    The name of the server.
    virtualNetworkSubnetId 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 string
    The name of the virtual network rule.
    resource_group_name str
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    server_name str
    The name of the server.
    virtual_network_subnet_id 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 str
    The name of the virtual network rule.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    serverName String
    The name of the server.
    virtualNetworkSubnetId 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 String
    The name of the virtual network rule.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Resource name.
    State string
    Virtual Network Rule State
    Type string
    Resource type.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Resource name.
    State string
    Virtual Network Rule State
    Type string
    Resource type.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Resource name.
    state String
    Virtual Network Rule State
    type String
    Resource type.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Resource name.
    state string
    Virtual Network Rule State
    type string
    Resource type.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Resource name.
    state str
    Virtual Network Rule State
    type str
    Resource type.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Resource name.
    state String
    Virtual Network Rule State
    type String
    Resource type.

    Import

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

    $ pulumi import azure-native:sql:VirtualNetworkRule vnet-firewall-rule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName} 
    

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.33.0 published on Friday, Mar 22, 2024 by Pulumi