com.pulumi.alicloud.kms.kotlin.InstanceArgs.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.kms.kotlin
import com.pulumi.alicloud.kms.InstanceArgs.builder
import com.pulumi.alicloud.kms.kotlin.inputs.InstanceBindVpcArgs
import com.pulumi.alicloud.kms.kotlin.inputs.InstanceBindVpcArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a KMS Instance resource.
* For information about KMS Instance and how to use it, see [What is Instance](https://www.alibabacloud.com/help/zh/key-management-service/latest/kms-instance-management).
* > **NOTE:** Available since v1.210.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 = alicloud.vpc.getNetworks({
* nameRegex: "^default-NODELETING$",
* cidrBlock: "172.16.0.0/16",
* });
* const defaultGetSwitches = _default.then(_default => alicloud.vpc.getSwitches({
* vpcId: _default.ids?.[0],
* zoneId: "cn-hangzhou-h",
* }));
* const defaultInstance = new alicloud.kms.Instance("default", {
* productVersion: "3",
* vpcId: _default.then(_default => _default.ids?.[0]),
* zoneIds: [
* "cn-hangzhou-h",
* "cn-hangzhou-g",
* ],
* vswitchIds: [defaultGetSwitches.then(defaultGetSwitches => defaultGetSwitches.ids?.[0])],
* vpcNum: 1,
* keyNum: 1000,
* secretNum: 0,
* spec: 1000,
* });
* ```
* ```python
* import pulumi
* import pulumi_alicloud as alicloud
* config = pulumi.Config()
* name = config.get("name")
* if name is None:
* name = "terraform-example"
* default = alicloud.vpc.get_networks(name_regex="^default-NODELETING$",
* cidr_block="172.16.0.0/16")
* default_get_switches = alicloud.vpc.get_switches(vpc_id=default.ids[0],
* zone_id="cn-hangzhou-h")
* default_instance = alicloud.kms.Instance("default",
* product_version="3",
* vpc_id=default.ids[0],
* zone_ids=[
* "cn-hangzhou-h",
* "cn-hangzhou-g",
* ],
* vswitch_ids=[default_get_switches.ids[0]],
* vpc_num=1,
* key_num=1000,
* secret_num=0,
* spec=1000)
* ```
* ```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 = AliCloud.Vpc.GetNetworks.Invoke(new()
* {
* NameRegex = "^default-NODELETING$",
* CidrBlock = "172.16.0.0/16",
* });
* var defaultGetSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
* {
* VpcId = @default.Apply(getNetworksResult => getNetworksResult.Ids[0]),
* ZoneId = "cn-hangzhou-h",
* });
* var defaultInstance = new AliCloud.Kms.Instance("default", new()
* {
* ProductVersion = "3",
* VpcId = @default.Apply(@default => @default.Apply(getNetworksResult => getNetworksResult.Ids[0])),
* ZoneIds = new[]
* {
* "cn-hangzhou-h",
* "cn-hangzhou-g",
* },
* VswitchIds = new[]
* {
* defaultGetSwitches.Apply(getSwitchesResult => getSwitchesResult.Ids[0]),
* },
* VpcNum = 1,
* KeyNum = 1000,
* SecretNum = 0,
* Spec = 1000,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
* "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
* "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
* }
* _default, err := vpc.GetNetworks(ctx, &vpc.GetNetworksArgs{
* NameRegex: pulumi.StringRef("^default-NODELETING$"),
* CidrBlock: pulumi.StringRef("172.16.0.0/16"),
* }, nil)
* if err != nil {
* return err
* }
* defaultGetSwitches, err := vpc.GetSwitches(ctx, &vpc.GetSwitchesArgs{
* VpcId: pulumi.StringRef(_default.Ids[0]),
* ZoneId: pulumi.StringRef("cn-hangzhou-h"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = kms.NewInstance(ctx, "default", &kms.InstanceArgs{
* ProductVersion: pulumi.String("3"),
* VpcId: pulumi.String(_default.Ids[0]),
* ZoneIds: pulumi.StringArray{
* pulumi.String("cn-hangzhou-h"),
* pulumi.String("cn-hangzhou-g"),
* },
* VswitchIds: pulumi.StringArray{
* pulumi.String(defaultGetSwitches.Ids[0]),
* },
* VpcNum: pulumi.Int(1),
* KeyNum: pulumi.Int(1000),
* SecretNum: pulumi.Int(0),
* Spec: pulumi.Int(1000),
* })
* 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.vpc.VpcFunctions;
* import com.pulumi.alicloud.vpc.inputs.GetNetworksArgs;
* import com.pulumi.alicloud.vpc.inputs.GetSwitchesArgs;
* import com.pulumi.alicloud.kms.Instance;
* import com.pulumi.alicloud.kms.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 config = ctx.config();
* final var name = config.get("name").orElse("terraform-example");
* final var default = VpcFunctions.getNetworks(GetNetworksArgs.builder()
* .nameRegex("^default-NODELETING$")
* .cidrBlock("172.16.0.0/16")
* .build());
* final var defaultGetSwitches = VpcFunctions.getSwitches(GetSwitchesArgs.builder()
* .vpcId(default_.ids()[0])
* .zoneId("cn-hangzhou-h")
* .build());
* var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
* .productVersion("3")
* .vpcId(default_.ids()[0])
* .zoneIds(
* "cn-hangzhou-h",
* "cn-hangzhou-g")
* .vswitchIds(defaultGetSwitches.applyValue(getSwitchesResult -> getSwitchesResult.ids()[0]))
* .vpcNum("1")
* .keyNum("1000")
* .secretNum("0")
* .spec("1000")
* .build());
* }
* }
* ```
* ```yaml
* configuration:
* name:
* type: string
* default: terraform-example
* resources:
* defaultInstance:
* type: alicloud:kms:Instance
* name: default
* properties:
* productVersion: '3'
* vpcId: ${default.ids[0]}
* zoneIds:
* - cn-hangzhou-h
* - cn-hangzhou-g
* vswitchIds:
* - ${defaultGetSwitches.ids[0]}
* vpcNum: '1'
* keyNum: '1000'
* secretNum: '0'
* spec: '1000'
* variables:
* default:
* fn::invoke:
* Function: alicloud:vpc:getNetworks
* Arguments:
* nameRegex: ^default-NODELETING$
* cidrBlock: 172.16.0.0/16
* defaultGetSwitches:
* fn::invoke:
* Function: alicloud:vpc:getSwitches
* Arguments:
* vpcId: ${default.ids[0]}
* zoneId: cn-hangzhou-h
* ```
*
* ## Import
* KMS Instance can be imported using the id, e.g.
* ```sh
* $ pulumi import alicloud:kms/instance:Instance example
* ```
* @property bindVpcs Aucillary VPCs used to access this KMS instance. See `bind_vpcs` below.
* @property forceDeleteWithoutBackup Whether to force deletion even without backup.
* @property keyNum Maximum number of stored keys. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property log Instance Audit Log Switch. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property logStorage Instance log capacity. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property paymentType Payment type, valid values: `Subscription`: Prepaid. `PayAsYouGo`: Postpaid, available since v1.223.2.
* @property period Purchase cycle, in months. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property productVersion KMS Instance commodity type (software/hardware).
* @property renewPeriod Automatic renewal period, in months. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property renewStatus Renewal options. Valid values: `AutoRenewal`, `ManualRenewal`. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property secretNum Maximum number of Secrets. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property spec The computation performance level of the KMS instance. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property vpcId Instance VPC id.
* @property vpcNum The number of managed accesses. The maximum number of VPCs that can access this KMS instance. The attribute is valid when the attribute `payment_type` is `Subscription`.
* @property vswitchIds Instance bind vswitches.
* @property zoneIds zone id.
*/
public data class InstanceArgs(
public val bindVpcs: Output>? = null,
public val forceDeleteWithoutBackup: Output? = null,
public val keyNum: Output? = null,
public val log: Output? = null,
public val logStorage: Output? = null,
public val paymentType: Output? = null,
public val period: Output? = null,
public val productVersion: Output? = null,
public val renewPeriod: Output? = null,
public val renewStatus: Output? = null,
public val secretNum: Output? = null,
public val spec: Output? = null,
public val vpcId: Output? = null,
public val vpcNum: Output? = null,
public val vswitchIds: Output>? = null,
public val zoneIds: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.alicloud.kms.InstanceArgs =
com.pulumi.alicloud.kms.InstanceArgs.builder()
.bindVpcs(
bindVpcs?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.forceDeleteWithoutBackup(forceDeleteWithoutBackup?.applyValue({ args0 -> args0 }))
.keyNum(keyNum?.applyValue({ args0 -> args0 }))
.log(log?.applyValue({ args0 -> args0 }))
.logStorage(logStorage?.applyValue({ args0 -> args0 }))
.paymentType(paymentType?.applyValue({ args0 -> args0 }))
.period(period?.applyValue({ args0 -> args0 }))
.productVersion(productVersion?.applyValue({ args0 -> args0 }))
.renewPeriod(renewPeriod?.applyValue({ args0 -> args0 }))
.renewStatus(renewStatus?.applyValue({ args0 -> args0 }))
.secretNum(secretNum?.applyValue({ args0 -> args0 }))
.spec(spec?.applyValue({ args0 -> args0 }))
.vpcId(vpcId?.applyValue({ args0 -> args0 }))
.vpcNum(vpcNum?.applyValue({ args0 -> args0 }))
.vswitchIds(vswitchIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.zoneIds(zoneIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}
/**
* Builder for [InstanceArgs].
*/
@PulumiTagMarker
public class InstanceArgsBuilder internal constructor() {
private var bindVpcs: Output>? = null
private var forceDeleteWithoutBackup: Output? = null
private var keyNum: Output? = null
private var log: Output? = null
private var logStorage: Output? = null
private var paymentType: Output? = null
private var period: Output? = null
private var productVersion: Output? = null
private var renewPeriod: Output? = null
private var renewStatus: Output? = null
private var secretNum: Output? = null
private var spec: Output? = null
private var vpcId: Output? = null
private var vpcNum: Output? = null
private var vswitchIds: Output>? = null
private var zoneIds: Output>? = null
/**
* @param value Aucillary VPCs used to access this KMS instance. See `bind_vpcs` below.
*/
@JvmName("cgsieejokvdvwnft")
public suspend fun bindVpcs(`value`: Output>) {
this.bindVpcs = value
}
@JvmName("xaifopcvvsckgaqo")
public suspend fun bindVpcs(vararg values: Output) {
this.bindVpcs = Output.all(values.asList())
}
/**
* @param values Aucillary VPCs used to access this KMS instance. See `bind_vpcs` below.
*/
@JvmName("mneyvyfwgwwssulv")
public suspend fun bindVpcs(values: List