com.pulumi.aws.cloudhsmv2.kotlin.HsmArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-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.aws.cloudhsmv2.kotlin
import com.pulumi.aws.cloudhsmv2.HsmArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Creates an HSM module in Amazon CloudHSM v2 cluster.
* ## Example Usage
* The following example below creates an HSM module in CloudHSM cluster.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const cluster = aws.cloudhsmv2.getCluster({
* clusterId: cloudhsmClusterId,
* });
* const cloudhsmV2Hsm = new aws.cloudhsmv2.Hsm("cloudhsm_v2_hsm", {
* subnetId: cluster.then(cluster => cluster.subnetIds?.[0]),
* clusterId: cluster.then(cluster => cluster.clusterId),
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* cluster = aws.cloudhsmv2.get_cluster(cluster_id=cloudhsm_cluster_id)
* cloudhsm_v2_hsm = aws.cloudhsmv2.Hsm("cloudhsm_v2_hsm",
* subnet_id=cluster.subnet_ids[0],
* cluster_id=cluster.cluster_id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var cluster = Aws.CloudHsmV2.GetCluster.Invoke(new()
* {
* ClusterId = cloudhsmClusterId,
* });
* var cloudhsmV2Hsm = new Aws.CloudHsmV2.Hsm("cloudhsm_v2_hsm", new()
* {
* SubnetId = cluster.Apply(getClusterResult => getClusterResult.SubnetIds[0]),
* ClusterId = cluster.Apply(getClusterResult => getClusterResult.ClusterId),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudhsmv2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* cluster, err := cloudhsmv2.LookupCluster(ctx, &cloudhsmv2.LookupClusterArgs{
* ClusterId: cloudhsmClusterId,
* }, nil)
* if err != nil {
* return err
* }
* _, err = cloudhsmv2.NewHsm(ctx, "cloudhsm_v2_hsm", &cloudhsmv2.HsmArgs{
* SubnetId: pulumi.String(cluster.SubnetIds[0]),
* ClusterId: pulumi.String(cluster.ClusterId),
* })
* 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.cloudhsmv2.Cloudhsmv2Functions;
* import com.pulumi.aws.cloudhsmv2.inputs.GetClusterArgs;
* import com.pulumi.aws.cloudhsmv2.Hsm;
* import com.pulumi.aws.cloudhsmv2.HsmArgs;
* 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 cluster = Cloudhsmv2Functions.getCluster(GetClusterArgs.builder()
* .clusterId(cloudhsmClusterId)
* .build());
* var cloudhsmV2Hsm = new Hsm("cloudhsmV2Hsm", HsmArgs.builder()
* .subnetId(cluster.applyValue(getClusterResult -> getClusterResult.subnetIds()[0]))
* .clusterId(cluster.applyValue(getClusterResult -> getClusterResult.clusterId()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* cloudhsmV2Hsm:
* type: aws:cloudhsmv2:Hsm
* name: cloudhsm_v2_hsm
* properties:
* subnetId: ${cluster.subnetIds[0]}
* clusterId: ${cluster.clusterId}
* variables:
* cluster:
* fn::invoke:
* Function: aws:cloudhsmv2:getCluster
* Arguments:
* clusterId: ${cloudhsmClusterId}
* ```
*
* ## Import
* Using `pulumi import`, import HSM modules using their HSM ID. For example:
* ```sh
* $ pulumi import aws:cloudhsmv2/hsm:Hsm bar hsm-quo8dahtaca
* ```
* @property availabilityZone The IDs of AZ in which HSM module will be located. Conflicts with `subnet_id`.
* @property clusterId The ID of Cloud HSM v2 cluster to which HSM will be added.
* @property ipAddress The IP address of HSM module. Must be within the CIDR of selected subnet.
* @property subnetId The ID of subnet in which HSM module will be located. Conflicts with `availability_zone`.
*/
public data class HsmArgs(
public val availabilityZone: Output? = null,
public val clusterId: Output? = null,
public val ipAddress: Output? = null,
public val subnetId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.cloudhsmv2.HsmArgs =
com.pulumi.aws.cloudhsmv2.HsmArgs.builder()
.availabilityZone(availabilityZone?.applyValue({ args0 -> args0 }))
.clusterId(clusterId?.applyValue({ args0 -> args0 }))
.ipAddress(ipAddress?.applyValue({ args0 -> args0 }))
.subnetId(subnetId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [HsmArgs].
*/
@PulumiTagMarker
public class HsmArgsBuilder internal constructor() {
private var availabilityZone: Output? = null
private var clusterId: Output? = null
private var ipAddress: Output? = null
private var subnetId: Output? = null
/**
* @param value The IDs of AZ in which HSM module will be located. Conflicts with `subnet_id`.
*/
@JvmName("udlsrahemsdqkpcq")
public suspend fun availabilityZone(`value`: Output) {
this.availabilityZone = value
}
/**
* @param value The ID of Cloud HSM v2 cluster to which HSM will be added.
*/
@JvmName("mqkyoujdbbgjyisv")
public suspend fun clusterId(`value`: Output) {
this.clusterId = value
}
/**
* @param value The IP address of HSM module. Must be within the CIDR of selected subnet.
*/
@JvmName("bvkjldcpjmsoomla")
public suspend fun ipAddress(`value`: Output) {
this.ipAddress = value
}
/**
* @param value The ID of subnet in which HSM module will be located. Conflicts with `availability_zone`.
*/
@JvmName("ktkospifqexggfnw")
public suspend fun subnetId(`value`: Output) {
this.subnetId = value
}
/**
* @param value The IDs of AZ in which HSM module will be located. Conflicts with `subnet_id`.
*/
@JvmName("cdxrclkasklpynmg")
public suspend fun availabilityZone(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.availabilityZone = mapped
}
/**
* @param value The ID of Cloud HSM v2 cluster to which HSM will be added.
*/
@JvmName("crxwsucetqjjgkry")
public suspend fun clusterId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.clusterId = mapped
}
/**
* @param value The IP address of HSM module. Must be within the CIDR of selected subnet.
*/
@JvmName("sefdxamxrrobyckd")
public suspend fun ipAddress(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipAddress = mapped
}
/**
* @param value The ID of subnet in which HSM module will be located. Conflicts with `availability_zone`.
*/
@JvmName("uglrhhlatwmbpejs")
public suspend fun subnetId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.subnetId = mapped
}
internal fun build(): HsmArgs = HsmArgs(
availabilityZone = availabilityZone,
clusterId = clusterId,
ipAddress = ipAddress,
subnetId = subnetId,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy