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.aws.lightsail.kotlin.DiskArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.lightsail.kotlin
import com.pulumi.aws.lightsail.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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Provides a Lightsail Disk resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const available = aws.getAvailabilityZones({
* state: "available",
* filters: [{
* name: "opt-in-status",
* values: ["opt-in-not-required"],
* }],
* });
* const test = new aws.lightsail.Disk("test", {
* name: "test",
* sizeInGb: 8,
* availabilityZone: available.then(available => available.names?.[0]),
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* available = aws.get_availability_zones(state="available",
* filters=[{
* "name": "opt-in-status",
* "values": ["opt-in-not-required"],
* }])
* test = aws.lightsail.Disk("test",
* name="test",
* size_in_gb=8,
* availability_zone=available.names[0])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var available = Aws.GetAvailabilityZones.Invoke(new()
* {
* State = "available",
* Filters = new[]
* {
* new Aws.Inputs.GetAvailabilityZonesFilterInputArgs
* {
* Name = "opt-in-status",
* Values = new[]
* {
* "opt-in-not-required",
* },
* },
* },
* });
* var test = new Aws.LightSail.Disk("test", new()
* {
* Name = "test",
* SizeInGb = 8,
* AvailabilityZone = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Names[0]),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/lightsail"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
* State: pulumi.StringRef("available"),
* Filters: []aws.GetAvailabilityZonesFilter{
* {
* Name: "opt-in-status",
* Values: []string{
* "opt-in-not-required",
* },
* },
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = lightsail.NewDisk(ctx, "test", &lightsail.DiskArgs{
* Name: pulumi.String("test"),
* SizeInGb: pulumi.Int(8),
* AvailabilityZone: pulumi.String(available.Names[0]),
* })
* 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.aws.AwsFunctions;
* import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
* import com.pulumi.aws.lightsail.Disk;
* import com.pulumi.aws.lightsail.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 available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
* .state("available")
* .filters(GetAvailabilityZonesFilterArgs.builder()
* .name("opt-in-status")
* .values("opt-in-not-required")
* .build())
* .build());
* var test = new Disk("test", DiskArgs.builder()
* .name("test")
* .sizeInGb(8)
* .availabilityZone(available.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.names()[0]))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:lightsail:Disk
* properties:
* name: test
* sizeInGb: 8
* availabilityZone: ${available.names[0]}
* variables:
* available:
* fn::invoke:
* Function: aws:getAvailabilityZones
* Arguments:
* state: available
* filters:
* - name: opt-in-status
* values:
* - opt-in-not-required
* ```
*
* ## Import
* Using `pulumi import`, import `aws_lightsail_disk` using the name attribute. For example:
* ```sh
* $ pulumi import aws:lightsail/disk:Disk test test
* ```
* @property availabilityZone The Availability Zone in which to create your disk.
* @property name The name of the disk.
* @property sizeInGb The size of the disk in GB.
* @property tags A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public data class DiskArgs(
public val availabilityZone: Output? = null,
public val name: Output? = null,
public val sizeInGb: Output? = null,
public val tags: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.lightsail.DiskArgs =
com.pulumi.aws.lightsail.DiskArgs.builder()
.availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.sizeInGb(sizeInGb?.applyValue({ args0 -> args0 }))
.tags(
tags?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
).build()
}
/**
* Builder for [DiskArgs].
*/
@PulumiTagMarker
public class DiskArgsBuilder internal constructor() {
private var availabilityZone: Output? = null
private var name: Output? = null
private var sizeInGb: Output? = null
private var tags: Output>? = null
/**
* @param value The Availability Zone in which to create your disk.
*/
@JvmName("cqvmoawflbmpserh")
public suspend fun availabilityZone(`value`: Output) {
this.availabilityZone = value
}
/**
* @param value The name of the disk.
*/
@JvmName("dknmjpqhrmeoutfp")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The size of the disk in GB.
*/
@JvmName("uhcmbpeuywfyhwtd")
public suspend fun sizeInGb(`value`: Output) {
this.sizeInGb = value
}
/**
* @param value A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("mhgpaautuylimcml")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value The Availability Zone in which to create your disk.
*/
@JvmName("ajnritlguogcivan")
public suspend fun availabilityZone(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.availabilityZone = mapped
}
/**
* @param value The name of the disk.
*/
@JvmName("hracspfgaydyylno")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The size of the disk in GB.
*/
@JvmName("atgtqaywsqxhskxx")
public suspend fun sizeInGb(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sizeInGb = mapped
}
/**
* @param value A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("hmlhevfxwgwjsfef")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values A map of tags to assign to the resource. To create a key-only tag, use an empty string as the value. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
@JvmName("vmbwpacquynqouou")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
internal fun build(): DiskArgs = DiskArgs(
availabilityZone = availabilityZone,
name = name,
sizeInGb = sizeInGb,
tags = tags,
)
}