github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/hsmClientCertificate.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 redshift
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Creates an HSM client certificate that an Amazon Redshift cluster will use to connect to the client's HSM in order to store and retrieve the keys used to encrypt the cluster databases.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := redshift.NewHsmClientCertificate(ctx, "example", &redshift.HsmClientCertificateArgs{
    33  //				HsmClientCertificateIdentifier: pulumi.String("example"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import Redshift HSM Client Certificates using `hsm_client_certificate_identifier`. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:redshift/hsmClientCertificate:HsmClientCertificate test example
    51  // ```
    52  type HsmClientCertificate struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// The identifier of the HSM client certificate.
    58  	HsmClientCertificateIdentifier pulumi.StringOutput `pulumi:"hsmClientCertificateIdentifier"`
    59  	// The public key that the Amazon Redshift cluster will use to connect to the HSM. You must register the public key in the HSM.
    60  	HsmClientCertificatePublicKey pulumi.StringOutput `pulumi:"hsmClientCertificatePublicKey"`
    61  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    62  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    63  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    64  	//
    65  	// Deprecated: Please use `tags` instead.
    66  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    67  }
    68  
    69  // NewHsmClientCertificate registers a new resource with the given unique name, arguments, and options.
    70  func NewHsmClientCertificate(ctx *pulumi.Context,
    71  	name string, args *HsmClientCertificateArgs, opts ...pulumi.ResourceOption) (*HsmClientCertificate, error) {
    72  	if args == nil {
    73  		return nil, errors.New("missing one or more required arguments")
    74  	}
    75  
    76  	if args.HsmClientCertificateIdentifier == nil {
    77  		return nil, errors.New("invalid value for required argument 'HsmClientCertificateIdentifier'")
    78  	}
    79  	opts = internal.PkgResourceDefaultOpts(opts)
    80  	var resource HsmClientCertificate
    81  	err := ctx.RegisterResource("aws:redshift/hsmClientCertificate:HsmClientCertificate", name, args, &resource, opts...)
    82  	if err != nil {
    83  		return nil, err
    84  	}
    85  	return &resource, nil
    86  }
    87  
    88  // GetHsmClientCertificate gets an existing HsmClientCertificate resource's state with the given name, ID, and optional
    89  // state properties that are used to uniquely qualify the lookup (nil if not required).
    90  func GetHsmClientCertificate(ctx *pulumi.Context,
    91  	name string, id pulumi.IDInput, state *HsmClientCertificateState, opts ...pulumi.ResourceOption) (*HsmClientCertificate, error) {
    92  	var resource HsmClientCertificate
    93  	err := ctx.ReadResource("aws:redshift/hsmClientCertificate:HsmClientCertificate", name, id, state, &resource, opts...)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &resource, nil
    98  }
    99  
   100  // Input properties used for looking up and filtering HsmClientCertificate resources.
   101  type hsmClientCertificateState struct {
   102  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
   103  	Arn *string `pulumi:"arn"`
   104  	// The identifier of the HSM client certificate.
   105  	HsmClientCertificateIdentifier *string `pulumi:"hsmClientCertificateIdentifier"`
   106  	// The public key that the Amazon Redshift cluster will use to connect to the HSM. You must register the public key in the HSM.
   107  	HsmClientCertificatePublicKey *string `pulumi:"hsmClientCertificatePublicKey"`
   108  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   109  	Tags map[string]string `pulumi:"tags"`
   110  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   111  	//
   112  	// Deprecated: Please use `tags` instead.
   113  	TagsAll map[string]string `pulumi:"tagsAll"`
   114  }
   115  
   116  type HsmClientCertificateState struct {
   117  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
   118  	Arn pulumi.StringPtrInput
   119  	// The identifier of the HSM client certificate.
   120  	HsmClientCertificateIdentifier pulumi.StringPtrInput
   121  	// The public key that the Amazon Redshift cluster will use to connect to the HSM. You must register the public key in the HSM.
   122  	HsmClientCertificatePublicKey pulumi.StringPtrInput
   123  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   124  	Tags pulumi.StringMapInput
   125  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   126  	//
   127  	// Deprecated: Please use `tags` instead.
   128  	TagsAll pulumi.StringMapInput
   129  }
   130  
   131  func (HsmClientCertificateState) ElementType() reflect.Type {
   132  	return reflect.TypeOf((*hsmClientCertificateState)(nil)).Elem()
   133  }
   134  
   135  type hsmClientCertificateArgs struct {
   136  	// The identifier of the HSM client certificate.
   137  	HsmClientCertificateIdentifier string `pulumi:"hsmClientCertificateIdentifier"`
   138  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   139  	Tags map[string]string `pulumi:"tags"`
   140  }
   141  
   142  // The set of arguments for constructing a HsmClientCertificate resource.
   143  type HsmClientCertificateArgs struct {
   144  	// The identifier of the HSM client certificate.
   145  	HsmClientCertificateIdentifier pulumi.StringInput
   146  	// A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   147  	Tags pulumi.StringMapInput
   148  }
   149  
   150  func (HsmClientCertificateArgs) ElementType() reflect.Type {
   151  	return reflect.TypeOf((*hsmClientCertificateArgs)(nil)).Elem()
   152  }
   153  
   154  type HsmClientCertificateInput interface {
   155  	pulumi.Input
   156  
   157  	ToHsmClientCertificateOutput() HsmClientCertificateOutput
   158  	ToHsmClientCertificateOutputWithContext(ctx context.Context) HsmClientCertificateOutput
   159  }
   160  
   161  func (*HsmClientCertificate) ElementType() reflect.Type {
   162  	return reflect.TypeOf((**HsmClientCertificate)(nil)).Elem()
   163  }
   164  
   165  func (i *HsmClientCertificate) ToHsmClientCertificateOutput() HsmClientCertificateOutput {
   166  	return i.ToHsmClientCertificateOutputWithContext(context.Background())
   167  }
   168  
   169  func (i *HsmClientCertificate) ToHsmClientCertificateOutputWithContext(ctx context.Context) HsmClientCertificateOutput {
   170  	return pulumi.ToOutputWithContext(ctx, i).(HsmClientCertificateOutput)
   171  }
   172  
   173  // HsmClientCertificateArrayInput is an input type that accepts HsmClientCertificateArray and HsmClientCertificateArrayOutput values.
   174  // You can construct a concrete instance of `HsmClientCertificateArrayInput` via:
   175  //
   176  //	HsmClientCertificateArray{ HsmClientCertificateArgs{...} }
   177  type HsmClientCertificateArrayInput interface {
   178  	pulumi.Input
   179  
   180  	ToHsmClientCertificateArrayOutput() HsmClientCertificateArrayOutput
   181  	ToHsmClientCertificateArrayOutputWithContext(context.Context) HsmClientCertificateArrayOutput
   182  }
   183  
   184  type HsmClientCertificateArray []HsmClientCertificateInput
   185  
   186  func (HsmClientCertificateArray) ElementType() reflect.Type {
   187  	return reflect.TypeOf((*[]*HsmClientCertificate)(nil)).Elem()
   188  }
   189  
   190  func (i HsmClientCertificateArray) ToHsmClientCertificateArrayOutput() HsmClientCertificateArrayOutput {
   191  	return i.ToHsmClientCertificateArrayOutputWithContext(context.Background())
   192  }
   193  
   194  func (i HsmClientCertificateArray) ToHsmClientCertificateArrayOutputWithContext(ctx context.Context) HsmClientCertificateArrayOutput {
   195  	return pulumi.ToOutputWithContext(ctx, i).(HsmClientCertificateArrayOutput)
   196  }
   197  
   198  // HsmClientCertificateMapInput is an input type that accepts HsmClientCertificateMap and HsmClientCertificateMapOutput values.
   199  // You can construct a concrete instance of `HsmClientCertificateMapInput` via:
   200  //
   201  //	HsmClientCertificateMap{ "key": HsmClientCertificateArgs{...} }
   202  type HsmClientCertificateMapInput interface {
   203  	pulumi.Input
   204  
   205  	ToHsmClientCertificateMapOutput() HsmClientCertificateMapOutput
   206  	ToHsmClientCertificateMapOutputWithContext(context.Context) HsmClientCertificateMapOutput
   207  }
   208  
   209  type HsmClientCertificateMap map[string]HsmClientCertificateInput
   210  
   211  func (HsmClientCertificateMap) ElementType() reflect.Type {
   212  	return reflect.TypeOf((*map[string]*HsmClientCertificate)(nil)).Elem()
   213  }
   214  
   215  func (i HsmClientCertificateMap) ToHsmClientCertificateMapOutput() HsmClientCertificateMapOutput {
   216  	return i.ToHsmClientCertificateMapOutputWithContext(context.Background())
   217  }
   218  
   219  func (i HsmClientCertificateMap) ToHsmClientCertificateMapOutputWithContext(ctx context.Context) HsmClientCertificateMapOutput {
   220  	return pulumi.ToOutputWithContext(ctx, i).(HsmClientCertificateMapOutput)
   221  }
   222  
   223  type HsmClientCertificateOutput struct{ *pulumi.OutputState }
   224  
   225  func (HsmClientCertificateOutput) ElementType() reflect.Type {
   226  	return reflect.TypeOf((**HsmClientCertificate)(nil)).Elem()
   227  }
   228  
   229  func (o HsmClientCertificateOutput) ToHsmClientCertificateOutput() HsmClientCertificateOutput {
   230  	return o
   231  }
   232  
   233  func (o HsmClientCertificateOutput) ToHsmClientCertificateOutputWithContext(ctx context.Context) HsmClientCertificateOutput {
   234  	return o
   235  }
   236  
   237  // Amazon Resource Name (ARN) of the Hsm Client Certificate.
   238  func (o HsmClientCertificateOutput) Arn() pulumi.StringOutput {
   239  	return o.ApplyT(func(v *HsmClientCertificate) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   240  }
   241  
   242  // The identifier of the HSM client certificate.
   243  func (o HsmClientCertificateOutput) HsmClientCertificateIdentifier() pulumi.StringOutput {
   244  	return o.ApplyT(func(v *HsmClientCertificate) pulumi.StringOutput { return v.HsmClientCertificateIdentifier }).(pulumi.StringOutput)
   245  }
   246  
   247  // The public key that the Amazon Redshift cluster will use to connect to the HSM. You must register the public key in the HSM.
   248  func (o HsmClientCertificateOutput) HsmClientCertificatePublicKey() pulumi.StringOutput {
   249  	return o.ApplyT(func(v *HsmClientCertificate) pulumi.StringOutput { return v.HsmClientCertificatePublicKey }).(pulumi.StringOutput)
   250  }
   251  
   252  // A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   253  func (o HsmClientCertificateOutput) Tags() pulumi.StringMapOutput {
   254  	return o.ApplyT(func(v *HsmClientCertificate) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   255  }
   256  
   257  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   258  //
   259  // Deprecated: Please use `tags` instead.
   260  func (o HsmClientCertificateOutput) TagsAll() pulumi.StringMapOutput {
   261  	return o.ApplyT(func(v *HsmClientCertificate) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   262  }
   263  
   264  type HsmClientCertificateArrayOutput struct{ *pulumi.OutputState }
   265  
   266  func (HsmClientCertificateArrayOutput) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*[]*HsmClientCertificate)(nil)).Elem()
   268  }
   269  
   270  func (o HsmClientCertificateArrayOutput) ToHsmClientCertificateArrayOutput() HsmClientCertificateArrayOutput {
   271  	return o
   272  }
   273  
   274  func (o HsmClientCertificateArrayOutput) ToHsmClientCertificateArrayOutputWithContext(ctx context.Context) HsmClientCertificateArrayOutput {
   275  	return o
   276  }
   277  
   278  func (o HsmClientCertificateArrayOutput) Index(i pulumi.IntInput) HsmClientCertificateOutput {
   279  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HsmClientCertificate {
   280  		return vs[0].([]*HsmClientCertificate)[vs[1].(int)]
   281  	}).(HsmClientCertificateOutput)
   282  }
   283  
   284  type HsmClientCertificateMapOutput struct{ *pulumi.OutputState }
   285  
   286  func (HsmClientCertificateMapOutput) ElementType() reflect.Type {
   287  	return reflect.TypeOf((*map[string]*HsmClientCertificate)(nil)).Elem()
   288  }
   289  
   290  func (o HsmClientCertificateMapOutput) ToHsmClientCertificateMapOutput() HsmClientCertificateMapOutput {
   291  	return o
   292  }
   293  
   294  func (o HsmClientCertificateMapOutput) ToHsmClientCertificateMapOutputWithContext(ctx context.Context) HsmClientCertificateMapOutput {
   295  	return o
   296  }
   297  
   298  func (o HsmClientCertificateMapOutput) MapIndex(k pulumi.StringInput) HsmClientCertificateOutput {
   299  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HsmClientCertificate {
   300  		return vs[0].(map[string]*HsmClientCertificate)[vs[1].(string)]
   301  	}).(HsmClientCertificateOutput)
   302  }
   303  
   304  func init() {
   305  	pulumi.RegisterInputType(reflect.TypeOf((*HsmClientCertificateInput)(nil)).Elem(), &HsmClientCertificate{})
   306  	pulumi.RegisterInputType(reflect.TypeOf((*HsmClientCertificateArrayInput)(nil)).Elem(), HsmClientCertificateArray{})
   307  	pulumi.RegisterInputType(reflect.TypeOf((*HsmClientCertificateMapInput)(nil)).Elem(), HsmClientCertificateMap{})
   308  	pulumi.RegisterOutputType(HsmClientCertificateOutput{})
   309  	pulumi.RegisterOutputType(HsmClientCertificateArrayOutput{})
   310  	pulumi.RegisterOutputType(HsmClientCertificateMapOutput{})
   311  }