1. Packages
  2. Azure Classic
  3. API Docs
  4. mysql
  5. VirtualNetworkRule

We recommend using Azure Native.

Azure Classic v5.84.0 published on Tuesday, Jul 16, 2024 by Pulumi

azure.mysql.VirtualNetworkRule

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.84.0 published on Tuesday, Jul 16, 2024 by Pulumi

    Manages a MySQL Virtual Network Rule.

    Note: Azure Database for MySQL Single Server and its sub resources are scheduled for retirement by 2024-09-16 and will migrate to using Azure Database for MySQL Flexible Server: https://go.microsoft.com/fwlink/?linkid=2216041. The azure.mysql.VirtualNetworkRule resource is deprecated and will be removed in v4.0 of the AzureRM Provider.

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
        name: "example-vnet",
        addressSpaces: ["10.7.29.0/29"],
        location: example.location,
        resourceGroupName: example.name,
    });
    const internal = new azure.network.Subnet("internal", {
        name: "internal",
        resourceGroupName: example.name,
        virtualNetworkName: exampleVirtualNetwork.name,
        addressPrefixes: ["10.7.29.0/29"],
        serviceEndpoints: ["Microsoft.Sql"],
    });
    const exampleServer = new azure.mysql.Server("example", {
        name: "example-mysqlserver",
        location: example.location,
        resourceGroupName: example.name,
        administratorLogin: "mysqladminun",
        administratorLoginPassword: "H@Sh1CoR3!",
        skuName: "GP_Gen5_2",
        storageMb: 5120,
        version: "5.7",
        backupRetentionDays: 7,
        geoRedundantBackupEnabled: false,
        sslEnforcementEnabled: true,
    });
    const exampleVirtualNetworkRule = new azure.mysql.VirtualNetworkRule("example", {
        name: "mysql-vnet-rule",
        resourceGroupName: example.name,
        serverName: exampleServer.name,
        subnetId: internal.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_virtual_network = azure.network.VirtualNetwork("example",
        name="example-vnet",
        address_spaces=["10.7.29.0/29"],
        location=example.location,
        resource_group_name=example.name)
    internal = azure.network.Subnet("internal",
        name="internal",
        resource_group_name=example.name,
        virtual_network_name=example_virtual_network.name,
        address_prefixes=["10.7.29.0/29"],
        service_endpoints=["Microsoft.Sql"])
    example_server = azure.mysql.Server("example",
        name="example-mysqlserver",
        location=example.location,
        resource_group_name=example.name,
        administrator_login="mysqladminun",
        administrator_login_password="H@Sh1CoR3!",
        sku_name="GP_Gen5_2",
        storage_mb=5120,
        version="5.7",
        backup_retention_days=7,
        geo_redundant_backup_enabled=False,
        ssl_enforcement_enabled=True)
    example_virtual_network_rule = azure.mysql.VirtualNetworkRule("example",
        name="mysql-vnet-rule",
        resource_group_name=example.name,
        server_name=example_server.name,
        subnet_id=internal.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mysql"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
    			Name: pulumi.String("example-vnet"),
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("10.7.29.0/29"),
    			},
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		internal, err := network.NewSubnet(ctx, "internal", &network.SubnetArgs{
    			Name:               pulumi.String("internal"),
    			ResourceGroupName:  example.Name,
    			VirtualNetworkName: exampleVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("10.7.29.0/29"),
    			},
    			ServiceEndpoints: pulumi.StringArray{
    				pulumi.String("Microsoft.Sql"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		exampleServer, err := mysql.NewServer(ctx, "example", &mysql.ServerArgs{
    			Name:                       pulumi.String("example-mysqlserver"),
    			Location:                   example.Location,
    			ResourceGroupName:          example.Name,
    			AdministratorLogin:         pulumi.String("mysqladminun"),
    			AdministratorLoginPassword: pulumi.String("H@Sh1CoR3!"),
    			SkuName:                    pulumi.String("GP_Gen5_2"),
    			StorageMb:                  pulumi.Int(5120),
    			Version:                    pulumi.String("5.7"),
    			BackupRetentionDays:        pulumi.Int(7),
    			GeoRedundantBackupEnabled:  pulumi.Bool(false),
    			SslEnforcementEnabled:      pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mysql.NewVirtualNetworkRule(ctx, "example", &mysql.VirtualNetworkRuleArgs{
    			Name:              pulumi.String("mysql-vnet-rule"),
    			ResourceGroupName: example.Name,
    			ServerName:        exampleServer.Name,
    			SubnetId:          internal.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
        {
            Name = "example-vnet",
            AddressSpaces = new[]
            {
                "10.7.29.0/29",
            },
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var @internal = new Azure.Network.Subnet("internal", new()
        {
            Name = "internal",
            ResourceGroupName = example.Name,
            VirtualNetworkName = exampleVirtualNetwork.Name,
            AddressPrefixes = new[]
            {
                "10.7.29.0/29",
            },
            ServiceEndpoints = new[]
            {
                "Microsoft.Sql",
            },
        });
    
        var exampleServer = new Azure.MySql.Server("example", new()
        {
            Name = "example-mysqlserver",
            Location = example.Location,
            ResourceGroupName = example.Name,
            AdministratorLogin = "mysqladminun",
            AdministratorLoginPassword = "H@Sh1CoR3!",
            SkuName = "GP_Gen5_2",
            StorageMb = 5120,
            Version = "5.7",
            BackupRetentionDays = 7,
            GeoRedundantBackupEnabled = false,
            SslEnforcementEnabled = true,
        });
    
        var exampleVirtualNetworkRule = new Azure.MySql.VirtualNetworkRule("example", new()
        {
            Name = "mysql-vnet-rule",
            ResourceGroupName = example.Name,
            ServerName = exampleServer.Name,
            SubnetId = @internal.Id,
        });
    
    });
    
    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.mysql.Server;
    import com.pulumi.azure.mysql.ServerArgs;
    import com.pulumi.azure.mysql.VirtualNetworkRule;
    import com.pulumi.azure.mysql.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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
                .name("example-vnet")
                .addressSpaces("10.7.29.0/29")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var internal = new Subnet("internal", SubnetArgs.builder()
                .name("internal")
                .resourceGroupName(example.name())
                .virtualNetworkName(exampleVirtualNetwork.name())
                .addressPrefixes("10.7.29.0/29")
                .serviceEndpoints("Microsoft.Sql")
                .build());
    
            var exampleServer = new Server("exampleServer", ServerArgs.builder()
                .name("example-mysqlserver")
                .location(example.location())
                .resourceGroupName(example.name())
                .administratorLogin("mysqladminun")
                .administratorLoginPassword("H@Sh1CoR3!")
                .skuName("GP_Gen5_2")
                .storageMb(5120)
                .version("5.7")
                .backupRetentionDays(7)
                .geoRedundantBackupEnabled(false)
                .sslEnforcementEnabled(true)
                .build());
    
            var exampleVirtualNetworkRule = new VirtualNetworkRule("exampleVirtualNetworkRule", VirtualNetworkRuleArgs.builder()
                .name("mysql-vnet-rule")
                .resourceGroupName(example.name())
                .serverName(exampleServer.name())
                .subnetId(internal.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        name: example
        properties:
          name: example-vnet
          addressSpaces:
            - 10.7.29.0/29
          location: ${example.location}
          resourceGroupName: ${example.name}
      internal:
        type: azure:network:Subnet
        properties:
          name: internal
          resourceGroupName: ${example.name}
          virtualNetworkName: ${exampleVirtualNetwork.name}
          addressPrefixes:
            - 10.7.29.0/29
          serviceEndpoints:
            - Microsoft.Sql
      exampleServer:
        type: azure:mysql:Server
        name: example
        properties:
          name: example-mysqlserver
          location: ${example.location}
          resourceGroupName: ${example.name}
          administratorLogin: mysqladminun
          administratorLoginPassword: H@Sh1CoR3!
          skuName: GP_Gen5_2
          storageMb: 5120
          version: '5.7'
          backupRetentionDays: 7
          geoRedundantBackupEnabled: false
          sslEnforcementEnabled: true
      exampleVirtualNetworkRule:
        type: azure:mysql:VirtualNetworkRule
        name: example
        properties:
          name: mysql-vnet-rule
          resourceGroupName: ${example.name}
          serverName: ${exampleServer.name}
          subnetId: ${internal.id}
    

    Create VirtualNetworkRule Resource

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

    Constructor syntax

    new VirtualNetworkRule(name: string, args: VirtualNetworkRuleArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualNetworkRule(resource_name: str,
                           args: VirtualNetworkRuleArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def VirtualNetworkRule(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           resource_group_name: Optional[str] = None,
                           server_name: Optional[str] = None,
                           subnet_id: Optional[str] = None,
                           name: Optional[str] = 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:mysql:VirtualNetworkRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.

    Constructor example

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

    var examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule = new Azure.MySql.VirtualNetworkRule("examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule", new()
    {
        ResourceGroupName = "string",
        ServerName = "string",
        SubnetId = "string",
        Name = "string",
    });
    
    example, err := mysql.NewVirtualNetworkRule(ctx, "examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule", &mysql.VirtualNetworkRuleArgs{
    	ResourceGroupName: pulumi.String("string"),
    	ServerName:        pulumi.String("string"),
    	SubnetId:          pulumi.String("string"),
    	Name:              pulumi.String("string"),
    })
    
    var examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule = new VirtualNetworkRule("examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule", VirtualNetworkRuleArgs.builder()
        .resourceGroupName("string")
        .serverName("string")
        .subnetId("string")
        .name("string")
        .build());
    
    examplevirtual_network_rule_resource_resource_from_mysqlvirtual_network_rule = azure.mysql.VirtualNetworkRule("examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule",
        resource_group_name="string",
        server_name="string",
        subnet_id="string",
        name="string")
    
    const examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule = new azure.mysql.VirtualNetworkRule("examplevirtualNetworkRuleResourceResourceFromMysqlvirtualNetworkRule", {
        resourceGroupName: "string",
        serverName: "string",
        subnetId: "string",
        name: "string",
    });
    
    type: azure:mysql:VirtualNetworkRule
    properties:
        name: string
        resourceGroupName: string
        serverName: string
        subnetId: string
    

    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 where the MySQL server resides. Changing this forces a new resource to be created.
    ServerName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    SubnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    Name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    ResourceGroupName string
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    ServerName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    SubnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    Name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName String
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName String
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId String

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name String

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName string
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resource_group_name str
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    server_name str
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnet_id str

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name str

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName String
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName String
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId String

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name String

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen

    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.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VirtualNetworkRule Resource

    Get an existing VirtualNetworkRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VirtualNetworkRuleState, opts?: CustomResourceOptions): VirtualNetworkRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            server_name: Optional[str] = None,
            subnet_id: Optional[str] = None) -> VirtualNetworkRule
    func GetVirtualNetworkRule(ctx *Context, name string, id IDInput, state *VirtualNetworkRuleState, opts ...ResourceOption) (*VirtualNetworkRule, error)
    public static VirtualNetworkRule Get(string name, Input<string> id, VirtualNetworkRuleState? state, CustomResourceOptions? opts = null)
    public static VirtualNetworkRule get(String name, Output<String> id, VirtualNetworkRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    ResourceGroupName string
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    ServerName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    SubnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    Name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    ResourceGroupName string
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    ServerName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    SubnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name String

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName String
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName String
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId String

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name string

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName string
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName string
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId string

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name str

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resource_group_name str
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    server_name str
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnet_id str

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    name String

    The name of the MySQL 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.

    NOTE: name must be between 1-128 characters long and must satisfy all of the requirements below:

    1. Contains only alphanumeric and hyphen characters
    2. Cannot start with a number or hyphen
    3. Cannot end with a hyphen
    resourceGroupName String
    The name of the resource group where the MySQL server resides. Changing this forces a new resource to be created.
    serverName String
    The name of the SQL Server to which this MySQL virtual network rule will be applied to. Changing this forces a new resource to be created.
    subnetId String

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

    NOTE: Due to a bug in the Azure API this resource currently doesn't expose the ignore_missing_vnet_service_endpoint field and defaults this to false. This provider will check during the provisioning of the Virtual Network Rule that the Subnet contains the Service Rule to verify that the Virtual Network Rule can be created.

    Import

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

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

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

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.84.0 published on Tuesday, Jul 16, 2024 by Pulumi