1. Packages
  2. AWS Classic
  3. API Docs
  4. kms
  5. CustomKeyStore

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

aws.kms.CustomKeyStore

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi

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

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as std from "@pulumi/std";
    
    const test = new aws.kms.CustomKeyStore("test", {
        cloudHsmClusterId: cloudHsmClusterId,
        customKeyStoreName: "kms-custom-key-store-test",
        keyStorePassword: "noplaintextpasswords1",
        trustAnchorCertificate: std.file({
            input: "anchor-certificate.crt",
        }).then(invoke => invoke.result),
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_std as std
    
    test = aws.kms.CustomKeyStore("test",
        cloud_hsm_cluster_id=cloud_hsm_cluster_id,
        custom_key_store_name="kms-custom-key-store-test",
        key_store_password="noplaintextpasswords1",
        trust_anchor_certificate=std.file(input="anchor-certificate.crt").result)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		invokeFile, err := std.File(ctx, &std.FileArgs{
    			Input: "anchor-certificate.crt",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = kms.NewCustomKeyStore(ctx, "test", &kms.CustomKeyStoreArgs{
    			CloudHsmClusterId:      pulumi.Any(cloudHsmClusterId),
    			CustomKeyStoreName:     pulumi.String("kms-custom-key-store-test"),
    			KeyStorePassword:       pulumi.String("noplaintextpasswords1"),
    			TrustAnchorCertificate: invokeFile.Result,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Aws.Kms.CustomKeyStore("test", new()
        {
            CloudHsmClusterId = cloudHsmClusterId,
            CustomKeyStoreName = "kms-custom-key-store-test",
            KeyStorePassword = "noplaintextpasswords1",
            TrustAnchorCertificate = Std.File.Invoke(new()
            {
                Input = "anchor-certificate.crt",
            }).Apply(invoke => invoke.Result),
        });
    
    });
    
    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(cloudHsmClusterId)
                .customKeyStoreName("kms-custom-key-store-test")
                .keyStorePassword("noplaintextpasswords1")
                .trustAnchorCertificate(StdFunctions.file(FileArgs.builder()
                    .input("anchor-certificate.crt")
                    .build()).result())
                .build());
    
        }
    }
    
    resources:
      test:
        type: aws:kms:CustomKeyStore
        properties:
          cloudHsmClusterId: ${cloudHsmClusterId}
          customKeyStoreName: kms-custom-key-store-test
          keyStorePassword: noplaintextpasswords1
          trustAnchorCertificate:
            fn::invoke:
              Function: std:file
              Arguments:
                input: anchor-certificate.crt
              Return: result
    

    Create CustomKeyStore Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomKeyStore(name: string, args: CustomKeyStoreArgs, opts?: CustomResourceOptions);
    @overload
    def CustomKeyStore(resource_name: str,
                       args: CustomKeyStoreArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @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)
    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.
    
    

    Parameters

    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.

    Example

    The following reference example uses placeholder values for all input properties.

    var customKeyStoreResource = new Aws.Kms.CustomKeyStore("customKeyStoreResource", new()
    {
        CloudHsmClusterId = "string",
        CustomKeyStoreName = "string",
        KeyStorePassword = "string",
        TrustAnchorCertificate = "string",
    });
    
    example, err := kms.NewCustomKeyStore(ctx, "customKeyStoreResource", &kms.CustomKeyStoreArgs{
    	CloudHsmClusterId:      pulumi.String("string"),
    	CustomKeyStoreName:     pulumi.String("string"),
    	KeyStorePassword:       pulumi.String("string"),
    	TrustAnchorCertificate: pulumi.String("string"),
    })
    
    var customKeyStoreResource = new CustomKeyStore("customKeyStoreResource", CustomKeyStoreArgs.builder()        
        .cloudHsmClusterId("string")
        .customKeyStoreName("string")
        .keyStorePassword("string")
        .trustAnchorCertificate("string")
        .build());
    
    custom_key_store_resource = aws.kms.CustomKeyStore("customKeyStoreResource",
        cloud_hsm_cluster_id="string",
        custom_key_store_name="string",
        key_store_password="string",
        trust_anchor_certificate="string")
    
    const customKeyStoreResource = new aws.kms.CustomKeyStore("customKeyStoreResource", {
        cloudHsmClusterId: "string",
        customKeyStoreName: "string",
        keyStorePassword: "string",
        trustAnchorCertificate: "string",
    });
    
    type: aws:kms:CustomKeyStore
    properties:
        cloudHsmClusterId: string
        customKeyStoreName: string
        keyStorePassword: string
        trustAnchorCertificate: string
    

    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

    Using pulumi import, import KMS (Key Management) Custom Key Store using the id. For example:

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

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.31.1 published on Thursday, Apr 18, 2024 by Pulumi