AWS Classic

v5.21.1 published on Thursday, Nov 17, 2022 by Pulumi

CustomKeyStore

Resource for managing an AWS KMS (Key Management) Custom Key Store.

Example Usage

Basic Usage

using System.Collections.Generic;
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = new Aws.Kms.CustomKeyStore("test", new()
    {
        CloudHsmClusterId = @var.Cloud_hsm_cluster_id,
        CustomKeyStoreName = "kms-custom-key-store-test",
        KeyStorePassword = "noplaintextpasswords1",
        TrustAnchorCertificate = File.ReadAllText("anchor-certificate.crt"),
    });

});
package main

import (
	"io/ioutil"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/kms"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func readFileOrPanic(path string) pulumi.StringPtrInput {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		panic(err.Error())
	}
	return pulumi.String(string(data))
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := kms.NewCustomKeyStore(ctx, "test", &kms.CustomKeyStoreArgs{
			CloudHsmClusterId:      pulumi.Any(_var.Cloud_hsm_cluster_id),
			CustomKeyStoreName:     pulumi.String("kms-custom-key-store-test"),
			KeyStorePassword:       pulumi.String("noplaintextpasswords1"),
			TrustAnchorCertificate: readFileOrPanic("anchor-certificate.crt"),
		})
		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.aws.kms.CustomKeyStore;
import com.pulumi.aws.kms.CustomKeyStoreArgs;
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) {
        var test = new CustomKeyStore("test", CustomKeyStoreArgs.builder()        
            .cloudHsmClusterId(var_.cloud_hsm_cluster_id())
            .customKeyStoreName("kms-custom-key-store-test")
            .keyStorePassword("noplaintextpasswords1")
            .trustAnchorCertificate(Files.readString(Paths.get("anchor-certificate.crt")))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

test = aws.kms.CustomKeyStore("test",
    cloud_hsm_cluster_id=var["cloud_hsm_cluster_id"],
    custom_key_store_name="kms-custom-key-store-test",
    key_store_password="noplaintextpasswords1",
    trust_anchor_certificate=(lambda path: open(path).read())("anchor-certificate.crt"))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as fs from "fs";

const test = new aws.kms.CustomKeyStore("test", {
    cloudHsmClusterId: _var.cloud_hsm_cluster_id,
    customKeyStoreName: "kms-custom-key-store-test",
    keyStorePassword: "noplaintextpasswords1",
    trustAnchorCertificate: fs.readFileSync("anchor-certificate.crt"),
});

Coming soon!

Create CustomKeyStore Resource

new CustomKeyStore(name: string, args: CustomKeyStoreArgs, opts?: CustomResourceOptions);
@overload
def CustomKeyStore(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   cloud_hsm_cluster_id: Optional[str] = None,
                   custom_key_store_name: Optional[str] = None,
                   key_store_password: Optional[str] = None,
                   trust_anchor_certificate: Optional[str] = None)
@overload
def CustomKeyStore(resource_name: str,
                   args: CustomKeyStoreArgs,
                   opts: Optional[ResourceOptions] = None)
func NewCustomKeyStore(ctx *Context, name string, args CustomKeyStoreArgs, opts ...ResourceOption) (*CustomKeyStore, error)
public CustomKeyStore(string name, CustomKeyStoreArgs args, CustomResourceOptions? opts = null)
public CustomKeyStore(String name, CustomKeyStoreArgs args)
public CustomKeyStore(String name, CustomKeyStoreArgs args, CustomResourceOptions options)
type: aws:kms:CustomKeyStore
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CustomKeyStoreArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CustomKeyStoreArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CustomKeyStoreArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CustomKeyStoreArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CustomKeyStoreArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CustomKeyStore Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CustomKeyStore resource accepts the following input properties:

CloudHsmClusterId string

Cluster ID of CloudHSM.

CustomKeyStoreName string

Unique name for Custom Key Store.

KeyStorePassword string

Password for kmsuser on CloudHSM.

TrustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

CloudHsmClusterId string

Cluster ID of CloudHSM.

CustomKeyStoreName string

Unique name for Custom Key Store.

KeyStorePassword string

Password for kmsuser on CloudHSM.

TrustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId String

Cluster ID of CloudHSM.

customKeyStoreName String

Unique name for Custom Key Store.

keyStorePassword String

Password for kmsuser on CloudHSM.

trustAnchorCertificate String

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId string

Cluster ID of CloudHSM.

customKeyStoreName string

Unique name for Custom Key Store.

keyStorePassword string

Password for kmsuser on CloudHSM.

trustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

cloud_hsm_cluster_id str

Cluster ID of CloudHSM.

custom_key_store_name str

Unique name for Custom Key Store.

key_store_password str

Password for kmsuser on CloudHSM.

trust_anchor_certificate str

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId String

Cluster ID of CloudHSM.

customKeyStoreName String

Unique name for Custom Key Store.

keyStorePassword String

Password for kmsuser on CloudHSM.

trustAnchorCertificate String

Customer certificate used for signing on CloudHSM.

Outputs

All input properties are implicitly available as output properties. Additionally, the CustomKeyStore resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing CustomKeyStore Resource

Get an existing CustomKeyStore resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CustomKeyStoreState, opts?: CustomResourceOptions): CustomKeyStore
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cloud_hsm_cluster_id: Optional[str] = None,
        custom_key_store_name: Optional[str] = None,
        key_store_password: Optional[str] = None,
        trust_anchor_certificate: Optional[str] = None) -> CustomKeyStore
func GetCustomKeyStore(ctx *Context, name string, id IDInput, state *CustomKeyStoreState, opts ...ResourceOption) (*CustomKeyStore, error)
public static CustomKeyStore Get(string name, Input<string> id, CustomKeyStoreState? state, CustomResourceOptions? opts = null)
public static CustomKeyStore get(String name, Output<String> id, CustomKeyStoreState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CloudHsmClusterId string

Cluster ID of CloudHSM.

CustomKeyStoreName string

Unique name for Custom Key Store.

KeyStorePassword string

Password for kmsuser on CloudHSM.

TrustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

CloudHsmClusterId string

Cluster ID of CloudHSM.

CustomKeyStoreName string

Unique name for Custom Key Store.

KeyStorePassword string

Password for kmsuser on CloudHSM.

TrustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId String

Cluster ID of CloudHSM.

customKeyStoreName String

Unique name for Custom Key Store.

keyStorePassword String

Password for kmsuser on CloudHSM.

trustAnchorCertificate String

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId string

Cluster ID of CloudHSM.

customKeyStoreName string

Unique name for Custom Key Store.

keyStorePassword string

Password for kmsuser on CloudHSM.

trustAnchorCertificate string

Customer certificate used for signing on CloudHSM.

cloud_hsm_cluster_id str

Cluster ID of CloudHSM.

custom_key_store_name str

Unique name for Custom Key Store.

key_store_password str

Password for kmsuser on CloudHSM.

trust_anchor_certificate str

Customer certificate used for signing on CloudHSM.

cloudHsmClusterId String

Cluster ID of CloudHSM.

customKeyStoreName String

Unique name for Custom Key Store.

keyStorePassword String

Password for kmsuser on CloudHSM.

trustAnchorCertificate String

Customer certificate used for signing on CloudHSM.

Import

KMS (Key Management) Custom Key Store can be imported using the id, e.g.,

 $ pulumi import aws:kms/customKeyStore:CustomKeyStore example cks-5ebd4ef395a96288e

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.