All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.alicloud.ecs.kotlin.SnapshotArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.ecs.kotlin

import com.pulumi.alicloud.ecs.SnapshotArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * > **DEPRECATED:** This resource has been renamed to alicloud.ecs.EcsSnapshot from version 1.120.0.
 * Provides an ECS snapshot resource.
 * For information about snapshot and how to use it, see [Snapshot](https://www.alibabacloud.com/help/doc-detail/25460.html).
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const snapshot = new alicloud.ecs.Snapshot("snapshot", {
 *     diskId: instance_attachment.diskId,
 *     name: "test-snapshot",
 *     description: "this snapshot is created for testing",
 *     tags: {
 *         version: "1.2",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * snapshot = alicloud.ecs.Snapshot("snapshot",
 *     disk_id=instance_attachment["diskId"],
 *     name="test-snapshot",
 *     description="this snapshot is created for testing",
 *     tags={
 *         "version": "1.2",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var snapshot = new AliCloud.Ecs.Snapshot("snapshot", new()
 *     {
 *         DiskId = instance_attachment.DiskId,
 *         Name = "test-snapshot",
 *         Description = "this snapshot is created for testing",
 *         Tags =
 *         {
 *             { "version", "1.2" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := ecs.NewSnapshot(ctx, "snapshot", &ecs.SnapshotArgs{
 * 			DiskId:      pulumi.Any(instance_attachment.DiskId),
 * 			Name:        pulumi.String("test-snapshot"),
 * 			Description: pulumi.String("this snapshot is created for testing"),
 * 			Tags: pulumi.StringMap{
 * 				"version": pulumi.String("1.2"),
 * 			},
 * 		})
 * 		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.alicloud.ecs.Snapshot;
 * import com.pulumi.alicloud.ecs.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) {
 *         var snapshot = new Snapshot("snapshot", SnapshotArgs.builder()
 *             .diskId(instance_attachment.diskId())
 *             .name("test-snapshot")
 *             .description("this snapshot is created for testing")
 *             .tags(Map.of("version", "1.2"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   snapshot:
 *     type: alicloud:ecs:Snapshot
 *     properties:
 *       diskId: ${["instance-attachment"].diskId}
 *       name: test-snapshot
 *       description: this snapshot is created for testing
 *       tags:
 *         version: '1.2'
 * ```
 * 
 * ## Import
 * Snapshot can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:ecs/snapshot:Snapshot snapshot s-abc1234567890000
 * ```
 * @property category
 * @property description Description of the snapshot. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
 * @property diskId The source disk ID.
 * @property force
 * @property instantAccess
 * @property instantAccessRetentionDays
 * @property name The name of the snapshot to be created. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
 * It cannot start with auto, because snapshot names starting with auto are recognized as automatic snapshots.
 * @property resourceGroupId The ID of the resource group.
 * @property retentionDays
 * @property snapshotName
 * @property tags A mapping of tags to assign to the resource.
 */
public data class SnapshotArgs(
    public val category: Output? = null,
    public val description: Output? = null,
    public val diskId: Output? = null,
    public val force: Output? = null,
    public val instantAccess: Output? = null,
    public val instantAccessRetentionDays: Output? = null,
    @Deprecated(
        message = """
  Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
  """,
    )
    public val name: Output? = null,
    public val resourceGroupId: Output? = null,
    public val retentionDays: Output? = null,
    public val snapshotName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.ecs.SnapshotArgs =
        com.pulumi.alicloud.ecs.SnapshotArgs.builder()
            .category(category?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .diskId(diskId?.applyValue({ args0 -> args0 }))
            .force(force?.applyValue({ args0 -> args0 }))
            .instantAccess(instantAccess?.applyValue({ args0 -> args0 }))
            .instantAccessRetentionDays(instantAccessRetentionDays?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupId(resourceGroupId?.applyValue({ args0 -> args0 }))
            .retentionDays(retentionDays?.applyValue({ args0 -> args0 }))
            .snapshotName(snapshotName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [SnapshotArgs].
 */
@PulumiTagMarker
public class SnapshotArgsBuilder internal constructor() {
    private var category: Output? = null

    private var description: Output? = null

    private var diskId: Output? = null

    private var force: Output? = null

    private var instantAccess: Output? = null

    private var instantAccessRetentionDays: Output? = null

    private var name: Output? = null

    private var resourceGroupId: Output? = null

    private var retentionDays: Output? = null

    private var snapshotName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value
     */
    @JvmName("xxuqbawwvjitosbm")
    public suspend fun category(`value`: Output) {
        this.category = value
    }

    /**
     * @param value Description of the snapshot. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
     */
    @JvmName("uhogqhiqfctseiul")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The source disk ID.
     */
    @JvmName("jsjtbrsvaufvypel")
    public suspend fun diskId(`value`: Output) {
        this.diskId = value
    }

    /**
     * @param value
     */
    @JvmName("skodpncyblrwesyu")
    public suspend fun force(`value`: Output) {
        this.force = value
    }

    /**
     * @param value
     */
    @JvmName("njwmtjoacojelvge")
    public suspend fun instantAccess(`value`: Output) {
        this.instantAccess = value
    }

    /**
     * @param value
     */
    @JvmName("xlacguakoylyrfuv")
    public suspend fun instantAccessRetentionDays(`value`: Output) {
        this.instantAccessRetentionDays = value
    }

    /**
     * @param value The name of the snapshot to be created. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
     * It cannot start with auto, because snapshot names starting with auto are recognized as automatic snapshots.
     */
    @Deprecated(
        message = """
  Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
  """,
    )
    @JvmName("dvcdlfrtuhtdojyf")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the resource group.
     */
    @JvmName("iijrxblpbxgoxqex")
    public suspend fun resourceGroupId(`value`: Output) {
        this.resourceGroupId = value
    }

    /**
     * @param value
     */
    @JvmName("kcogegjobslkhxku")
    public suspend fun retentionDays(`value`: Output) {
        this.retentionDays = value
    }

    /**
     * @param value
     */
    @JvmName("upcjcwwspsytlkrx")
    public suspend fun snapshotName(`value`: Output) {
        this.snapshotName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("bwmsvtidgobiisqk")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value
     */
    @JvmName("odtwsjcyuonhmhxh")
    public suspend fun category(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.category = mapped
    }

    /**
     * @param value Description of the snapshot. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
     */
    @JvmName("nyijndxbdjdjcccd")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The source disk ID.
     */
    @JvmName("gcymeenknipllgvs")
    public suspend fun diskId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskId = mapped
    }

    /**
     * @param value
     */
    @JvmName("ydsrdkpfaahpuwhk")
    public suspend fun force(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.force = mapped
    }

    /**
     * @param value
     */
    @JvmName("njelawexignrgqun")
    public suspend fun instantAccess(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instantAccess = mapped
    }

    /**
     * @param value
     */
    @JvmName("faflpjqskongqvwx")
    public suspend fun instantAccessRetentionDays(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instantAccessRetentionDays = mapped
    }

    /**
     * @param value The name of the snapshot to be created. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).
     * It cannot start with auto, because snapshot names starting with auto are recognized as automatic snapshots.
     */
    @Deprecated(
        message = """
  Field 'name' has been deprecated from provider version 1.120.0. New field 'snapshot_name' instead.
  """,
    )
    @JvmName("qrkuakdbepboycah")
    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 resource group.
     */
    @JvmName("hpmeljjodyawartd")
    public suspend fun resourceGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupId = mapped
    }

    /**
     * @param value
     */
    @JvmName("amietbpewwvijngh")
    public suspend fun retentionDays(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionDays = mapped
    }

    /**
     * @param value
     */
    @JvmName("btakjktcvcobqdgk")
    public suspend fun snapshotName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.snapshotName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("ttcdrdsouukxxbcv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("gdqmtgwjpajyvflt")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): SnapshotArgs = SnapshotArgs(
        category = category,
        description = description,
        diskId = diskId,
        force = force,
        instantAccess = instantAccess,
        instantAccessRetentionDays = instantAccessRetentionDays,
        name = name,
        resourceGroupId = resourceGroupId,
        retentionDays = retentionDays,
        snapshotName = snapshotName,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy