All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.network.kotlin.VirtualNetworkDnsServersArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.VirtualNetworkDnsServersArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * ## Example Usage
 * 
 * ```typescript
 * 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.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     subnets: [{
 *         name: "subnet1",
 *         addressPrefix: "10.0.1.0/24",
 *     }],
 * });
 * const exampleVirtualNetworkDnsServers = new azure.network.VirtualNetworkDnsServers("example", {
 *     virtualNetworkId: exampleVirtualNetwork.id,
 *     dnsServers: [
 *         "10.7.7.2",
 *         "10.7.7.7",
 *         "10.7.7.1",
 *     ],
 * });
 * ```
 * ```python
 * 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.0.0.0/16"],
 *     location=example.location,
 *     resource_group_name=example.name,
 *     subnets=[azure.network.VirtualNetworkSubnetArgs(
 *         name="subnet1",
 *         address_prefix="10.0.1.0/24",
 *     )])
 * example_virtual_network_dns_servers = azure.network.VirtualNetworkDnsServers("example",
 *     virtual_network_id=example_virtual_network.id,
 *     dns_servers=[
 *         "10.7.7.2",
 *         "10.7.7.7",
 *         "10.7.7.1",
 *     ])
 * ```
 * ```csharp
 * 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.0.0.0/16",
 *         },
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Subnets = new[]
 *         {
 *             new Azure.Network.Inputs.VirtualNetworkSubnetArgs
 *             {
 *                 Name = "subnet1",
 *                 AddressPrefix = "10.0.1.0/24",
 *             },
 *         },
 *     });
 *     var exampleVirtualNetworkDnsServers = new Azure.Network.VirtualNetworkDnsServers("example", new()
 *     {
 *         VirtualNetworkId = exampleVirtualNetwork.Id,
 *         DnsServers = new[]
 *         {
 *             "10.7.7.2",
 *             "10.7.7.7",
 *             "10.7.7.1",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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.0.0.0/16"),
 * 			},
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Subnets: network.VirtualNetworkSubnetArray{
 * 				&network.VirtualNetworkSubnetArgs{
 * 					Name:          pulumi.String("subnet1"),
 * 					AddressPrefix: pulumi.String("10.0.1.0/24"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualNetworkDnsServers(ctx, "example", &network.VirtualNetworkDnsServersArgs{
 * 			VirtualNetworkId: exampleVirtualNetwork.ID(),
 * 			DnsServers: pulumi.StringArray{
 * 				pulumi.String("10.7.7.2"),
 * 				pulumi.String("10.7.7.7"),
 * 				pulumi.String("10.7.7.1"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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.inputs.VirtualNetworkSubnetArgs;
 * import com.pulumi.azure.network.VirtualNetworkDnsServers;
 * import com.pulumi.azure.network.VirtualNetworkDnsServersArgs;
 * 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.0.0.0/16")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .subnets(VirtualNetworkSubnetArgs.builder()
 *                 .name("subnet1")
 *                 .addressPrefix("10.0.1.0/24")
 *                 .build())
 *             .build());
 *         var exampleVirtualNetworkDnsServers = new VirtualNetworkDnsServers("exampleVirtualNetworkDnsServers", VirtualNetworkDnsServersArgs.builder()
 *             .virtualNetworkId(exampleVirtualNetwork.id())
 *             .dnsServers(
 *                 "10.7.7.2",
 *                 "10.7.7.7",
 *                 "10.7.7.1")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * 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.0.0.0/16
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       subnets:
 *         - name: subnet1
 *           addressPrefix: 10.0.1.0/24
 *   exampleVirtualNetworkDnsServers:
 *     type: azure:network:VirtualNetworkDnsServers
 *     name: example
 *     properties:
 *       virtualNetworkId: ${exampleVirtualNetwork.id}
 *       dnsServers:
 *         - 10.7.7.2
 *         - 10.7.7.7
 *         - 10.7.7.1
 * ```
 * 
 * ## Import
 * Virtual Network DNS Servers can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/virtualNetworkDnsServers:VirtualNetworkDnsServers exampleNetwork /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1/dnsServers/default
 * ```
 * @property dnsServers List of IP addresses of DNS servers
 * @property virtualNetworkId The ID of the Virtual Network that should be linked to the DNS Zone. Changing this forces a new resource to be created.
 */
public data class VirtualNetworkDnsServersArgs(
    public val dnsServers: Output>? = null,
    public val virtualNetworkId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.VirtualNetworkDnsServersArgs =
        com.pulumi.azure.network.VirtualNetworkDnsServersArgs.builder()
            .dnsServers(dnsServers?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .virtualNetworkId(virtualNetworkId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VirtualNetworkDnsServersArgs].
 */
@PulumiTagMarker
public class VirtualNetworkDnsServersArgsBuilder internal constructor() {
    private var dnsServers: Output>? = null

    private var virtualNetworkId: Output? = null

    /**
     * @param value List of IP addresses of DNS servers
     */
    @JvmName("qumqdnprdsvtkhmn")
    public suspend fun dnsServers(`value`: Output>) {
        this.dnsServers = value
    }

    @JvmName("brbrbvenkrtmanrv")
    public suspend fun dnsServers(vararg values: Output) {
        this.dnsServers = Output.all(values.asList())
    }

    /**
     * @param values List of IP addresses of DNS servers
     */
    @JvmName("hehgdqlprvhfnqqs")
    public suspend fun dnsServers(values: List>) {
        this.dnsServers = Output.all(values)
    }

    /**
     * @param value The ID of the Virtual Network that should be linked to the DNS Zone. Changing this forces a new resource to be created.
     */
    @JvmName("efgxsaafytpatbpm")
    public suspend fun virtualNetworkId(`value`: Output) {
        this.virtualNetworkId = value
    }

    /**
     * @param value List of IP addresses of DNS servers
     */
    @JvmName("awsmsndginvlaabj")
    public suspend fun dnsServers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dnsServers = mapped
    }

    /**
     * @param values List of IP addresses of DNS servers
     */
    @JvmName("yuxnduhcgksdpfqm")
    public suspend fun dnsServers(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dnsServers = mapped
    }

    /**
     * @param value The ID of the Virtual Network that should be linked to the DNS Zone. Changing this forces a new resource to be created.
     */
    @JvmName("kfccxetmehggpshd")
    public suspend fun virtualNetworkId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualNetworkId = mapped
    }

    internal fun build(): VirtualNetworkDnsServersArgs = VirtualNetworkDnsServersArgs(
        dnsServers = dnsServers,
        virtualNetworkId = virtualNetworkId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy