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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [VirtualHubIp].
 */
@PulumiTagMarker
public class VirtualHubIpResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: VirtualHubIpArgs = VirtualHubIpArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend VirtualHubIpArgsBuilder.() -> Unit) {
        val builder = VirtualHubIpArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): VirtualHubIp {
        val builtJavaResource = com.pulumi.azure.network.VirtualHubIp(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return VirtualHubIp(builtJavaResource)
    }
}

/**
 * Manages a Virtual Hub IP. This resource is also known as a Route Server.
 * > **NOTE** Virtual Hub IP only supports Standard Virtual Hub without Virtual Wan.
 * ## 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 exampleVirtualHub = new azure.network.VirtualHub("example", {
 *     name: "example-vhub",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: "Standard",
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "example-pip",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 *     sku: "Standard",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     addressSpaces: ["10.5.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "RouteServerSubnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.5.1.0/24"],
 * });
 * const exampleVirtualHubIp = new azure.network.VirtualHubIp("example", {
 *     name: "example-vhubipconfig",
 *     virtualHubId: exampleVirtualHub.id,
 *     privateIpAddress: "10.5.1.18",
 *     privateIpAllocationMethod: "Static",
 *     publicIpAddressId: examplePublicIp.id,
 *     subnetId: exampleSubnet.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_virtual_hub = azure.network.VirtualHub("example",
 *     name="example-vhub",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku="Standard")
 * example_public_ip = azure.network.PublicIp("example",
 *     name="example-pip",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     allocation_method="Static",
 *     sku="Standard")
 * example_virtual_network = azure.network.VirtualNetwork("example",
 *     name="example-vnet",
 *     address_spaces=["10.5.0.0/16"],
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_subnet = azure.network.Subnet("example",
 *     name="RouteServerSubnet",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_virtual_network.name,
 *     address_prefixes=["10.5.1.0/24"])
 * example_virtual_hub_ip = azure.network.VirtualHubIp("example",
 *     name="example-vhubipconfig",
 *     virtual_hub_id=example_virtual_hub.id,
 *     private_ip_address="10.5.1.18",
 *     private_ip_allocation_method="Static",
 *     public_ip_address_id=example_public_ip.id,
 *     subnet_id=example_subnet.id)
 * ```
 * ```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 exampleVirtualHub = new Azure.Network.VirtualHub("example", new()
 *     {
 *         Name = "example-vhub",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Sku = "Standard",
 *     });
 *     var examplePublicIp = new Azure.Network.PublicIp("example", new()
 *     {
 *         Name = "example-pip",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AllocationMethod = "Static",
 *         Sku = "Standard",
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-vnet",
 *         AddressSpaces = new[]
 *         {
 *             "10.5.0.0/16",
 *         },
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleSubnet = new Azure.Network.Subnet("example", new()
 *     {
 *         Name = "RouteServerSubnet",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = exampleVirtualNetwork.Name,
 *         AddressPrefixes = new[]
 *         {
 *             "10.5.1.0/24",
 *         },
 *     });
 *     var exampleVirtualHubIp = new Azure.Network.VirtualHubIp("example", new()
 *     {
 *         Name = "example-vhubipconfig",
 *         VirtualHubId = exampleVirtualHub.Id,
 *         PrivateIpAddress = "10.5.1.18",
 *         PrivateIpAllocationMethod = "Static",
 *         PublicIpAddressId = examplePublicIp.Id,
 *         SubnetId = exampleSubnet.Id,
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		exampleVirtualHub, err := network.NewVirtualHub(ctx, "example", &network.VirtualHubArgs{
 * 			Name:              pulumi.String("example-vhub"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku:               pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
 * 			Name:              pulumi.String("example-pip"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AllocationMethod:  pulumi.String("Static"),
 * 			Sku:               pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name: pulumi.String("example-vnet"),
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.5.0.0/16"),
 * 			},
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
 * 			Name:               pulumi.String("RouteServerSubnet"),
 * 			ResourceGroupName:  example.Name,
 * 			VirtualNetworkName: exampleVirtualNetwork.Name,
 * 			AddressPrefixes: pulumi.StringArray{
 * 				pulumi.String("10.5.1.0/24"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewVirtualHubIp(ctx, "example", &network.VirtualHubIpArgs{
 * 			Name:                      pulumi.String("example-vhubipconfig"),
 * 			VirtualHubId:              exampleVirtualHub.ID(),
 * 			PrivateIpAddress:          pulumi.String("10.5.1.18"),
 * 			PrivateIpAllocationMethod: pulumi.String("Static"),
 * 			PublicIpAddressId:         examplePublicIp.ID(),
 * 			SubnetId:                  exampleSubnet.ID(),
 * 		})
 * 		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.VirtualHub;
 * import com.pulumi.azure.network.VirtualHubArgs;
 * import com.pulumi.azure.network.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * 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.network.VirtualHubIp;
 * import com.pulumi.azure.network.VirtualHubIpArgs;
 * 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 exampleVirtualHub = new VirtualHub("exampleVirtualHub", VirtualHubArgs.builder()
 *             .name("example-vhub")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sku("Standard")
 *             .build());
 *         var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
 *             .name("example-pip")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .allocationMethod("Static")
 *             .sku("Standard")
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-vnet")
 *             .addressSpaces("10.5.0.0/16")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("RouteServerSubnet")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.5.1.0/24")
 *             .build());
 *         var exampleVirtualHubIp = new VirtualHubIp("exampleVirtualHubIp", VirtualHubIpArgs.builder()
 *             .name("example-vhubipconfig")
 *             .virtualHubId(exampleVirtualHub.id())
 *             .privateIpAddress("10.5.1.18")
 *             .privateIpAllocationMethod("Static")
 *             .publicIpAddressId(examplePublicIp.id())
 *             .subnetId(exampleSubnet.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVirtualHub:
 *     type: azure:network:VirtualHub
 *     name: example
 *     properties:
 *       name: example-vhub
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sku: Standard
 *   examplePublicIp:
 *     type: azure:network:PublicIp
 *     name: example
 *     properties:
 *       name: example-pip
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       allocationMethod: Static
 *       sku: Standard
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-vnet
 *       addressSpaces:
 *         - 10.5.0.0/16
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleSubnet:
 *     type: azure:network:Subnet
 *     name: example
 *     properties:
 *       name: RouteServerSubnet
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${exampleVirtualNetwork.name}
 *       addressPrefixes:
 *         - 10.5.1.0/24
 *   exampleVirtualHubIp:
 *     type: azure:network:VirtualHubIp
 *     name: example
 *     properties:
 *       name: example-vhubipconfig
 *       virtualHubId: ${exampleVirtualHub.id}
 *       privateIpAddress: 10.5.1.18
 *       privateIpAllocationMethod: Static
 *       publicIpAddressId: ${examplePublicIp.id}
 *       subnetId: ${exampleSubnet.id}
 * ```
 * 
 * ## Import
 * Virtual Hub IPs can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/virtualHubIp:VirtualHubIp example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/virtualHubs/virtualHub1/ipConfigurations/ipConfig1
 * ```
 */
public class VirtualHubIp internal constructor(
    override val javaResource: com.pulumi.azure.network.VirtualHubIp,
) : KotlinCustomResource(javaResource, VirtualHubIpMapper) {
    /**
     * The name which should be used for this Virtual Hub IP. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The private IP address of the IP configuration.
     */
    public val privateIpAddress: Output?
        get() = javaResource.privateIpAddress().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The private IP address allocation method. Possible values are `Static` and `Dynamic` is allowed. Defaults to `Dynamic`.
     */
    public val privateIpAllocationMethod: Output?
        get() = javaResource.privateIpAllocationMethod().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Public IP Address. This option is required since September 1st 2021. Changing this forces a new resource to be created.
     */
    public val publicIpAddressId: Output
        get() = javaResource.publicIpAddressId().applyValue({ args0 -> args0 })

    /**
     * The ID of the Subnet that the IP will reside. Changing this forces a new resource to be created.
     */
    public val subnetId: Output
        get() = javaResource.subnetId().applyValue({ args0 -> args0 })

    /**
     * The ID of the Virtual Hub within which this IP configuration should be created. Changing this forces a new resource to be created.
     */
    public val virtualHubId: Output
        get() = javaResource.virtualHubId().applyValue({ args0 -> args0 })
}

public object VirtualHubIpMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.network.VirtualHubIp::class == javaResource::class

    override fun map(javaResource: Resource): VirtualHubIp = VirtualHubIp(
        javaResource as
            com.pulumi.azure.network.VirtualHubIp,
    )
}

/**
 * @see [VirtualHubIp].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [VirtualHubIp].
 */
public suspend fun virtualHubIp(
    name: String,
    block: suspend VirtualHubIpResourceBuilder.() -> Unit,
): VirtualHubIp {
    val builder = VirtualHubIpResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [VirtualHubIp].
 * @param name The _unique_ name of the resulting resource.
 */
public fun virtualHubIp(name: String): VirtualHubIp {
    val builder = VirtualHubIpResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy