InstanceArgs

data class InstanceArgs(val bindVpcs: Output<List<InstanceBindVpcArgs>>? = null, val forceDeleteWithoutBackup: Output<String>? = null, val keyNum: Output<Int>? = null, val log: Output<String>? = null, val logStorage: Output<Int>? = null, val paymentType: Output<String>? = null, val period: Output<Int>? = null, val productVersion: Output<String>? = null, val renewPeriod: Output<Int>? = null, val renewStatus: Output<String>? = null, val secretNum: Output<Int>? = null, val spec: Output<Int>? = null, val vpcId: Output<String>? = null, val vpcNum: Output<Int>? = null, val vswitchIds: Output<List<String>>? = null, val zoneIds: Output<List<String>>? = null) : ConvertibleToJava<InstanceArgs>

Provides a KMS Instance resource. For information about KMS Instance and how to use it, see What is Instance.

NOTE: Available since v1.210.0.

Example Usage

Basic Usage

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&#46;then(defaultGetSwitches => defaultGetSwitches&#46;ids?&#46;[0])],
vpcNum: 1,
keyNum: 1000,
secretNum: 0,
spec: 1000,
});
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&#46;ids[0]],
vpc_num=1,
key_num=1000,
secret_num=0,
spec=1000)
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,
});
});
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
})
}
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());
}
}
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.

$ pulumi import alicloud:kms/instance:Instance example <id>

Constructors

Link copied to clipboard
constructor(bindVpcs: Output<List<InstanceBindVpcArgs>>? = null, forceDeleteWithoutBackup: Output<String>? = null, keyNum: Output<Int>? = null, log: Output<String>? = null, logStorage: Output<Int>? = null, paymentType: Output<String>? = null, period: Output<Int>? = null, productVersion: Output<String>? = null, renewPeriod: Output<Int>? = null, renewStatus: Output<String>? = null, secretNum: Output<Int>? = null, spec: Output<Int>? = null, vpcId: Output<String>? = null, vpcNum: Output<Int>? = null, vswitchIds: Output<List<String>>? = null, zoneIds: Output<List<String>>? = null)

Properties

Link copied to clipboard
val bindVpcs: Output<List<InstanceBindVpcArgs>>? = null

Aucillary VPCs used to access this KMS instance. See bind_vpcs below.

Link copied to clipboard
val forceDeleteWithoutBackup: Output<String>? = null

Whether to force deletion even without backup.

Link copied to clipboard
val keyNum: Output<Int>? = null

Maximum number of stored keys. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val log: Output<String>? = null

Instance Audit Log Switch. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val logStorage: Output<Int>? = null

Instance log capacity. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val paymentType: Output<String>? = null

Payment type, valid values: Subscription: Prepaid. PayAsYouGo: Postpaid, available since v1.223.2.

Link copied to clipboard
val period: Output<Int>? = null

Purchase cycle, in months. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val productVersion: Output<String>? = null

KMS Instance commodity type (software/hardware).

Link copied to clipboard
val renewPeriod: Output<Int>? = null

Automatic renewal period, in months. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val renewStatus: Output<String>? = null

Renewal options. Valid values: AutoRenewal, ManualRenewal. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val secretNum: Output<Int>? = null

Maximum number of Secrets. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val spec: Output<Int>? = null

The computation performance level of the KMS instance. The attribute is valid when the attribute payment_type is Subscription.

Link copied to clipboard
val vpcId: Output<String>? = null

Instance VPC id.

Link copied to clipboard
val vpcNum: Output<Int>? = null

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.

Link copied to clipboard
val vswitchIds: Output<List<String>>? = null

Instance bind vswitches.

Link copied to clipboard
val zoneIds: Output<List<String>>? = null

zone id.

Functions

Link copied to clipboard
open override fun toJava(): InstanceArgs