github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/kms/getCustomKeyStore.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package kms 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Use this data source to get the metadata KMS custom key store. 15 // By using this data source, you can reference KMS custom key store 16 // without having to hard code the ID as input. 17 // 18 // ## Example Usage 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // _, err := kms.LookupCustomKeyStore(ctx, &kms.LookupCustomKeyStoreArgs{ 34 // CustomKeyStoreName: pulumi.StringRef("my_cloudhsm"), 35 // }, nil) 36 // if err != nil { 37 // return err 38 // } 39 // return nil 40 // }) 41 // } 42 // 43 // ``` 44 // <!--End PulumiCodeChooser --> 45 func LookupCustomKeyStore(ctx *pulumi.Context, args *LookupCustomKeyStoreArgs, opts ...pulumi.InvokeOption) (*LookupCustomKeyStoreResult, error) { 46 opts = internal.PkgInvokeDefaultOpts(opts) 47 var rv LookupCustomKeyStoreResult 48 err := ctx.Invoke("aws:kms/getCustomKeyStore:getCustomKeyStore", args, &rv, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &rv, nil 53 } 54 55 // A collection of arguments for invoking getCustomKeyStore. 56 type LookupCustomKeyStoreArgs struct { 57 // The ID for the custom key store. 58 CustomKeyStoreId *string `pulumi:"customKeyStoreId"` 59 // The user-specified friendly name for the custom key store. 60 CustomKeyStoreName *string `pulumi:"customKeyStoreName"` 61 } 62 63 // A collection of values returned by getCustomKeyStore. 64 type LookupCustomKeyStoreResult struct { 65 CloudHsmClusterId string `pulumi:"cloudHsmClusterId"` 66 // Indicates whether the custom key store is connected to its CloudHSM cluster. 67 ConnectionState string `pulumi:"connectionState"` 68 // The date and time when the custom key store was created. 69 CreationDate string `pulumi:"creationDate"` 70 CustomKeyStoreId string `pulumi:"customKeyStoreId"` 71 CustomKeyStoreName string `pulumi:"customKeyStoreName"` 72 // The provider-assigned unique ID for this managed resource. 73 Id string `pulumi:"id"` 74 // The trust anchor certificate of the associated CloudHSM cluster. 75 TrustAnchorCertificate string `pulumi:"trustAnchorCertificate"` 76 } 77 78 func LookupCustomKeyStoreOutput(ctx *pulumi.Context, args LookupCustomKeyStoreOutputArgs, opts ...pulumi.InvokeOption) LookupCustomKeyStoreResultOutput { 79 return pulumi.ToOutputWithContext(context.Background(), args). 80 ApplyT(func(v interface{}) (LookupCustomKeyStoreResult, error) { 81 args := v.(LookupCustomKeyStoreArgs) 82 r, err := LookupCustomKeyStore(ctx, &args, opts...) 83 var s LookupCustomKeyStoreResult 84 if r != nil { 85 s = *r 86 } 87 return s, err 88 }).(LookupCustomKeyStoreResultOutput) 89 } 90 91 // A collection of arguments for invoking getCustomKeyStore. 92 type LookupCustomKeyStoreOutputArgs struct { 93 // The ID for the custom key store. 94 CustomKeyStoreId pulumi.StringPtrInput `pulumi:"customKeyStoreId"` 95 // The user-specified friendly name for the custom key store. 96 CustomKeyStoreName pulumi.StringPtrInput `pulumi:"customKeyStoreName"` 97 } 98 99 func (LookupCustomKeyStoreOutputArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*LookupCustomKeyStoreArgs)(nil)).Elem() 101 } 102 103 // A collection of values returned by getCustomKeyStore. 104 type LookupCustomKeyStoreResultOutput struct{ *pulumi.OutputState } 105 106 func (LookupCustomKeyStoreResultOutput) ElementType() reflect.Type { 107 return reflect.TypeOf((*LookupCustomKeyStoreResult)(nil)).Elem() 108 } 109 110 func (o LookupCustomKeyStoreResultOutput) ToLookupCustomKeyStoreResultOutput() LookupCustomKeyStoreResultOutput { 111 return o 112 } 113 114 func (o LookupCustomKeyStoreResultOutput) ToLookupCustomKeyStoreResultOutputWithContext(ctx context.Context) LookupCustomKeyStoreResultOutput { 115 return o 116 } 117 118 func (o LookupCustomKeyStoreResultOutput) CloudHsmClusterId() pulumi.StringOutput { 119 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.CloudHsmClusterId }).(pulumi.StringOutput) 120 } 121 122 // Indicates whether the custom key store is connected to its CloudHSM cluster. 123 func (o LookupCustomKeyStoreResultOutput) ConnectionState() pulumi.StringOutput { 124 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.ConnectionState }).(pulumi.StringOutput) 125 } 126 127 // The date and time when the custom key store was created. 128 func (o LookupCustomKeyStoreResultOutput) CreationDate() pulumi.StringOutput { 129 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.CreationDate }).(pulumi.StringOutput) 130 } 131 132 func (o LookupCustomKeyStoreResultOutput) CustomKeyStoreId() pulumi.StringOutput { 133 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.CustomKeyStoreId }).(pulumi.StringOutput) 134 } 135 136 func (o LookupCustomKeyStoreResultOutput) CustomKeyStoreName() pulumi.StringOutput { 137 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.CustomKeyStoreName }).(pulumi.StringOutput) 138 } 139 140 // The provider-assigned unique ID for this managed resource. 141 func (o LookupCustomKeyStoreResultOutput) Id() pulumi.StringOutput { 142 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.Id }).(pulumi.StringOutput) 143 } 144 145 // The trust anchor certificate of the associated CloudHSM cluster. 146 func (o LookupCustomKeyStoreResultOutput) TrustAnchorCertificate() pulumi.StringOutput { 147 return o.ApplyT(func(v LookupCustomKeyStoreResult) string { return v.TrustAnchorCertificate }).(pulumi.StringOutput) 148 } 149 150 func init() { 151 pulumi.RegisterOutputType(LookupCustomKeyStoreResultOutput{}) 152 }