com.pulumi.gcp.netapp.kotlin.VolumeReplication.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.netapp.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.netapp.kotlin.outputs.VolumeReplicationDestinationVolumeParameters
import com.pulumi.gcp.netapp.kotlin.outputs.VolumeReplicationTransferStat
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
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.netapp.kotlin.outputs.VolumeReplicationDestinationVolumeParameters.Companion.toKotlin as volumeReplicationDestinationVolumeParametersToKotlin
import com.pulumi.gcp.netapp.kotlin.outputs.VolumeReplicationTransferStat.Companion.toKotlin as volumeReplicationTransferStatToKotlin
/**
* Builder for [VolumeReplication].
*/
@PulumiTagMarker
public class VolumeReplicationResourceBuilder internal constructor() {
public var name: String? = null
public var args: VolumeReplicationArgs = VolumeReplicationArgs()
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 VolumeReplicationArgsBuilder.() -> Unit) {
val builder = VolumeReplicationArgsBuilder()
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(): VolumeReplication {
val builtJavaResource = com.pulumi.gcp.netapp.VolumeReplication(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return VolumeReplication(builtJavaResource)
}
}
/**
* ## Example Usage
* ### Netapp Volume Replication Create
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const default = gcp.compute.getNetwork({
* name: "test-network",
* });
* const sourcePool = new gcp.netapp.StoragePool("source_pool", {
* name: "source-pool",
* location: "us-central1",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: _default.then(_default => _default.id),
* });
* const destinationPool = new gcp.netapp.StoragePool("destination_pool", {
* name: "destination-pool",
* location: "us-west2",
* serviceLevel: "PREMIUM",
* capacityGib: "2048",
* network: _default.then(_default => _default.id),
* });
* const sourceVolume = new gcp.netapp.Volume("source_volume", {
* location: sourcePool.location,
* name: "source-volume",
* capacityGib: "100",
* shareName: "source-volume",
* storagePool: sourcePool.name,
* protocols: ["NFSV3"],
* deletionPolicy: "FORCE",
* });
* const testReplication = new gcp.netapp.VolumeReplication("test_replication", {
* location: sourceVolume.location,
* volumeName: sourceVolume.name,
* name: "test-replication",
* replicationSchedule: "EVERY_10_MINUTES",
* description: "This is a replication resource",
* destinationVolumeParameters: {
* storagePool: destinationPool.id,
* volumeId: "destination-volume",
* shareName: "source-volume",
* description: "This is a replicated volume",
* },
* deleteDestinationVolume: true,
* waitForMirror: true,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.get_network(name="test-network")
* source_pool = gcp.netapp.StoragePool("source_pool",
* name="source-pool",
* location="us-central1",
* service_level="PREMIUM",
* capacity_gib="2048",
* network=default.id)
* destination_pool = gcp.netapp.StoragePool("destination_pool",
* name="destination-pool",
* location="us-west2",
* service_level="PREMIUM",
* capacity_gib="2048",
* network=default.id)
* source_volume = gcp.netapp.Volume("source_volume",
* location=source_pool.location,
* name="source-volume",
* capacity_gib="100",
* share_name="source-volume",
* storage_pool=source_pool.name,
* protocols=["NFSV3"],
* deletion_policy="FORCE")
* test_replication = gcp.netapp.VolumeReplication("test_replication",
* location=source_volume.location,
* volume_name=source_volume.name,
* name="test-replication",
* replication_schedule="EVERY_10_MINUTES",
* description="This is a replication resource",
* destination_volume_parameters=gcp.netapp.VolumeReplicationDestinationVolumeParametersArgs(
* storage_pool=destination_pool.id,
* volume_id="destination-volume",
* share_name="source-volume",
* description="This is a replicated volume",
* ),
* delete_destination_volume=True,
* wait_for_mirror=True)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = Gcp.Compute.GetNetwork.Invoke(new()
* {
* Name = "test-network",
* });
* var sourcePool = new Gcp.Netapp.StoragePool("source_pool", new()
* {
* Name = "source-pool",
* Location = "us-central1",
* ServiceLevel = "PREMIUM",
* CapacityGib = "2048",
* Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
* });
* var destinationPool = new Gcp.Netapp.StoragePool("destination_pool", new()
* {
* Name = "destination-pool",
* Location = "us-west2",
* ServiceLevel = "PREMIUM",
* CapacityGib = "2048",
* Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
* });
* var sourceVolume = new Gcp.Netapp.Volume("source_volume", new()
* {
* Location = sourcePool.Location,
* Name = "source-volume",
* CapacityGib = "100",
* ShareName = "source-volume",
* StoragePool = sourcePool.Name,
* Protocols = new[]
* {
* "NFSV3",
* },
* DeletionPolicy = "FORCE",
* });
* var testReplication = new Gcp.Netapp.VolumeReplication("test_replication", new()
* {
* Location = sourceVolume.Location,
* VolumeName = sourceVolume.Name,
* Name = "test-replication",
* ReplicationSchedule = "EVERY_10_MINUTES",
* Description = "This is a replication resource",
* DestinationVolumeParameters = new Gcp.Netapp.Inputs.VolumeReplicationDestinationVolumeParametersArgs
* {
* StoragePool = destinationPool.Id,
* VolumeId = "destination-volume",
* ShareName = "source-volume",
* Description = "This is a replicated volume",
* },
* DeleteDestinationVolume = true,
* WaitForMirror = true,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/netapp"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
* Name: "test-network",
* }, nil)
* if err != nil {
* return err
* }
* sourcePool, err := netapp.NewStoragePool(ctx, "source_pool", &netapp.StoragePoolArgs{
* Name: pulumi.String("source-pool"),
* Location: pulumi.String("us-central1"),
* ServiceLevel: pulumi.String("PREMIUM"),
* CapacityGib: pulumi.String("2048"),
* Network: pulumi.String(_default.Id),
* })
* if err != nil {
* return err
* }
* destinationPool, err := netapp.NewStoragePool(ctx, "destination_pool", &netapp.StoragePoolArgs{
* Name: pulumi.String("destination-pool"),
* Location: pulumi.String("us-west2"),
* ServiceLevel: pulumi.String("PREMIUM"),
* CapacityGib: pulumi.String("2048"),
* Network: pulumi.String(_default.Id),
* })
* if err != nil {
* return err
* }
* sourceVolume, err := netapp.NewVolume(ctx, "source_volume", &netapp.VolumeArgs{
* Location: sourcePool.Location,
* Name: pulumi.String("source-volume"),
* CapacityGib: pulumi.String("100"),
* ShareName: pulumi.String("source-volume"),
* StoragePool: sourcePool.Name,
* Protocols: pulumi.StringArray{
* pulumi.String("NFSV3"),
* },
* DeletionPolicy: pulumi.String("FORCE"),
* })
* if err != nil {
* return err
* }
* _, err = netapp.NewVolumeReplication(ctx, "test_replication", &netapp.VolumeReplicationArgs{
* Location: sourceVolume.Location,
* VolumeName: sourceVolume.Name,
* Name: pulumi.String("test-replication"),
* ReplicationSchedule: pulumi.String("EVERY_10_MINUTES"),
* Description: pulumi.String("This is a replication resource"),
* DestinationVolumeParameters: &netapp.VolumeReplicationDestinationVolumeParametersArgs{
* StoragePool: destinationPool.ID(),
* VolumeId: pulumi.String("destination-volume"),
* ShareName: pulumi.String("source-volume"),
* Description: pulumi.String("This is a replicated volume"),
* },
* DeleteDestinationVolume: pulumi.Bool(true),
* WaitForMirror: pulumi.Bool(true),
* })
* 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.gcp.compute.ComputeFunctions;
* import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
* import com.pulumi.gcp.netapp.StoragePool;
* import com.pulumi.gcp.netapp.StoragePoolArgs;
* import com.pulumi.gcp.netapp.Volume;
* import com.pulumi.gcp.netapp.VolumeArgs;
* import com.pulumi.gcp.netapp.VolumeReplication;
* import com.pulumi.gcp.netapp.VolumeReplicationArgs;
* import com.pulumi.gcp.netapp.inputs.VolumeReplicationDestinationVolumeParametersArgs;
* 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) {
* final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
* .name("test-network")
* .build());
* var sourcePool = new StoragePool("sourcePool", StoragePoolArgs.builder()
* .name("source-pool")
* .location("us-central1")
* .serviceLevel("PREMIUM")
* .capacityGib(2048)
* .network(default_.id())
* .build());
* var destinationPool = new StoragePool("destinationPool", StoragePoolArgs.builder()
* .name("destination-pool")
* .location("us-west2")
* .serviceLevel("PREMIUM")
* .capacityGib(2048)
* .network(default_.id())
* .build());
* var sourceVolume = new Volume("sourceVolume", VolumeArgs.builder()
* .location(sourcePool.location())
* .name("source-volume")
* .capacityGib(100)
* .shareName("source-volume")
* .storagePool(sourcePool.name())
* .protocols("NFSV3")
* .deletionPolicy("FORCE")
* .build());
* var testReplication = new VolumeReplication("testReplication", VolumeReplicationArgs.builder()
* .location(sourceVolume.location())
* .volumeName(sourceVolume.name())
* .name("test-replication")
* .replicationSchedule("EVERY_10_MINUTES")
* .description("This is a replication resource")
* .destinationVolumeParameters(VolumeReplicationDestinationVolumeParametersArgs.builder()
* .storagePool(destinationPool.id())
* .volumeId("destination-volume")
* .shareName("source-volume")
* .description("This is a replicated volume")
* .build())
* .deleteDestinationVolume(true)
* .waitForMirror(true)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* sourcePool:
* type: gcp:netapp:StoragePool
* name: source_pool
* properties:
* name: source-pool
* location: us-central1
* serviceLevel: PREMIUM
* capacityGib: 2048
* network: ${default.id}
* destinationPool:
* type: gcp:netapp:StoragePool
* name: destination_pool
* properties:
* name: destination-pool
* location: us-west2
* serviceLevel: PREMIUM
* capacityGib: 2048
* network: ${default.id}
* sourceVolume:
* type: gcp:netapp:Volume
* name: source_volume
* properties:
* location: ${sourcePool.location}
* name: source-volume
* capacityGib: 100
* shareName: source-volume
* storagePool: ${sourcePool.name}
* protocols:
* - NFSV3
* deletionPolicy: FORCE
* testReplication:
* type: gcp:netapp:VolumeReplication
* name: test_replication
* properties:
* location: ${sourceVolume.location}
* volumeName: ${sourceVolume.name}
* name: test-replication
* replicationSchedule: EVERY_10_MINUTES
* description: This is a replication resource
* destinationVolumeParameters:
* storagePool: ${destinationPool.id}
* volumeId: destination-volume
* shareName: source-volume
* description: This is a replicated volume
* deleteDestinationVolume: true
* waitForMirror: true
* variables:
* default:
* fn::invoke:
* Function: gcp:compute:getNetwork
* Arguments:
* name: test-network
* ```
*
* ## Import
* VolumeReplication can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/replications/{{name}}`
* * `{{project}}/{{location}}/{{volume_name}}/{{name}}`
* * `{{location}}/{{volume_name}}/{{name}}`
* When using the `pulumi import` command, VolumeReplication can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default projects/{{project}}/locations/{{location}}/volumes/{{volume_name}}/replications/{{name}}
* ```
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default {{project}}/{{location}}/{{volume_name}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:netapp/volumeReplication:VolumeReplication default {{location}}/{{volume_name}}/{{name}}
* ```
*/
public class VolumeReplication internal constructor(
override val javaResource: com.pulumi.gcp.netapp.VolumeReplication,
) : KotlinCustomResource(javaResource, VolumeReplicationMapper) {
/**
* Create time of the active directory. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
*/
public val createTime: Output
get() = javaResource.createTime().applyValue({ args0 -> args0 })
public val deleteDestinationVolume: Output?
get() = javaResource.deleteDestinationVolume().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An description of this resource.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Full resource name of destination volume with format: `projects/{{project}}/locations/{{location}}/volumes/{{volumeId}}`
*/
public val destinationVolume: Output
get() = javaResource.destinationVolume().applyValue({ args0 -> args0 })
/**
* Destination volume parameters.
* Structure is documented below.
*/
public val destinationVolumeParameters: Output?
get() = javaResource.destinationVolumeParameters().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
volumeReplicationDestinationVolumeParametersToKotlin(args0)
})
}).orElse(null)
})
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy