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

com.pulumi.alicloud.tsdb.kotlin.Instance.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.tsdb.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [Instance].
 */
@PulumiTagMarker
public class InstanceResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: InstanceArgs = InstanceArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend InstanceArgsBuilder.() -> Unit) {
        val builder = InstanceArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Instance {
        val builtJavaResource = com.pulumi.alicloud.tsdb.Instance(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Instance(builtJavaResource)
    }
}

/**
 * Provides a Time Series Database (TSDB) Instance resource.
 * For information about Time Series Database (TSDB) Instance and how to use it, see [What is Time Series Database (TSDB)](https://www.alibabacloud.com/help/en/doc-detail/55652.htm).
 * > **NOTE:** Available in v1.112.0+.
 * > **DEPRECATED:**  This resource has been [deprecated](https://www.alibabacloud.com/en/notice/0313tsdb?_p_lc=1) from version `1.223.1`.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const example = alicloud.tsdb.getZones({});
 * const exampleNetwork = new alicloud.vpc.Network("example", {
 *     cidrBlock: "192.168.0.0/16",
 *     name: "tf-testaccTsdbInstance",
 * });
 * const exampleSwitch = new alicloud.vpc.Switch("example", {
 *     availabilityZone: example.then(example => example.ids?.[0]),
 *     cidrBlock: "192.168.1.0/24",
 *     vpcId: exampleNetwork.id,
 * });
 * const exampleInstance = new alicloud.tsdb.Instance("example", {
 *     paymentType: "PayAsYouGo",
 *     vswitchId: exampleSwitch.id,
 *     instanceStorage: "50",
 *     instanceClass: "tsdb.1x.basic",
 *     engineType: "tsdb_tsdb",
 *     instanceAlias: "tf-testaccTsdbInstance",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * example = alicloud.tsdb.get_zones()
 * example_network = alicloud.vpc.Network("example",
 *     cidr_block="192.168.0.0/16",
 *     name="tf-testaccTsdbInstance")
 * example_switch = alicloud.vpc.Switch("example",
 *     availability_zone=example.ids[0],
 *     cidr_block="192.168.1.0/24",
 *     vpc_id=example_network.id)
 * example_instance = alicloud.tsdb.Instance("example",
 *     payment_type="PayAsYouGo",
 *     vswitch_id=example_switch.id,
 *     instance_storage="50",
 *     instance_class="tsdb.1x.basic",
 *     engine_type="tsdb_tsdb",
 *     instance_alias="tf-testaccTsdbInstance")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = AliCloud.Tsdb.GetZones.Invoke();
 *     var exampleNetwork = new AliCloud.Vpc.Network("example", new()
 *     {
 *         CidrBlock = "192.168.0.0/16",
 *         Name = "tf-testaccTsdbInstance",
 *     });
 *     var exampleSwitch = new AliCloud.Vpc.Switch("example", new()
 *     {
 *         AvailabilityZone = example.Apply(getZonesResult => getZonesResult.Ids[0]),
 *         CidrBlock = "192.168.1.0/24",
 *         VpcId = exampleNetwork.Id,
 *     });
 *     var exampleInstance = new AliCloud.Tsdb.Instance("example", new()
 *     {
 *         PaymentType = "PayAsYouGo",
 *         VswitchId = exampleSwitch.Id,
 *         InstanceStorage = "50",
 *         InstanceClass = "tsdb.1x.basic",
 *         EngineType = "tsdb_tsdb",
 *         InstanceAlias = "tf-testaccTsdbInstance",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/tsdb"
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := tsdb.GetZones(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetwork, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
 * 			CidrBlock: pulumi.String("192.168.0.0/16"),
 * 			Name:      pulumi.String("tf-testaccTsdbInstance"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSwitch, err := vpc.NewSwitch(ctx, "example", &vpc.SwitchArgs{
 * 			AvailabilityZone: pulumi.String(example.Ids[0]),
 * 			CidrBlock:        pulumi.String("192.168.1.0/24"),
 * 			VpcId:            exampleNetwork.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = tsdb.NewInstance(ctx, "example", &tsdb.InstanceArgs{
 * 			PaymentType:     pulumi.String("PayAsYouGo"),
 * 			VswitchId:       exampleSwitch.ID(),
 * 			InstanceStorage: pulumi.String("50"),
 * 			InstanceClass:   pulumi.String("tsdb.1x.basic"),
 * 			EngineType:      pulumi.String("tsdb_tsdb"),
 * 			InstanceAlias:   pulumi.String("tf-testaccTsdbInstance"),
 * 		})
 * 		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.tsdb.TsdbFunctions;
 * import com.pulumi.alicloud.tsdb.inputs.GetZonesArgs;
 * import com.pulumi.alicloud.vpc.Network;
 * import com.pulumi.alicloud.vpc.NetworkArgs;
 * import com.pulumi.alicloud.vpc.Switch;
 * import com.pulumi.alicloud.vpc.SwitchArgs;
 * import com.pulumi.alicloud.tsdb.Instance;
 * import com.pulumi.alicloud.tsdb.InstanceArgs;
 * 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 example = TsdbFunctions.getZones();
 *         var exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
 *             .cidrBlock("192.168.0.0/16")
 *             .name("tf-testaccTsdbInstance")
 *             .build());
 *         var exampleSwitch = new Switch("exampleSwitch", SwitchArgs.builder()
 *             .availabilityZone(example.applyValue(getZonesResult -> getZonesResult.ids()[0]))
 *             .cidrBlock("192.168.1.0/24")
 *             .vpcId(exampleNetwork.id())
 *             .build());
 *         var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
 *             .paymentType("PayAsYouGo")
 *             .vswitchId(exampleSwitch.id())
 *             .instanceStorage("50")
 *             .instanceClass("tsdb.1x.basic")
 *             .engineType("tsdb_tsdb")
 *             .instanceAlias("tf-testaccTsdbInstance")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleNetwork:
 *     type: alicloud:vpc:Network
 *     name: example
 *     properties:
 *       cidrBlock: 192.168.0.0/16
 *       name: tf-testaccTsdbInstance
 *   exampleSwitch:
 *     type: alicloud:vpc:Switch
 *     name: example
 *     properties:
 *       availabilityZone: ${example.ids[0]}
 *       cidrBlock: 192.168.1.0/24
 *       vpcId: ${exampleNetwork.id}
 *   exampleInstance:
 *     type: alicloud:tsdb:Instance
 *     name: example
 *     properties:
 *       paymentType: PayAsYouGo
 *       vswitchId: ${exampleSwitch.id}
 *       instanceStorage: '50'
 *       instanceClass: tsdb.1x.basic
 *       engineType: tsdb_tsdb
 *       instanceAlias: tf-testaccTsdbInstance
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: alicloud:tsdb:getZones
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * TSDB Instance can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:tsdb/instance:Instance example 
 * ```
 */
public class Instance internal constructor(
    override val javaResource: com.pulumi.alicloud.tsdb.Instance,
) : KotlinCustomResource(javaResource, InstanceMapper) {
    /**
     * The app key.
     */
    public val appKey: Output?
        get() = javaResource.appKey().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The disk type of instance. Valid when the engine type is `tsdb_influxdb`. `cloud_ssd` refers to SSD disk, `cloud_efficiency` refers to efficiency disk, `cloud_essd` refers to ESSD PL1 disk. Valid values: `cloud_efficiency`, `cloud_essd`, `cloud_ssd`.
     */
    public val diskCategory: Output?
        get() = javaResource.diskCategory().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The duration.
     */
    public val duration: Output?
        get() = javaResource.duration().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The engine type of instance Enumerative: `tsdb_tsdb` refers to TSDB, `tsdb_influxdb` refers to TSDB for InfluxDB️.
     */
    public val engineType: Output?
        get() = javaResource.engineType().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The alias of the instance.
     */
    public val instanceAlias: Output?
        get() = javaResource.instanceAlias().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The specification of the instance.
     * - Following enumerative value for TSDB for InfluxDB️ standart edition:
     * - `influxdata.n1.mxlarge` refers to 2 CPU 8GB memory;
     * - `influxdata.n1.xlarge` refers to 4 CPU 16GB memory;
     * - `influxdata.n1.2xlarge` refers to 8 CPU 32 GB memory;
     * - `influxdata.n1.4xlarge` refers to 16 CPU 64 GB memory;
     * - `influxdata.n1.8xlarge` refers to 32 CPU 128 GB memory;
     * - `influxdata.n1.16xlarge` refers to 64 CPU 256 GB memory.
     * - Following enumerative value for TSDB for InfluxDB High-availability edition:
     * - `influxdata.n1.mxlarge_ha` refers to 2 CPU 8GB memory;
     * - `influxdata.n1.xlarge_ha` refers to 4 CPU 16GB memory;
     * - `influxdata.n1.2xlarge_ha` refers to 8 CPU 32 GB memory;
     * - `influxdata.n1.4xlarge_ha` refers to 16 CPU 64 GB memory;
     * - `influxdata.n1.8xlarge_ha` refers to 32 CPU 128 GB memory;
     * - `influxdata.n1.16xlarge_ha` refers to 64 CPU 256 GB memory.
     * - Following enumerative value for TSDB:
     * - `tsdb.1x.basic` refers to basic edition I;
     * - `tsdb.3x.basic` refers to basic edition II;
     * - `tsdb.4x.basic` refers to basic edtion III;
     * - `tsdb.12x.standard` refers to standard edition I;
     * - `tsdb.24x.standard` refers to standard edition II;
     * - `tsdb.48x.large` refers to ultimate edition I;
     * - `tsdb.96x.large` refers to ultimate edition II.
     */
    public val instanceClass: Output
        get() = javaResource.instanceClass().applyValue({ args0 -> args0 })

    /**
     * The storage capacity of the instance. Unit: GB. For example, the value 50 indicates 50 GB. Does not support shrink storage.
     */
    public val instanceStorage: Output
        get() = javaResource.instanceStorage().applyValue({ args0 -> args0 })

    /**
     * The billing method. Valid values: `PayAsYouGo` and `Subscription`. The `PayAsYouGo` value indicates the pay-as-you-go method, and the `Subscription` value indicates the subscription method.
     */
    public val paymentType: Output
        get() = javaResource.paymentType().applyValue({ args0 -> args0 })

    /**
     * Instance status, enumerative: `ACTIVATION`, `DELETED`, `CREATING`, `CLASS_CHANGING`, `LOCKED`.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * The vswitch id.
     */
    public val vswitchId: Output
        get() = javaResource.vswitchId().applyValue({ args0 -> args0 })

    /**
     * The zone ID of the instance.
     */
    public val zoneId: Output
        get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}

public object InstanceMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.alicloud.tsdb.Instance::class == javaResource::class

    override fun map(javaResource: Resource): Instance = Instance(
        javaResource as
            com.pulumi.alicloud.tsdb.Instance,
    )
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Instance].
 */
public suspend fun instance(name: String, block: suspend InstanceResourceBuilder.() -> Unit): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Instance].
 * @param name The _unique_ name of the resulting resource.
 */
public fun instance(name: String): Instance {
    val builder = InstanceResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy