Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.compute.kotlin.SnapshotArgs.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.SnapshotArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.SnapshotSnapshotEncryptionKeyArgs
import com.pulumi.gcp.compute.kotlin.inputs.SnapshotSnapshotEncryptionKeyArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.SnapshotSourceDiskEncryptionKeyArgs
import com.pulumi.gcp.compute.kotlin.inputs.SnapshotSourceDiskEncryptionKeyArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Represents a Persistent Disk Snapshot resource.
* Use snapshots to back up data from your persistent disks. Snapshots are
* different from public images and custom images, which are used primarily
* to create instances or configure instance templates. Snapshots are useful
* for periodic backup of the data on your persistent disks. You can create
* snapshots from persistent disks even while they are attached to running
* instances.
* Snapshots are incremental, so you can create regular snapshots on a
* persistent disk faster and at a much lower cost than if you regularly
* created a full image of the disk.
* To get more information about Snapshot, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/snapshots)
* * How-to Guides
* * [Official Documentation](https://cloud.google.com/compute/docs/disks/create-snapshots)
* ## Example Usage
* ### Snapshot Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const debian = gcp.compute.getImage({
* family: "debian-11",
* project: "debian-cloud",
* });
* const persistent = new gcp.compute.Disk("persistent", {
* name: "debian-disk",
* image: debian.then(debian => debian.selfLink),
* size: 10,
* type: "pd-ssd",
* zone: "us-central1-a",
* });
* const snapshot = new gcp.compute.Snapshot("snapshot", {
* name: "my-snapshot",
* sourceDisk: persistent.id,
* zone: "us-central1-a",
* labels: {
* my_label: "value",
* },
* storageLocations: ["us-central1"],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* debian = gcp.compute.get_image(family="debian-11",
* project="debian-cloud")
* persistent = gcp.compute.Disk("persistent",
* name="debian-disk",
* image=debian.self_link,
* size=10,
* type="pd-ssd",
* zone="us-central1-a")
* snapshot = gcp.compute.Snapshot("snapshot",
* name="my-snapshot",
* source_disk=persistent.id,
* zone="us-central1-a",
* labels={
* "my_label": "value",
* },
* storage_locations=["us-central1"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var debian = Gcp.Compute.GetImage.Invoke(new()
* {
* Family = "debian-11",
* Project = "debian-cloud",
* });
* var persistent = new Gcp.Compute.Disk("persistent", new()
* {
* Name = "debian-disk",
* Image = debian.Apply(getImageResult => getImageResult.SelfLink),
* Size = 10,
* Type = "pd-ssd",
* Zone = "us-central1-a",
* });
* var snapshot = new Gcp.Compute.Snapshot("snapshot", new()
* {
* Name = "my-snapshot",
* SourceDisk = persistent.Id,
* Zone = "us-central1-a",
* Labels =
* {
* { "my_label", "value" },
* },
* StorageLocations = new[]
* {
* "us-central1",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
* Family: pulumi.StringRef("debian-11"),
* Project: pulumi.StringRef("debian-cloud"),
* }, nil)
* if err != nil {
* return err
* }
* persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
* Name: pulumi.String("debian-disk"),
* Image: pulumi.String(debian.SelfLink),
* Size: pulumi.Int(10),
* Type: pulumi.String("pd-ssd"),
* Zone: pulumi.String("us-central1-a"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewSnapshot(ctx, "snapshot", &compute.SnapshotArgs{
* Name: pulumi.String("my-snapshot"),
* SourceDisk: persistent.ID(),
* Zone: pulumi.String("us-central1-a"),
* Labels: pulumi.StringMap{
* "my_label": pulumi.String("value"),
* },
* StorageLocations: pulumi.StringArray{
* pulumi.String("us-central1"),
* },
* })
* 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.GetImageArgs;
* import com.pulumi.gcp.compute.Disk;
* import com.pulumi.gcp.compute.DiskArgs;
* import com.pulumi.gcp.compute.Snapshot;
* import com.pulumi.gcp.compute.SnapshotArgs;
* 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 debian = ComputeFunctions.getImage(GetImageArgs.builder()
* .family("debian-11")
* .project("debian-cloud")
* .build());
* var persistent = new Disk("persistent", DiskArgs.builder()
* .name("debian-disk")
* .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
* .size(10)
* .type("pd-ssd")
* .zone("us-central1-a")
* .build());
* var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
* .name("my-snapshot")
* .sourceDisk(persistent.id())
* .zone("us-central1-a")
* .labels(Map.of("my_label", "value"))
* .storageLocations("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* snapshot:
* type: gcp:compute:Snapshot
* properties:
* name: my-snapshot
* sourceDisk: ${persistent.id}
* zone: us-central1-a
* labels:
* my_label: value
* storageLocations:
* - us-central1
* persistent:
* type: gcp:compute:Disk
* properties:
* name: debian-disk
* image: ${debian.selfLink}
* size: 10
* type: pd-ssd
* zone: us-central1-a
* variables:
* debian:
* fn::invoke:
* Function: gcp:compute:getImage
* Arguments:
* family: debian-11
* project: debian-cloud
* ```
*
* ### Snapshot Chainname
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const debian = gcp.compute.getImage({
* family: "debian-11",
* project: "debian-cloud",
* });
* const persistent = new gcp.compute.Disk("persistent", {
* name: "debian-disk",
* image: debian.then(debian => debian.selfLink),
* size: 10,
* type: "pd-ssd",
* zone: "us-central1-a",
* });
* const snapshot = new gcp.compute.Snapshot("snapshot", {
* name: "my-snapshot",
* sourceDisk: persistent.id,
* zone: "us-central1-a",
* chainName: "snapshot-chain",
* labels: {
* my_label: "value",
* },
* storageLocations: ["us-central1"],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* debian = gcp.compute.get_image(family="debian-11",
* project="debian-cloud")
* persistent = gcp.compute.Disk("persistent",
* name="debian-disk",
* image=debian.self_link,
* size=10,
* type="pd-ssd",
* zone="us-central1-a")
* snapshot = gcp.compute.Snapshot("snapshot",
* name="my-snapshot",
* source_disk=persistent.id,
* zone="us-central1-a",
* chain_name="snapshot-chain",
* labels={
* "my_label": "value",
* },
* storage_locations=["us-central1"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var debian = Gcp.Compute.GetImage.Invoke(new()
* {
* Family = "debian-11",
* Project = "debian-cloud",
* });
* var persistent = new Gcp.Compute.Disk("persistent", new()
* {
* Name = "debian-disk",
* Image = debian.Apply(getImageResult => getImageResult.SelfLink),
* Size = 10,
* Type = "pd-ssd",
* Zone = "us-central1-a",
* });
* var snapshot = new Gcp.Compute.Snapshot("snapshot", new()
* {
* Name = "my-snapshot",
* SourceDisk = persistent.Id,
* Zone = "us-central1-a",
* ChainName = "snapshot-chain",
* Labels =
* {
* { "my_label", "value" },
* },
* StorageLocations = new[]
* {
* "us-central1",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* debian, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
* Family: pulumi.StringRef("debian-11"),
* Project: pulumi.StringRef("debian-cloud"),
* }, nil)
* if err != nil {
* return err
* }
* persistent, err := compute.NewDisk(ctx, "persistent", &compute.DiskArgs{
* Name: pulumi.String("debian-disk"),
* Image: pulumi.String(debian.SelfLink),
* Size: pulumi.Int(10),
* Type: pulumi.String("pd-ssd"),
* Zone: pulumi.String("us-central1-a"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewSnapshot(ctx, "snapshot", &compute.SnapshotArgs{
* Name: pulumi.String("my-snapshot"),
* SourceDisk: persistent.ID(),
* Zone: pulumi.String("us-central1-a"),
* ChainName: pulumi.String("snapshot-chain"),
* Labels: pulumi.StringMap{
* "my_label": pulumi.String("value"),
* },
* StorageLocations: pulumi.StringArray{
* pulumi.String("us-central1"),
* },
* })
* 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.GetImageArgs;
* import com.pulumi.gcp.compute.Disk;
* import com.pulumi.gcp.compute.DiskArgs;
* import com.pulumi.gcp.compute.Snapshot;
* import com.pulumi.gcp.compute.SnapshotArgs;
* 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 debian = ComputeFunctions.getImage(GetImageArgs.builder()
* .family("debian-11")
* .project("debian-cloud")
* .build());
* var persistent = new Disk("persistent", DiskArgs.builder()
* .name("debian-disk")
* .image(debian.applyValue(getImageResult -> getImageResult.selfLink()))
* .size(10)
* .type("pd-ssd")
* .zone("us-central1-a")
* .build());
* var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
* .name("my-snapshot")
* .sourceDisk(persistent.id())
* .zone("us-central1-a")
* .chainName("snapshot-chain")
* .labels(Map.of("my_label", "value"))
* .storageLocations("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* snapshot:
* type: gcp:compute:Snapshot
* properties:
* name: my-snapshot
* sourceDisk: ${persistent.id}
* zone: us-central1-a
* chainName: snapshot-chain
* labels:
* my_label: value
* storageLocations:
* - us-central1
* persistent:
* type: gcp:compute:Disk
* properties:
* name: debian-disk
* image: ${debian.selfLink}
* size: 10
* type: pd-ssd
* zone: us-central1-a
* variables:
* debian:
* fn::invoke:
* Function: gcp:compute:getImage
* Arguments:
* family: debian-11
* project: debian-cloud
* ```
*
* ## Import
* Snapshot can be imported using any of these accepted formats:
* * `projects/{{project}}/global/snapshots/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, Snapshot can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/snapshot:Snapshot default projects/{{project}}/global/snapshots/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/snapshot:Snapshot default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/snapshot:Snapshot default {{name}}
* ```
* @property chainName Creates the new snapshot in the snapshot chain labeled with the
* specified name. The chain name must be 1-63 characters long and
* comply with RFC1035. This is an uncommon option only for advanced
* service owners who needs to create separate snapshot chains, for
* example, for chargeback tracking. When you describe your snapshot
* resource, this field is visible only if it has a non-empty value.
* @property description An optional description of this resource.
* @property labels Labels to apply to this Snapshot.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
* @property name Name of the resource; provided by the client when the resource is
* created. The name must be 1-63 characters long, and comply with
* RFC1035. Specifically, the name must be 1-63 characters long and match
* the regular expression `a-z?` which means the
* first character must be a lowercase letter, and all following
* characters must be a dash, lowercase letter, or digit, except the last
* character, which cannot be a dash.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property snapshotEncryptionKey Encrypts the snapshot using a customer-supplied encryption key.
* After you encrypt a snapshot using a customer-supplied key, you must
* provide the same key if you use the snapshot later. For example, you
* must provide the encryption key when you create a disk from the
* encrypted snapshot in a future request.
* Customer-supplied encryption keys do not protect access to metadata of
* the snapshot.
* If you do not provide an encryption key when creating the snapshot,
* then the snapshot will be encrypted using an automatically generated
* key and you do not need to provide a key to use the snapshot later.
* Structure is documented below.
* @property sourceDisk A reference to the disk used to create this snapshot.
* - - -
* @property sourceDiskEncryptionKey The customer-supplied encryption key of the source snapshot. Required
* if the source snapshot is protected by a customer-supplied encryption
* key.
* Structure is documented below.
* @property storageLocations Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
* @property zone A reference to the zone where the disk is hosted.
*/
public data class SnapshotArgs(
public val chainName: Output? = null,
public val description: Output? = null,
public val labels: Output>? = null,
public val name: Output? = null,
public val project: Output? = null,
public val snapshotEncryptionKey: Output? = null,
public val sourceDisk: Output? = null,
public val sourceDiskEncryptionKey: Output? = null,
public val storageLocations: Output>? = null,
public val zone: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.SnapshotArgs =
com.pulumi.gcp.compute.SnapshotArgs.builder()
.chainName(chainName?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.name(name?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.snapshotEncryptionKey(
snapshotEncryptionKey?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.sourceDisk(sourceDisk?.applyValue({ args0 -> args0 }))
.sourceDiskEncryptionKey(
sourceDiskEncryptionKey?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.storageLocations(storageLocations?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.zone(zone?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [SnapshotArgs].
*/
@PulumiTagMarker
public class SnapshotArgsBuilder internal constructor() {
private var chainName: Output? = null
private var description: Output? = null
private var labels: Output>? = null
private var name: Output? = null
private var project: Output? = null
private var snapshotEncryptionKey: Output? = null
private var sourceDisk: Output? = null
private var sourceDiskEncryptionKey: Output? = null
private var storageLocations: Output>? = null
private var zone: Output? = null
/**
* @param value Creates the new snapshot in the snapshot chain labeled with the
* specified name. The chain name must be 1-63 characters long and
* comply with RFC1035. This is an uncommon option only for advanced
* service owners who needs to create separate snapshot chains, for
* example, for chargeback tracking. When you describe your snapshot
* resource, this field is visible only if it has a non-empty value.
*/
@JvmName("dmjcqalidmmqmkio")
public suspend fun chainName(`value`: Output) {
this.chainName = value
}
/**
* @param value An optional description of this resource.
*/
@JvmName("uqorluxyujicuwij")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Labels to apply to this Snapshot.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("ifjwieysxqtsaqgg")
public suspend fun labels(`value`: Output>) {
this.labels = value
}
/**
* @param value Name of the resource; provided by the client when the resource is
* created. The name must be 1-63 characters long, and comply with
* RFC1035. Specifically, the name must be 1-63 characters long and match
* the regular expression `a-z?` which means the
* first character must be a lowercase letter, and all following
* characters must be a dash, lowercase letter, or digit, except the last
* character, which cannot be a dash.
*/
@JvmName("qqtnqcdypjcmqiar")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("rqlnjmvyjarbdpld")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Encrypts the snapshot using a customer-supplied encryption key.
* After you encrypt a snapshot using a customer-supplied key, you must
* provide the same key if you use the snapshot later. For example, you
* must provide the encryption key when you create a disk from the
* encrypted snapshot in a future request.
* Customer-supplied encryption keys do not protect access to metadata of
* the snapshot.
* If you do not provide an encryption key when creating the snapshot,
* then the snapshot will be encrypted using an automatically generated
* key and you do not need to provide a key to use the snapshot later.
* Structure is documented below.
*/
@JvmName("maixmnnfuqsclowf")
public suspend fun snapshotEncryptionKey(`value`: Output) {
this.snapshotEncryptionKey = value
}
/**
* @param value A reference to the disk used to create this snapshot.
* - - -
*/
@JvmName("hefplrhkohusemeh")
public suspend fun sourceDisk(`value`: Output) {
this.sourceDisk = value
}
/**
* @param value The customer-supplied encryption key of the source snapshot. Required
* if the source snapshot is protected by a customer-supplied encryption
* key.
* Structure is documented below.
*/
@JvmName("nwomundbufkgknmi")
public suspend fun sourceDiskEncryptionKey(`value`: Output) {
this.sourceDiskEncryptionKey = value
}
/**
* @param value Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
*/
@JvmName("qaehxrbomgxapbnb")
public suspend fun storageLocations(`value`: Output>) {
this.storageLocations = value
}
@JvmName("yajigvbcuwjftsis")
public suspend fun storageLocations(vararg values: Output) {
this.storageLocations = Output.all(values.asList())
}
/**
* @param values Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
*/
@JvmName("jvqcdcanhqwhvwfw")
public suspend fun storageLocations(values: List>) {
this.storageLocations = Output.all(values)
}
/**
* @param value A reference to the zone where the disk is hosted.
*/
@JvmName("mmygkiokatukelnc")
public suspend fun zone(`value`: Output) {
this.zone = value
}
/**
* @param value Creates the new snapshot in the snapshot chain labeled with the
* specified name. The chain name must be 1-63 characters long and
* comply with RFC1035. This is an uncommon option only for advanced
* service owners who needs to create separate snapshot chains, for
* example, for chargeback tracking. When you describe your snapshot
* resource, this field is visible only if it has a non-empty value.
*/
@JvmName("tbyvjeulkwbkwbhy")
public suspend fun chainName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.chainName = mapped
}
/**
* @param value An optional description of this resource.
*/
@JvmName("tihppoflmcqgvupm")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Labels to apply to this Snapshot.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("xqxmculdfvtyxybc")
public suspend fun labels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param values Labels to apply to this Snapshot.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effective_labels` for all of the labels present on the resource.
*/
@JvmName("mivwyoljivmuexjn")
public fun labels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.labels = mapped
}
/**
* @param value Name of the resource; provided by the client when the resource is
* created. The name must be 1-63 characters long, and comply with
* RFC1035. Specifically, the name must be 1-63 characters long and match
* the regular expression `a-z?` which means the
* first character must be a lowercase letter, and all following
* characters must be a dash, lowercase letter, or digit, except the last
* character, which cannot be a dash.
*/
@JvmName("msxhlsrpfhwimekg")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("sposgplldjjgcviv")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value Encrypts the snapshot using a customer-supplied encryption key.
* After you encrypt a snapshot using a customer-supplied key, you must
* provide the same key if you use the snapshot later. For example, you
* must provide the encryption key when you create a disk from the
* encrypted snapshot in a future request.
* Customer-supplied encryption keys do not protect access to metadata of
* the snapshot.
* If you do not provide an encryption key when creating the snapshot,
* then the snapshot will be encrypted using an automatically generated
* key and you do not need to provide a key to use the snapshot later.
* Structure is documented below.
*/
@JvmName("kykitakootkmvpds")
public suspend fun snapshotEncryptionKey(`value`: SnapshotSnapshotEncryptionKeyArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.snapshotEncryptionKey = mapped
}
/**
* @param argument Encrypts the snapshot using a customer-supplied encryption key.
* After you encrypt a snapshot using a customer-supplied key, you must
* provide the same key if you use the snapshot later. For example, you
* must provide the encryption key when you create a disk from the
* encrypted snapshot in a future request.
* Customer-supplied encryption keys do not protect access to metadata of
* the snapshot.
* If you do not provide an encryption key when creating the snapshot,
* then the snapshot will be encrypted using an automatically generated
* key and you do not need to provide a key to use the snapshot later.
* Structure is documented below.
*/
@JvmName("akfvhugsnbbtmtwd")
public suspend fun snapshotEncryptionKey(argument: suspend SnapshotSnapshotEncryptionKeyArgsBuilder.() -> Unit) {
val toBeMapped = SnapshotSnapshotEncryptionKeyArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.snapshotEncryptionKey = mapped
}
/**
* @param value A reference to the disk used to create this snapshot.
* - - -
*/
@JvmName("katwkiikyakpxwcn")
public suspend fun sourceDisk(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sourceDisk = mapped
}
/**
* @param value The customer-supplied encryption key of the source snapshot. Required
* if the source snapshot is protected by a customer-supplied encryption
* key.
* Structure is documented below.
*/
@JvmName("omudjupoefufssmr")
public suspend fun sourceDiskEncryptionKey(`value`: SnapshotSourceDiskEncryptionKeyArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sourceDiskEncryptionKey = mapped
}
/**
* @param argument The customer-supplied encryption key of the source snapshot. Required
* if the source snapshot is protected by a customer-supplied encryption
* key.
* Structure is documented below.
*/
@JvmName("yhxffismvgkrljul")
public suspend fun sourceDiskEncryptionKey(argument: suspend SnapshotSourceDiskEncryptionKeyArgsBuilder.() -> Unit) {
val toBeMapped = SnapshotSourceDiskEncryptionKeyArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.sourceDiskEncryptionKey = mapped
}
/**
* @param value Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
*/
@JvmName("xxwadlvpbcdjktnn")
public suspend fun storageLocations(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.storageLocations = mapped
}
/**
* @param values Cloud Storage bucket storage location of the snapshot (regional or multi-regional).
*/
@JvmName("suvegqtneydhimsj")
public suspend fun storageLocations(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.storageLocations = mapped
}
/**
* @param value A reference to the zone where the disk is hosted.
*/
@JvmName("ndubqyocbaodyjbf")
public suspend fun zone(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.zone = mapped
}
internal fun build(): SnapshotArgs = SnapshotArgs(
chainName = chainName,
description = description,
labels = labels,
name = name,
project = project,
snapshotEncryptionKey = snapshotEncryptionKey,
sourceDisk = sourceDisk,
sourceDiskEncryptionKey = sourceDiskEncryptionKey,
storageLocations = storageLocations,
zone = zone,
)
}