1. Packages
  2. Azure Classic
  3. API Docs
  4. mssql
  5. ServerDnsAlias

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.mssql.ServerDnsAlias

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Manages a MS SQL Server DNS Alias.

    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 exampleServer = new azure.mssql.Server("example", {
        name: "example-sqlserver",
        resourceGroupName: example.name,
        location: example.location,
        version: "12.0",
        administratorLogin: "missadministrator",
        administratorLoginPassword: "AdminPassword123!",
    });
    const exampleServerDnsAlias = new azure.mssql.ServerDnsAlias("example", {
        name: "example-dns-alias",
        mssqlServerId: exampleServer.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    example_server = azure.mssql.Server("example",
        name="example-sqlserver",
        resource_group_name=example.name,
        location=example.location,
        version="12.0",
        administrator_login="missadministrator",
        administrator_login_password="AdminPassword123!")
    example_server_dns_alias = azure.mssql.ServerDnsAlias("example",
        name="example-dns-alias",
        mssql_server_id=example_server.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mssql"
    	"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
    		}
    		exampleServer, err := mssql.NewServer(ctx, "example", &mssql.ServerArgs{
    			Name:                       pulumi.String("example-sqlserver"),
    			ResourceGroupName:          example.Name,
    			Location:                   example.Location,
    			Version:                    pulumi.String("12.0"),
    			AdministratorLogin:         pulumi.String("missadministrator"),
    			AdministratorLoginPassword: pulumi.String("AdminPassword123!"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mssql.NewServerDnsAlias(ctx, "example", &mssql.ServerDnsAliasArgs{
    			Name:          pulumi.String("example-dns-alias"),
    			MssqlServerId: exampleServer.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 exampleServer = new Azure.MSSql.Server("example", new()
        {
            Name = "example-sqlserver",
            ResourceGroupName = example.Name,
            Location = example.Location,
            Version = "12.0",
            AdministratorLogin = "missadministrator",
            AdministratorLoginPassword = "AdminPassword123!",
        });
    
        var exampleServerDnsAlias = new Azure.MSSql.ServerDnsAlias("example", new()
        {
            Name = "example-dns-alias",
            MssqlServerId = exampleServer.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.mssql.Server;
    import com.pulumi.azure.mssql.ServerArgs;
    import com.pulumi.azure.mssql.ServerDnsAlias;
    import com.pulumi.azure.mssql.ServerDnsAliasArgs;
    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 exampleServer = new Server("exampleServer", ServerArgs.builder()        
                .name("example-sqlserver")
                .resourceGroupName(example.name())
                .location(example.location())
                .version("12.0")
                .administratorLogin("missadministrator")
                .administratorLoginPassword("AdminPassword123!")
                .build());
    
            var exampleServerDnsAlias = new ServerDnsAlias("exampleServerDnsAlias", ServerDnsAliasArgs.builder()        
                .name("example-dns-alias")
                .mssqlServerId(exampleServer.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      exampleServer:
        type: azure:mssql:Server
        name: example
        properties:
          name: example-sqlserver
          resourceGroupName: ${example.name}
          location: ${example.location}
          version: '12.0'
          administratorLogin: missadministrator
          administratorLoginPassword: AdminPassword123!
      exampleServerDnsAlias:
        type: azure:mssql:ServerDnsAlias
        name: example
        properties:
          name: example-dns-alias
          mssqlServerId: ${exampleServer.id}
    

    Create ServerDnsAlias Resource

    new ServerDnsAlias(name: string, args: ServerDnsAliasArgs, opts?: CustomResourceOptions);
    @overload
    def ServerDnsAlias(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       mssql_server_id: Optional[str] = None,
                       name: Optional[str] = None)
    @overload
    def ServerDnsAlias(resource_name: str,
                       args: ServerDnsAliasArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewServerDnsAlias(ctx *Context, name string, args ServerDnsAliasArgs, opts ...ResourceOption) (*ServerDnsAlias, error)
    public ServerDnsAlias(string name, ServerDnsAliasArgs args, CustomResourceOptions? opts = null)
    public ServerDnsAlias(String name, ServerDnsAliasArgs args)
    public ServerDnsAlias(String name, ServerDnsAliasArgs args, CustomResourceOptions options)
    
    type: azure:mssql:ServerDnsAlias
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ServerDnsAliasArgs
    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 ServerDnsAliasArgs
    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 ServerDnsAliasArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServerDnsAliasArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServerDnsAliasArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ServerDnsAlias 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 ServerDnsAlias resource accepts the following input properties:

    MssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    Name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    MssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    Name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    mssqlServerId String
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name String
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    mssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    mssql_server_id str
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name str
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    mssqlServerId String
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name String
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.

    Outputs

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

    DnsRecord string
    The fully qualified DNS record for alias.
    Id string
    The provider-assigned unique ID for this managed resource.
    DnsRecord string
    The fully qualified DNS record for alias.
    Id string
    The provider-assigned unique ID for this managed resource.
    dnsRecord String
    The fully qualified DNS record for alias.
    id String
    The provider-assigned unique ID for this managed resource.
    dnsRecord string
    The fully qualified DNS record for alias.
    id string
    The provider-assigned unique ID for this managed resource.
    dns_record str
    The fully qualified DNS record for alias.
    id str
    The provider-assigned unique ID for this managed resource.
    dnsRecord String
    The fully qualified DNS record for alias.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ServerDnsAlias Resource

    Get an existing ServerDnsAlias 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?: ServerDnsAliasState, opts?: CustomResourceOptions): ServerDnsAlias
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dns_record: Optional[str] = None,
            mssql_server_id: Optional[str] = None,
            name: Optional[str] = None) -> ServerDnsAlias
    func GetServerDnsAlias(ctx *Context, name string, id IDInput, state *ServerDnsAliasState, opts ...ResourceOption) (*ServerDnsAlias, error)
    public static ServerDnsAlias Get(string name, Input<string> id, ServerDnsAliasState? state, CustomResourceOptions? opts = null)
    public static ServerDnsAlias get(String name, Output<String> id, ServerDnsAliasState 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:
    DnsRecord string
    The fully qualified DNS record for alias.
    MssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    Name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    DnsRecord string
    The fully qualified DNS record for alias.
    MssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    Name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    dnsRecord String
    The fully qualified DNS record for alias.
    mssqlServerId String
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name String
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    dnsRecord string
    The fully qualified DNS record for alias.
    mssqlServerId string
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name string
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    dns_record str
    The fully qualified DNS record for alias.
    mssql_server_id str
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name str
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.
    dnsRecord String
    The fully qualified DNS record for alias.
    mssqlServerId String
    The ID of the mssql server. Changing this forces a new MSSQL Server DNS Alias to be created.
    name String
    The name which should be used for this MSSQL Server DNS Alias. Changing this forces a new MSSQL Server DNS Alias to be created.

    Import

    MSSQL Server DNS Aliass can be imported using the resource id, e.g.

    $ pulumi import azure:mssql/serverDnsAlias:ServerDnsAlias example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/dnsAliases/default
    

    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.70.0 published on Wednesday, Mar 27, 2024 by Pulumi