![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.siterecovery.kotlin.Fabric.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 [Fabric].
*/
@PulumiTagMarker
public class FabricResourceBuilder internal constructor() {
public var name: String? = null
public var args: FabricArgs = FabricArgs()
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 FabricArgsBuilder.() -> Unit) {
val builder = FabricArgsBuilder()
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(): Fabric {
val builtJavaResource = com.pulumi.azure.siterecovery.Fabric(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Fabric(builtJavaResource)
}
}
/**
* Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const primary = new azure.core.ResourceGroup("primary", {
* name: "tfex-network-mapping-primary",
* location: "West US",
* });
* const secondary = new azure.core.ResourceGroup("secondary", {
* name: "tfex-network-mapping-secondary",
* location: "East US",
* });
* const vault = new azure.recoveryservices.Vault("vault", {
* name: "example-recovery-vault",
* location: secondary.location,
* resourceGroupName: secondary.name,
* sku: "Standard",
* });
* const fabric = new azure.siterecovery.Fabric("fabric", {
* name: "primary-fabric",
* resourceGroupName: secondary.name,
* recoveryVaultName: vault.name,
* location: primary.location,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* primary = azure.core.ResourceGroup("primary",
* name="tfex-network-mapping-primary",
* location="West US")
* secondary = azure.core.ResourceGroup("secondary",
* name="tfex-network-mapping-secondary",
* location="East US")
* vault = azure.recoveryservices.Vault("vault",
* name="example-recovery-vault",
* location=secondary.location,
* resource_group_name=secondary.name,
* sku="Standard")
* fabric = azure.siterecovery.Fabric("fabric",
* name="primary-fabric",
* resource_group_name=secondary.name,
* recovery_vault_name=vault.name,
* location=primary.location)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var primary = new Azure.Core.ResourceGroup("primary", new()
* {
* Name = "tfex-network-mapping-primary",
* Location = "West US",
* });
* var secondary = new Azure.Core.ResourceGroup("secondary", new()
* {
* Name = "tfex-network-mapping-secondary",
* Location = "East US",
* });
* var vault = new Azure.RecoveryServices.Vault("vault", new()
* {
* Name = "example-recovery-vault",
* Location = secondary.Location,
* ResourceGroupName = secondary.Name,
* Sku = "Standard",
* });
* var fabric = new Azure.SiteRecovery.Fabric("fabric", new()
* {
* Name = "primary-fabric",
* ResourceGroupName = secondary.Name,
* RecoveryVaultName = vault.Name,
* Location = primary.Location,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "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 {
* primary, err := core.NewResourceGroup(ctx, "primary", &core.ResourceGroupArgs{
* Name: pulumi.String("tfex-network-mapping-primary"),
* Location: pulumi.String("West US"),
* })
* if err != nil {
* return err
* }
* secondary, err := core.NewResourceGroup(ctx, "secondary", &core.ResourceGroupArgs{
* Name: pulumi.String("tfex-network-mapping-secondary"),
* 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: secondary.Location,
* ResourceGroupName: secondary.Name,
* Sku: pulumi.String("Standard"),
* })
* if err != nil {
* return err
* }
* _, err = siterecovery.NewFabric(ctx, "fabric", &siterecovery.FabricArgs{
* Name: pulumi.String("primary-fabric"),
* ResourceGroupName: secondary.Name,
* RecoveryVaultName: vault.Name,
* Location: primary.Location,
* })
* 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.siterecovery.Fabric;
* import com.pulumi.azure.siterecovery.FabricArgs;
* 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 primary = new ResourceGroup("primary", ResourceGroupArgs.builder()
* .name("tfex-network-mapping-primary")
* .location("West US")
* .build());
* var secondary = new ResourceGroup("secondary", ResourceGroupArgs.builder()
* .name("tfex-network-mapping-secondary")
* .location("East US")
* .build());
* var vault = new Vault("vault", VaultArgs.builder()
* .name("example-recovery-vault")
* .location(secondary.location())
* .resourceGroupName(secondary.name())
* .sku("Standard")
* .build());
* var fabric = new Fabric("fabric", FabricArgs.builder()
* .name("primary-fabric")
* .resourceGroupName(secondary.name())
* .recoveryVaultName(vault.name())
* .location(primary.location())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* primary:
* type: azure:core:ResourceGroup
* properties:
* name: tfex-network-mapping-primary
* location: West US
* secondary:
* type: azure:core:ResourceGroup
* properties:
* name: tfex-network-mapping-secondary
* location: East US
* vault:
* type: azure:recoveryservices:Vault
* properties:
* name: example-recovery-vault
* location: ${secondary.location}
* resourceGroupName: ${secondary.name}
* sku: Standard
* fabric:
* type: azure:siterecovery:Fabric
* properties:
* name: primary-fabric
* resourceGroupName: ${secondary.name}
* recoveryVaultName: ${vault.name}
* location: ${primary.location}
* ```
*
* ## Import
* Site Recovery Fabric can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:siterecovery/fabric:Fabric myfabric /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/fabric-name
* ```
*/
public class Fabric internal constructor(
override val javaResource: com.pulumi.azure.siterecovery.Fabric,
) : KotlinCustomResource(javaResource, FabricMapper) {
/**
* In what region should the fabric be located. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The name of the network mapping. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name of the vault that should be updated. Changing this forces a new resource to be created.
*/
public val recoveryVaultName: Output
get() = javaResource.recoveryVaultName().applyValue({ args0 -> args0 })
/**
* Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
}
public object FabricMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.siterecovery.Fabric::class == javaResource::class
override fun map(javaResource: Resource): Fabric = Fabric(
javaResource as
com.pulumi.azure.siterecovery.Fabric,
)
}
/**
* @see [Fabric].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Fabric].
*/
public suspend fun fabric(name: String, block: suspend FabricResourceBuilder.() -> Unit): Fabric {
val builder = FabricResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Fabric].
* @param name The _unique_ name of the resulting resource.
*/
public fun fabric(name: String): Fabric {
val builder = FabricResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy