com.pulumi.alicloud.ens.kotlin.DiskArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-alicloud-kotlin Show documentation
Show all versions of pulumi-alicloud-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.alicloud.ens.kotlin
import com.pulumi.alicloud.ens.DiskArgs.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a ENS Disk resource. The disk. When you use it for the first time, please contact the product classmates to add a resource whitelist.
* For information about ENS Disk and how to use it, see [What is Disk](https://www.alibabacloud.com/help/en/ens/developer-reference/api-createdisk).
* > **NOTE:** Available since v1.213.0.
* ## Example Usage
* Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as alicloud from "@pulumi/alicloud";
* const config = new pulumi.Config();
* const name = config.get("name") || "terraform-example";
* const _default = new alicloud.ens.Disk("default", {
* category: "cloud_ssd",
* size: 20,
* paymentType: "PayAsYouGo",
* ensRegionId: "cn-chongqing-11",
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* config = pulumi.Config()
* name = config.get("name")
* if name is None:
* name = "terraform-example"
* default = alicloud.ens.Disk("default",
* category="cloud_ssd",
* size=20,
* payment_type="PayAsYouGo",
* ens_region_id="cn-chongqing-11")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AliCloud = Pulumi.AliCloud;
* return await Deployment.RunAsync(() =>
* {
* var config = new Config();
* var name = config.Get("name") ?? "terraform-example";
* var @default = new AliCloud.Ens.Disk("default", new()
* {
* Category = "cloud_ssd",
* Size = 20,
* PaymentType = "PayAsYouGo",
* EnsRegionId = "cn-chongqing-11",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ens"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cfg := config.New(ctx, "")
* name := "terraform-example"
* if param := cfg.Get("name"); param != "" {
* name = param
* }
* _, err := ens.NewDisk(ctx, "default", &ens.DiskArgs{
* Category: pulumi.String("cloud_ssd"),
* Size: pulumi.Int(20),
* PaymentType: pulumi.String("PayAsYouGo"),
* EnsRegionId: pulumi.String("cn-chongqing-11"),
* })
* 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.ens.Disk;
* import com.pulumi.alicloud.ens.DiskArgs;
* 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 config = ctx.config();
* final var name = config.get("name").orElse("terraform-example");
* var default_ = new Disk("default", DiskArgs.builder()
* .category("cloud_ssd")
* .size("20")
* .paymentType("PayAsYouGo")
* .ensRegionId("cn-chongqing-11")
* .build());
* }
* }
* ```
* ```yaml
* configuration:
* name:
* type: string
* default: terraform-example
* resources:
* default:
* type: alicloud:ens:Disk
* properties:
* category: cloud_ssd
* size: '20'
* paymentType: PayAsYouGo
* ensRegionId: cn-chongqing-11
* ```
*
* ## Import
* ENS Disk can be imported using the id, e.g.
* ```sh
* $ pulumi import alicloud:ens/disk:Disk example
* ```
* @property category Types of disk instancesValues: cloud_efficiency (high-efficiency cloud disk),cloud_ssd (full Flash cloud disk),local_hdd (local HDD),local_ssd (local ssd).
* @property diskName Name of the disk instance.
* @property encrypted Indicates whether the cloud disk is Encrypted. If Encrypted = true, the default service key is used when KMSKeyId is not entered. Value range:`true`, `false`(default).
* @property ensRegionId Ens node IDExample value: cn-chengdu-telecom.
* @property kmsKeyId The ID of the KMS key used by the cloud disk. If Encrypted is set to true, the service default key is used when KMSKeyId is empty.
* @property paymentType Billing type of the disk instanceValue: PayAsYouGo.
* @property size The size of the disk instance. Unit: GiB.
* @property snapshotId The ID of the snapshot used to create the cloud disk.
* The SnapshotId and Size parameters have the following limitations:
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is greater than the specified **Size** parameter, the Size of the cloud disk created is the Size of the specified snapshot.
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is less than the set **Size** parameter value, the Size of the cloud disk created is the specified **Size** parameter value.
*/
public data class DiskArgs(
public val category: Output? = null,
public val diskName: Output? = null,
public val encrypted: Output? = null,
public val ensRegionId: Output? = null,
public val kmsKeyId: Output? = null,
public val paymentType: Output? = null,
public val size: Output? = null,
public val snapshotId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.alicloud.ens.DiskArgs =
com.pulumi.alicloud.ens.DiskArgs.builder()
.category(category?.applyValue({ args0 -> args0 }))
.diskName(diskName?.applyValue({ args0 -> args0 }))
.encrypted(encrypted?.applyValue({ args0 -> args0 }))
.ensRegionId(ensRegionId?.applyValue({ args0 -> args0 }))
.kmsKeyId(kmsKeyId?.applyValue({ args0 -> args0 }))
.paymentType(paymentType?.applyValue({ args0 -> args0 }))
.size(size?.applyValue({ args0 -> args0 }))
.snapshotId(snapshotId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [DiskArgs].
*/
@PulumiTagMarker
public class DiskArgsBuilder internal constructor() {
private var category: Output? = null
private var diskName: Output? = null
private var encrypted: Output? = null
private var ensRegionId: Output? = null
private var kmsKeyId: Output? = null
private var paymentType: Output? = null
private var size: Output? = null
private var snapshotId: Output? = null
/**
* @param value Types of disk instancesValues: cloud_efficiency (high-efficiency cloud disk),cloud_ssd (full Flash cloud disk),local_hdd (local HDD),local_ssd (local ssd).
*/
@JvmName("vcagnlnikyhqpkux")
public suspend fun category(`value`: Output) {
this.category = value
}
/**
* @param value Name of the disk instance.
*/
@JvmName("ordtyfdbtwdnfjec")
public suspend fun diskName(`value`: Output) {
this.diskName = value
}
/**
* @param value Indicates whether the cloud disk is Encrypted. If Encrypted = true, the default service key is used when KMSKeyId is not entered. Value range:`true`, `false`(default).
*/
@JvmName("llbqvjmmstidicwi")
public suspend fun encrypted(`value`: Output) {
this.encrypted = value
}
/**
* @param value Ens node IDExample value: cn-chengdu-telecom.
*/
@JvmName("snlamxrjmyrxocqa")
public suspend fun ensRegionId(`value`: Output) {
this.ensRegionId = value
}
/**
* @param value The ID of the KMS key used by the cloud disk. If Encrypted is set to true, the service default key is used when KMSKeyId is empty.
*/
@JvmName("tvjknornfvrxdrjl")
public suspend fun kmsKeyId(`value`: Output) {
this.kmsKeyId = value
}
/**
* @param value Billing type of the disk instanceValue: PayAsYouGo.
*/
@JvmName("gkxpqsbfqwqsfhjs")
public suspend fun paymentType(`value`: Output) {
this.paymentType = value
}
/**
* @param value The size of the disk instance. Unit: GiB.
*/
@JvmName("llfkyysnlqxqpbjp")
public suspend fun size(`value`: Output) {
this.size = value
}
/**
* @param value The ID of the snapshot used to create the cloud disk.
* The SnapshotId and Size parameters have the following limitations:
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is greater than the specified **Size** parameter, the Size of the cloud disk created is the Size of the specified snapshot.
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is less than the set **Size** parameter value, the Size of the cloud disk created is the specified **Size** parameter value.
*/
@JvmName("pjtmbijxjnllixwy")
public suspend fun snapshotId(`value`: Output) {
this.snapshotId = value
}
/**
* @param value Types of disk instancesValues: cloud_efficiency (high-efficiency cloud disk),cloud_ssd (full Flash cloud disk),local_hdd (local HDD),local_ssd (local ssd).
*/
@JvmName("yrkusdlvhsbiecmp")
public suspend fun category(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.category = mapped
}
/**
* @param value Name of the disk instance.
*/
@JvmName("hgricqeyhtdspcii")
public suspend fun diskName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.diskName = mapped
}
/**
* @param value Indicates whether the cloud disk is Encrypted. If Encrypted = true, the default service key is used when KMSKeyId is not entered. Value range:`true`, `false`(default).
*/
@JvmName("ehcnqoladbsjcene")
public suspend fun encrypted(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encrypted = mapped
}
/**
* @param value Ens node IDExample value: cn-chengdu-telecom.
*/
@JvmName("srpkqgxusatcwepv")
public suspend fun ensRegionId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ensRegionId = mapped
}
/**
* @param value The ID of the KMS key used by the cloud disk. If Encrypted is set to true, the service default key is used when KMSKeyId is empty.
*/
@JvmName("awdlyvrinkodsdwk")
public suspend fun kmsKeyId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.kmsKeyId = mapped
}
/**
* @param value Billing type of the disk instanceValue: PayAsYouGo.
*/
@JvmName("exjrqwkjgqkmgkww")
public suspend fun paymentType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.paymentType = mapped
}
/**
* @param value The size of the disk instance. Unit: GiB.
*/
@JvmName("ofrmsqtfvntuqpyt")
public suspend fun size(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.size = mapped
}
/**
* @param value The ID of the snapshot used to create the cloud disk.
* The SnapshotId and Size parameters have the following limitations:
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is greater than the specified **Size** parameter, the Size of the cloud disk created is the Size of the specified snapshot.
* - If the snapshot capacity corresponding to the **SnapshotId** parameter is less than the set **Size** parameter value, the Size of the cloud disk created is the specified **Size** parameter value.
*/
@JvmName("ecfrjkposnrniqmx")
public suspend fun snapshotId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.snapshotId = mapped
}
internal fun build(): DiskArgs = DiskArgs(
category = category,
diskName = diskName,
encrypted = encrypted,
ensRegionId = ensRegionId,
kmsKeyId = kmsKeyId,
paymentType = paymentType,
size = size,
snapshotId = snapshotId,
)
}