com.pulumi.azure.siterecovery.kotlin.HypervNetworkMapping.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.siterecovery.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 [HypervNetworkMapping].
*/
@PulumiTagMarker
public class HypervNetworkMappingResourceBuilder internal constructor() {
public var name: String? = null
public var args: HypervNetworkMappingArgs = HypervNetworkMappingArgs()
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 HypervNetworkMappingArgsBuilder.() -> Unit) {
val builder = HypervNetworkMappingArgsBuilder()
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(): HypervNetworkMapping {
val builtJavaResource =
com.pulumi.azure.siterecovery.HypervNetworkMapping(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return HypervNetworkMapping(builtJavaResource)
}
}
/**
* Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const target = new azure.core.ResourceGroup("target", {
* name: "tfex-network-mapping",
* location: "East US",
* });
* const vault = new azure.recoveryservices.Vault("vault", {
* name: "example-recovery-vault",
* location: target.location,
* resourceGroupName: target.name,
* sku: "Standard",
* });
* const targetVirtualNetwork = new azure.network.VirtualNetwork("target", {
* name: "network",
* resourceGroupName: target.name,
* addressSpaces: ["192.168.2.0/24"],
* location: target.location,
* });
* const recovery_mapping = new azure.siterecovery.HypervNetworkMapping("recovery-mapping", {
* name: "recovery-network-mapping",
* recoveryVaultId: vault.id,
* sourceSystemCenterVirtualMachineManagerName: "my-vmm-server",
* sourceNetworkName: "my-vmm-network",
* targetNetworkId: targetVirtualNetwork.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* target = azure.core.ResourceGroup("target",
* name="tfex-network-mapping",
* location="East US")
* vault = azure.recoveryservices.Vault("vault",
* name="example-recovery-vault",
* location=target.location,
* resource_group_name=target.name,
* sku="Standard")
* target_virtual_network = azure.network.VirtualNetwork("target",
* name="network",
* resource_group_name=target.name,
* address_spaces=["192.168.2.0/24"],
* location=target.location)
* recovery_mapping = azure.siterecovery.HypervNetworkMapping("recovery-mapping",
* name="recovery-network-mapping",
* recovery_vault_id=vault.id,
* source_system_center_virtual_machine_manager_name="my-vmm-server",
* source_network_name="my-vmm-network",
* target_network_id=target_virtual_network.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var target = new Azure.Core.ResourceGroup("target", new()
* {
* Name = "tfex-network-mapping",
* Location = "East US",
* });
* var vault = new Azure.RecoveryServices.Vault("vault", new()
* {
* Name = "example-recovery-vault",
* Location = target.Location,
* ResourceGroupName = target.Name,
* Sku = "Standard",
* });
* var targetVirtualNetwork = new Azure.Network.VirtualNetwork("target", new()
* {
* Name = "network",
* ResourceGroupName = target.Name,
* AddressSpaces = new[]
* {
* "192.168.2.0/24",
* },
* Location = target.Location,
* });
* var recovery_mapping = new Azure.SiteRecovery.HypervNetworkMapping("recovery-mapping", new()
* {
* Name = "recovery-network-mapping",
* RecoveryVaultId = vault.Id,
* SourceSystemCenterVirtualMachineManagerName = "my-vmm-server",
* SourceNetworkName = "my-vmm-network",
* TargetNetworkId = targetVirtualNetwork.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-azure/sdk/v5/go/azure/recoveryservices"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* target, err := core.NewResourceGroup(ctx, "target", &core.ResourceGroupArgs{
* Name: pulumi.String("tfex-network-mapping"),
* Location: pulumi.String("East US"),
* })
* if err != nil {
* return err
* }
* vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
* Name: pulumi.String("example-recovery-vault"),
* Location: target.Location,
* ResourceGroupName: target.Name,
* Sku: pulumi.String("Standard"),
* })
* if err != nil {
* return err
* }
* targetVirtualNetwork, err := network.NewVirtualNetwork(ctx, "target", &network.VirtualNetworkArgs{
* Name: pulumi.String("network"),
* ResourceGroupName: target.Name,
* AddressSpaces: pulumi.StringArray{
* pulumi.String("192.168.2.0/24"),
* },
* Location: target.Location,
* })
* if err != nil {
* return err
* }
* _, err = siterecovery.NewHypervNetworkMapping(ctx, "recovery-mapping", &siterecovery.HypervNetworkMappingArgs{
* Name: pulumi.String("recovery-network-mapping"),
* RecoveryVaultId: vault.ID(),
* SourceSystemCenterVirtualMachineManagerName: pulumi.String("my-vmm-server"),
* SourceNetworkName: pulumi.String("my-vmm-network"),
* TargetNetworkId: targetVirtualNetwork.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.recoveryservices.Vault;
* import com.pulumi.azure.recoveryservices.VaultArgs;
* import com.pulumi.azure.network.VirtualNetwork;
* import com.pulumi.azure.network.VirtualNetworkArgs;
* import com.pulumi.azure.siterecovery.HypervNetworkMapping;
* import com.pulumi.azure.siterecovery.HypervNetworkMappingArgs;
* 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 target = new ResourceGroup("target", ResourceGroupArgs.builder()
* .name("tfex-network-mapping")
* .location("East US")
* .build());
* var vault = new Vault("vault", VaultArgs.builder()
* .name("example-recovery-vault")
* .location(target.location())
* .resourceGroupName(target.name())
* .sku("Standard")
* .build());
* var targetVirtualNetwork = new VirtualNetwork("targetVirtualNetwork", VirtualNetworkArgs.builder()
* .name("network")
* .resourceGroupName(target.name())
* .addressSpaces("192.168.2.0/24")
* .location(target.location())
* .build());
* var recovery_mapping = new HypervNetworkMapping("recovery-mapping", HypervNetworkMappingArgs.builder()
* .name("recovery-network-mapping")
* .recoveryVaultId(vault.id())
* .sourceSystemCenterVirtualMachineManagerName("my-vmm-server")
* .sourceNetworkName("my-vmm-network")
* .targetNetworkId(targetVirtualNetwork.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* target:
* type: azure:core:ResourceGroup
* properties:
* name: tfex-network-mapping
* location: East US
* vault:
* type: azure:recoveryservices:Vault
* properties:
* name: example-recovery-vault
* location: ${target.location}
* resourceGroupName: ${target.name}
* sku: Standard
* targetVirtualNetwork:
* type: azure:network:VirtualNetwork
* name: target
* properties:
* name: network
* resourceGroupName: ${target.name}
* addressSpaces:
* - 192.168.2.0/24
* location: ${target.location}
* recovery-mapping:
* type: azure:siterecovery:HypervNetworkMapping
* properties:
* name: recovery-network-mapping
* recoveryVaultId: ${vault.id}
* sourceSystemCenterVirtualMachineManagerName: my-vmm-server
* sourceNetworkName: my-vmm-network
* targetNetworkId: ${targetVirtualNetwork.id}
* ```
*
* ## Import
* Site Recovery Network Mapping can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:siterecovery/hypervNetworkMapping:HypervNetworkMapping azurerm_site_recovery_hyperv_network_mapping.mymapping /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/primary-fabric-name/replicationNetworks/azureNetwork/replicationNetworkMappings/mapping-name
* ```
*/
public class HypervNetworkMapping internal constructor(
override val javaResource: com.pulumi.azure.siterecovery.HypervNetworkMapping,
) : KotlinCustomResource(javaResource, HypervNetworkMappingMapper) {
/**
* The name of the HyperV network mapping. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
*/
public val recoveryVaultId: Output
get() = javaResource.recoveryVaultId().applyValue({ args0 -> args0 })
/**
* The Name of the primary network. Changing this forces a new resource to be created.
*/
public val sourceNetworkName: Output
get() = javaResource.sourceNetworkName().applyValue({ args0 -> args0 })
/**
* Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
*/
public val sourceSystemCenterVirtualMachineManagerName: Output
get() = javaResource.sourceSystemCenterVirtualMachineManagerName().applyValue({ args0 -> args0 })
/**
* The id of the recovery network. Changing this forces a new resource to be created.
*/
public val targetNetworkId: Output
get() = javaResource.targetNetworkId().applyValue({ args0 -> args0 })
}
public object HypervNetworkMappingMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.siterecovery.HypervNetworkMapping::class == javaResource::class
override fun map(javaResource: Resource): HypervNetworkMapping = HypervNetworkMapping(
javaResource
as com.pulumi.azure.siterecovery.HypervNetworkMapping,
)
}
/**
* @see [HypervNetworkMapping].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [HypervNetworkMapping].
*/
public suspend fun hypervNetworkMapping(
name: String,
block: suspend HypervNetworkMappingResourceBuilder.() -> Unit,
): HypervNetworkMapping {
val builder = HypervNetworkMappingResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [HypervNetworkMapping].
* @param name The _unique_ name of the resulting resource.
*/
public fun hypervNetworkMapping(name: String): HypervNetworkMapping {
val builder = HypervNetworkMappingResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy