com.pulumi.gcp.compute.kotlin.DiskAsyncReplicationArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.DiskAsyncReplicationArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.DiskAsyncReplicationSecondaryDiskArgs
import com.pulumi.gcp.compute.kotlin.inputs.DiskAsyncReplicationSecondaryDiskArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Starts and stops asynchronous persistent disk replication. For more information
* see [the official documentation](https://cloud.google.com/compute/docs/disks/async-pd/about)
* and the [API](https://cloud.google.com/compute/docs/reference/rest/v1/disks).
* ## Example Usage
* ```tf
* resource "google_compute_disk" "primary-disk" {
* name = "primary-disk"
* type = "pd-ssd"
* zone = "europe-west4-a"
* physical_block_size_bytes = 4096
* }
* resource "google_compute_disk" "secondary-disk" {
* name = "secondary-disk"
* type = "pd-ssd"
* zone = "europe-west3-a"
* async_primary_disk {
* disk = google_compute_disk.primary-disk.id
* }
* physical_block_size_bytes = 4096
* }
* resource "google_compute_disk_async_replication" "replication" {
* primary_disk = google_compute_disk.primary-disk.id
* secondary_disk {
* disk = google_compute_disk.secondary-disk.id
* }
* }
* ```
* @property primaryDisk The primary disk (source of replication).
* @property secondaryDisk The secondary disk (target of replication). You can specify only one value. Structure is documented below.
* The `secondary_disk` block includes:
*/
public data class DiskAsyncReplicationArgs(
public val primaryDisk: Output? = null,
public val secondaryDisk: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.DiskAsyncReplicationArgs =
com.pulumi.gcp.compute.DiskAsyncReplicationArgs.builder()
.primaryDisk(primaryDisk?.applyValue({ args0 -> args0 }))
.secondaryDisk(secondaryDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [DiskAsyncReplicationArgs].
*/
@PulumiTagMarker
public class DiskAsyncReplicationArgsBuilder internal constructor() {
private var primaryDisk: Output? = null
private var secondaryDisk: Output? = null
/**
* @param value The primary disk (source of replication).
*/
@JvmName("gkusyprhxgqstous")
public suspend fun primaryDisk(`value`: Output) {
this.primaryDisk = value
}
/**
* @param value The secondary disk (target of replication). You can specify only one value. Structure is documented below.
* The `secondary_disk` block includes:
*/
@JvmName("hjfkrgulqijlqekg")
public suspend fun secondaryDisk(`value`: Output) {
this.secondaryDisk = value
}
/**
* @param value The primary disk (source of replication).
*/
@JvmName("gwtoanphnedqmayg")
public suspend fun primaryDisk(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.primaryDisk = mapped
}
/**
* @param value The secondary disk (target of replication). You can specify only one value. Structure is documented below.
* The `secondary_disk` block includes:
*/
@JvmName("erndwgtmpjcidxup")
public suspend fun secondaryDisk(`value`: DiskAsyncReplicationSecondaryDiskArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.secondaryDisk = mapped
}
/**
* @param argument The secondary disk (target of replication). You can specify only one value. Structure is documented below.
* The `secondary_disk` block includes:
*/
@JvmName("lvyagsfswofmrydy")
public suspend fun secondaryDisk(argument: suspend DiskAsyncReplicationSecondaryDiskArgsBuilder.() -> Unit) {
val toBeMapped = DiskAsyncReplicationSecondaryDiskArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.secondaryDisk = mapped
}
internal fun build(): DiskAsyncReplicationArgs = DiskAsyncReplicationArgs(
primaryDisk = primaryDisk,
secondaryDisk = secondaryDisk,
)
}