github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/hsmConfiguration.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 configuration that contains the information required by an Amazon Redshift cluster to store and use database encryption keys in a Hardware Security Module (HSM).
    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.NewHsmConfiguration(ctx, "example", &redshift.HsmConfigurationArgs{
    33  //				Description:                pulumi.String("example"),
    34  //				HsmConfigurationIdentifier: pulumi.String("example"),
    35  //				HsmIpAddress:               pulumi.String("10.0.0.1"),
    36  //				HsmPartitionName:           pulumi.String("aws"),
    37  //				HsmPartitionPassword:       pulumi.String("example"),
    38  //				HsmServerPublicCertificate: pulumi.String("example"),
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import Redshift HSM Client Certificates using `hsm_configuration_identifier`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:redshift/hsmConfiguration:HsmConfiguration example example
    56  // ```
    57  type HsmConfiguration struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
    61  	Arn pulumi.StringOutput `pulumi:"arn"`
    62  	// A text description of the HSM configuration to be created.
    63  	Description pulumi.StringOutput `pulumi:"description"`
    64  	// The identifier to be assigned to the new Amazon Redshift HSM configuration.
    65  	HsmConfigurationIdentifier pulumi.StringOutput `pulumi:"hsmConfigurationIdentifier"`
    66  	// The IP address that the Amazon Redshift cluster must use to access the HSM.
    67  	HsmIpAddress pulumi.StringOutput `pulumi:"hsmIpAddress"`
    68  	// The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
    69  	HsmPartitionName pulumi.StringOutput `pulumi:"hsmPartitionName"`
    70  	// The password required to access the HSM partition.
    71  	HsmPartitionPassword pulumi.StringOutput `pulumi:"hsmPartitionPassword"`
    72  	// The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
    73  	HsmServerPublicCertificate pulumi.StringOutput `pulumi:"hsmServerPublicCertificate"`
    74  	// 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.
    75  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    76  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    77  	//
    78  	// Deprecated: Please use `tags` instead.
    79  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    80  }
    81  
    82  // NewHsmConfiguration registers a new resource with the given unique name, arguments, and options.
    83  func NewHsmConfiguration(ctx *pulumi.Context,
    84  	name string, args *HsmConfigurationArgs, opts ...pulumi.ResourceOption) (*HsmConfiguration, error) {
    85  	if args == nil {
    86  		return nil, errors.New("missing one or more required arguments")
    87  	}
    88  
    89  	if args.Description == nil {
    90  		return nil, errors.New("invalid value for required argument 'Description'")
    91  	}
    92  	if args.HsmConfigurationIdentifier == nil {
    93  		return nil, errors.New("invalid value for required argument 'HsmConfigurationIdentifier'")
    94  	}
    95  	if args.HsmIpAddress == nil {
    96  		return nil, errors.New("invalid value for required argument 'HsmIpAddress'")
    97  	}
    98  	if args.HsmPartitionName == nil {
    99  		return nil, errors.New("invalid value for required argument 'HsmPartitionName'")
   100  	}
   101  	if args.HsmPartitionPassword == nil {
   102  		return nil, errors.New("invalid value for required argument 'HsmPartitionPassword'")
   103  	}
   104  	if args.HsmServerPublicCertificate == nil {
   105  		return nil, errors.New("invalid value for required argument 'HsmServerPublicCertificate'")
   106  	}
   107  	if args.HsmPartitionPassword != nil {
   108  		args.HsmPartitionPassword = pulumi.ToSecret(args.HsmPartitionPassword).(pulumi.StringInput)
   109  	}
   110  	secrets := pulumi.AdditionalSecretOutputs([]string{
   111  		"hsmPartitionPassword",
   112  	})
   113  	opts = append(opts, secrets)
   114  	opts = internal.PkgResourceDefaultOpts(opts)
   115  	var resource HsmConfiguration
   116  	err := ctx.RegisterResource("aws:redshift/hsmConfiguration:HsmConfiguration", name, args, &resource, opts...)
   117  	if err != nil {
   118  		return nil, err
   119  	}
   120  	return &resource, nil
   121  }
   122  
   123  // GetHsmConfiguration gets an existing HsmConfiguration resource's state with the given name, ID, and optional
   124  // state properties that are used to uniquely qualify the lookup (nil if not required).
   125  func GetHsmConfiguration(ctx *pulumi.Context,
   126  	name string, id pulumi.IDInput, state *HsmConfigurationState, opts ...pulumi.ResourceOption) (*HsmConfiguration, error) {
   127  	var resource HsmConfiguration
   128  	err := ctx.ReadResource("aws:redshift/hsmConfiguration:HsmConfiguration", name, id, state, &resource, opts...)
   129  	if err != nil {
   130  		return nil, err
   131  	}
   132  	return &resource, nil
   133  }
   134  
   135  // Input properties used for looking up and filtering HsmConfiguration resources.
   136  type hsmConfigurationState struct {
   137  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
   138  	Arn *string `pulumi:"arn"`
   139  	// A text description of the HSM configuration to be created.
   140  	Description *string `pulumi:"description"`
   141  	// The identifier to be assigned to the new Amazon Redshift HSM configuration.
   142  	HsmConfigurationIdentifier *string `pulumi:"hsmConfigurationIdentifier"`
   143  	// The IP address that the Amazon Redshift cluster must use to access the HSM.
   144  	HsmIpAddress *string `pulumi:"hsmIpAddress"`
   145  	// The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
   146  	HsmPartitionName *string `pulumi:"hsmPartitionName"`
   147  	// The password required to access the HSM partition.
   148  	HsmPartitionPassword *string `pulumi:"hsmPartitionPassword"`
   149  	// The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
   150  	HsmServerPublicCertificate *string `pulumi:"hsmServerPublicCertificate"`
   151  	// 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.
   152  	Tags map[string]string `pulumi:"tags"`
   153  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   154  	//
   155  	// Deprecated: Please use `tags` instead.
   156  	TagsAll map[string]string `pulumi:"tagsAll"`
   157  }
   158  
   159  type HsmConfigurationState struct {
   160  	// Amazon Resource Name (ARN) of the Hsm Client Certificate.
   161  	Arn pulumi.StringPtrInput
   162  	// A text description of the HSM configuration to be created.
   163  	Description pulumi.StringPtrInput
   164  	// The identifier to be assigned to the new Amazon Redshift HSM configuration.
   165  	HsmConfigurationIdentifier pulumi.StringPtrInput
   166  	// The IP address that the Amazon Redshift cluster must use to access the HSM.
   167  	HsmIpAddress pulumi.StringPtrInput
   168  	// The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
   169  	HsmPartitionName pulumi.StringPtrInput
   170  	// The password required to access the HSM partition.
   171  	HsmPartitionPassword pulumi.StringPtrInput
   172  	// The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
   173  	HsmServerPublicCertificate pulumi.StringPtrInput
   174  	// 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.
   175  	Tags pulumi.StringMapInput
   176  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   177  	//
   178  	// Deprecated: Please use `tags` instead.
   179  	TagsAll pulumi.StringMapInput
   180  }
   181  
   182  func (HsmConfigurationState) ElementType() reflect.Type {
   183  	return reflect.TypeOf((*hsmConfigurationState)(nil)).Elem()
   184  }
   185  
   186  type hsmConfigurationArgs struct {
   187  	// A text description of the HSM configuration to be created.
   188  	Description string `pulumi:"description"`
   189  	// The identifier to be assigned to the new Amazon Redshift HSM configuration.
   190  	HsmConfigurationIdentifier string `pulumi:"hsmConfigurationIdentifier"`
   191  	// The IP address that the Amazon Redshift cluster must use to access the HSM.
   192  	HsmIpAddress string `pulumi:"hsmIpAddress"`
   193  	// The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
   194  	HsmPartitionName string `pulumi:"hsmPartitionName"`
   195  	// The password required to access the HSM partition.
   196  	HsmPartitionPassword string `pulumi:"hsmPartitionPassword"`
   197  	// The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
   198  	HsmServerPublicCertificate string `pulumi:"hsmServerPublicCertificate"`
   199  	// 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.
   200  	Tags map[string]string `pulumi:"tags"`
   201  }
   202  
   203  // The set of arguments for constructing a HsmConfiguration resource.
   204  type HsmConfigurationArgs struct {
   205  	// A text description of the HSM configuration to be created.
   206  	Description pulumi.StringInput
   207  	// The identifier to be assigned to the new Amazon Redshift HSM configuration.
   208  	HsmConfigurationIdentifier pulumi.StringInput
   209  	// The IP address that the Amazon Redshift cluster must use to access the HSM.
   210  	HsmIpAddress pulumi.StringInput
   211  	// The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
   212  	HsmPartitionName pulumi.StringInput
   213  	// The password required to access the HSM partition.
   214  	HsmPartitionPassword pulumi.StringInput
   215  	// The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
   216  	HsmServerPublicCertificate pulumi.StringInput
   217  	// 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.
   218  	Tags pulumi.StringMapInput
   219  }
   220  
   221  func (HsmConfigurationArgs) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*hsmConfigurationArgs)(nil)).Elem()
   223  }
   224  
   225  type HsmConfigurationInput interface {
   226  	pulumi.Input
   227  
   228  	ToHsmConfigurationOutput() HsmConfigurationOutput
   229  	ToHsmConfigurationOutputWithContext(ctx context.Context) HsmConfigurationOutput
   230  }
   231  
   232  func (*HsmConfiguration) ElementType() reflect.Type {
   233  	return reflect.TypeOf((**HsmConfiguration)(nil)).Elem()
   234  }
   235  
   236  func (i *HsmConfiguration) ToHsmConfigurationOutput() HsmConfigurationOutput {
   237  	return i.ToHsmConfigurationOutputWithContext(context.Background())
   238  }
   239  
   240  func (i *HsmConfiguration) ToHsmConfigurationOutputWithContext(ctx context.Context) HsmConfigurationOutput {
   241  	return pulumi.ToOutputWithContext(ctx, i).(HsmConfigurationOutput)
   242  }
   243  
   244  // HsmConfigurationArrayInput is an input type that accepts HsmConfigurationArray and HsmConfigurationArrayOutput values.
   245  // You can construct a concrete instance of `HsmConfigurationArrayInput` via:
   246  //
   247  //	HsmConfigurationArray{ HsmConfigurationArgs{...} }
   248  type HsmConfigurationArrayInput interface {
   249  	pulumi.Input
   250  
   251  	ToHsmConfigurationArrayOutput() HsmConfigurationArrayOutput
   252  	ToHsmConfigurationArrayOutputWithContext(context.Context) HsmConfigurationArrayOutput
   253  }
   254  
   255  type HsmConfigurationArray []HsmConfigurationInput
   256  
   257  func (HsmConfigurationArray) ElementType() reflect.Type {
   258  	return reflect.TypeOf((*[]*HsmConfiguration)(nil)).Elem()
   259  }
   260  
   261  func (i HsmConfigurationArray) ToHsmConfigurationArrayOutput() HsmConfigurationArrayOutput {
   262  	return i.ToHsmConfigurationArrayOutputWithContext(context.Background())
   263  }
   264  
   265  func (i HsmConfigurationArray) ToHsmConfigurationArrayOutputWithContext(ctx context.Context) HsmConfigurationArrayOutput {
   266  	return pulumi.ToOutputWithContext(ctx, i).(HsmConfigurationArrayOutput)
   267  }
   268  
   269  // HsmConfigurationMapInput is an input type that accepts HsmConfigurationMap and HsmConfigurationMapOutput values.
   270  // You can construct a concrete instance of `HsmConfigurationMapInput` via:
   271  //
   272  //	HsmConfigurationMap{ "key": HsmConfigurationArgs{...} }
   273  type HsmConfigurationMapInput interface {
   274  	pulumi.Input
   275  
   276  	ToHsmConfigurationMapOutput() HsmConfigurationMapOutput
   277  	ToHsmConfigurationMapOutputWithContext(context.Context) HsmConfigurationMapOutput
   278  }
   279  
   280  type HsmConfigurationMap map[string]HsmConfigurationInput
   281  
   282  func (HsmConfigurationMap) ElementType() reflect.Type {
   283  	return reflect.TypeOf((*map[string]*HsmConfiguration)(nil)).Elem()
   284  }
   285  
   286  func (i HsmConfigurationMap) ToHsmConfigurationMapOutput() HsmConfigurationMapOutput {
   287  	return i.ToHsmConfigurationMapOutputWithContext(context.Background())
   288  }
   289  
   290  func (i HsmConfigurationMap) ToHsmConfigurationMapOutputWithContext(ctx context.Context) HsmConfigurationMapOutput {
   291  	return pulumi.ToOutputWithContext(ctx, i).(HsmConfigurationMapOutput)
   292  }
   293  
   294  type HsmConfigurationOutput struct{ *pulumi.OutputState }
   295  
   296  func (HsmConfigurationOutput) ElementType() reflect.Type {
   297  	return reflect.TypeOf((**HsmConfiguration)(nil)).Elem()
   298  }
   299  
   300  func (o HsmConfigurationOutput) ToHsmConfigurationOutput() HsmConfigurationOutput {
   301  	return o
   302  }
   303  
   304  func (o HsmConfigurationOutput) ToHsmConfigurationOutputWithContext(ctx context.Context) HsmConfigurationOutput {
   305  	return o
   306  }
   307  
   308  // Amazon Resource Name (ARN) of the Hsm Client Certificate.
   309  func (o HsmConfigurationOutput) Arn() pulumi.StringOutput {
   310  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   311  }
   312  
   313  // A text description of the HSM configuration to be created.
   314  func (o HsmConfigurationOutput) Description() pulumi.StringOutput {
   315  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
   316  }
   317  
   318  // The identifier to be assigned to the new Amazon Redshift HSM configuration.
   319  func (o HsmConfigurationOutput) HsmConfigurationIdentifier() pulumi.StringOutput {
   320  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.HsmConfigurationIdentifier }).(pulumi.StringOutput)
   321  }
   322  
   323  // The IP address that the Amazon Redshift cluster must use to access the HSM.
   324  func (o HsmConfigurationOutput) HsmIpAddress() pulumi.StringOutput {
   325  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.HsmIpAddress }).(pulumi.StringOutput)
   326  }
   327  
   328  // The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.
   329  func (o HsmConfigurationOutput) HsmPartitionName() pulumi.StringOutput {
   330  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.HsmPartitionName }).(pulumi.StringOutput)
   331  }
   332  
   333  // The password required to access the HSM partition.
   334  func (o HsmConfigurationOutput) HsmPartitionPassword() pulumi.StringOutput {
   335  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.HsmPartitionPassword }).(pulumi.StringOutput)
   336  }
   337  
   338  // The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.
   339  func (o HsmConfigurationOutput) HsmServerPublicCertificate() pulumi.StringOutput {
   340  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringOutput { return v.HsmServerPublicCertificate }).(pulumi.StringOutput)
   341  }
   342  
   343  // 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.
   344  func (o HsmConfigurationOutput) Tags() pulumi.StringMapOutput {
   345  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   346  }
   347  
   348  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   349  //
   350  // Deprecated: Please use `tags` instead.
   351  func (o HsmConfigurationOutput) TagsAll() pulumi.StringMapOutput {
   352  	return o.ApplyT(func(v *HsmConfiguration) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   353  }
   354  
   355  type HsmConfigurationArrayOutput struct{ *pulumi.OutputState }
   356  
   357  func (HsmConfigurationArrayOutput) ElementType() reflect.Type {
   358  	return reflect.TypeOf((*[]*HsmConfiguration)(nil)).Elem()
   359  }
   360  
   361  func (o HsmConfigurationArrayOutput) ToHsmConfigurationArrayOutput() HsmConfigurationArrayOutput {
   362  	return o
   363  }
   364  
   365  func (o HsmConfigurationArrayOutput) ToHsmConfigurationArrayOutputWithContext(ctx context.Context) HsmConfigurationArrayOutput {
   366  	return o
   367  }
   368  
   369  func (o HsmConfigurationArrayOutput) Index(i pulumi.IntInput) HsmConfigurationOutput {
   370  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *HsmConfiguration {
   371  		return vs[0].([]*HsmConfiguration)[vs[1].(int)]
   372  	}).(HsmConfigurationOutput)
   373  }
   374  
   375  type HsmConfigurationMapOutput struct{ *pulumi.OutputState }
   376  
   377  func (HsmConfigurationMapOutput) ElementType() reflect.Type {
   378  	return reflect.TypeOf((*map[string]*HsmConfiguration)(nil)).Elem()
   379  }
   380  
   381  func (o HsmConfigurationMapOutput) ToHsmConfigurationMapOutput() HsmConfigurationMapOutput {
   382  	return o
   383  }
   384  
   385  func (o HsmConfigurationMapOutput) ToHsmConfigurationMapOutputWithContext(ctx context.Context) HsmConfigurationMapOutput {
   386  	return o
   387  }
   388  
   389  func (o HsmConfigurationMapOutput) MapIndex(k pulumi.StringInput) HsmConfigurationOutput {
   390  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *HsmConfiguration {
   391  		return vs[0].(map[string]*HsmConfiguration)[vs[1].(string)]
   392  	}).(HsmConfigurationOutput)
   393  }
   394  
   395  func init() {
   396  	pulumi.RegisterInputType(reflect.TypeOf((*HsmConfigurationInput)(nil)).Elem(), &HsmConfiguration{})
   397  	pulumi.RegisterInputType(reflect.TypeOf((*HsmConfigurationArrayInput)(nil)).Elem(), HsmConfigurationArray{})
   398  	pulumi.RegisterInputType(reflect.TypeOf((*HsmConfigurationMapInput)(nil)).Elem(), HsmConfigurationMap{})
   399  	pulumi.RegisterOutputType(HsmConfigurationOutput{})
   400  	pulumi.RegisterOutputType(HsmConfigurationArrayOutput{})
   401  	pulumi.RegisterOutputType(HsmConfigurationMapOutput{})
   402  }