github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/clusterSnapshot.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 a Redshift cluster snapshot
    16  //
    17  // ## Import
    18  //
    19  // Using `pulumi import`, import Redshift Cluster Snapshots using `snapshot_identifier`. For example:
    20  //
    21  // ```sh
    22  // $ pulumi import aws:redshift/clusterSnapshot:ClusterSnapshot test example
    23  // ```
    24  type ClusterSnapshot struct {
    25  	pulumi.CustomResourceState
    26  
    27  	// Amazon Resource Name (ARN) of the snapshot.
    28  	Arn pulumi.StringOutput `pulumi:"arn"`
    29  	// The cluster identifier for which you want a snapshot.
    30  	ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"`
    31  	// The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken.
    32  	KmsKeyId pulumi.StringOutput `pulumi:"kmsKeyId"`
    33  	// The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
    34  	ManualSnapshotRetentionPeriod pulumi.IntPtrOutput `pulumi:"manualSnapshotRetentionPeriod"`
    35  	// For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot.
    36  	OwnerAccount pulumi.StringOutput `pulumi:"ownerAccount"`
    37  	// A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
    38  	SnapshotIdentifier pulumi.StringOutput `pulumi:"snapshotIdentifier"`
    39  	// 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.
    40  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    41  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    42  	//
    43  	// Deprecated: Please use `tags` instead.
    44  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    45  }
    46  
    47  // NewClusterSnapshot registers a new resource with the given unique name, arguments, and options.
    48  func NewClusterSnapshot(ctx *pulumi.Context,
    49  	name string, args *ClusterSnapshotArgs, opts ...pulumi.ResourceOption) (*ClusterSnapshot, error) {
    50  	if args == nil {
    51  		return nil, errors.New("missing one or more required arguments")
    52  	}
    53  
    54  	if args.ClusterIdentifier == nil {
    55  		return nil, errors.New("invalid value for required argument 'ClusterIdentifier'")
    56  	}
    57  	if args.SnapshotIdentifier == nil {
    58  		return nil, errors.New("invalid value for required argument 'SnapshotIdentifier'")
    59  	}
    60  	opts = internal.PkgResourceDefaultOpts(opts)
    61  	var resource ClusterSnapshot
    62  	err := ctx.RegisterResource("aws:redshift/clusterSnapshot:ClusterSnapshot", name, args, &resource, opts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	return &resource, nil
    67  }
    68  
    69  // GetClusterSnapshot gets an existing ClusterSnapshot resource's state with the given name, ID, and optional
    70  // state properties that are used to uniquely qualify the lookup (nil if not required).
    71  func GetClusterSnapshot(ctx *pulumi.Context,
    72  	name string, id pulumi.IDInput, state *ClusterSnapshotState, opts ...pulumi.ResourceOption) (*ClusterSnapshot, error) {
    73  	var resource ClusterSnapshot
    74  	err := ctx.ReadResource("aws:redshift/clusterSnapshot:ClusterSnapshot", name, id, state, &resource, opts...)
    75  	if err != nil {
    76  		return nil, err
    77  	}
    78  	return &resource, nil
    79  }
    80  
    81  // Input properties used for looking up and filtering ClusterSnapshot resources.
    82  type clusterSnapshotState struct {
    83  	// Amazon Resource Name (ARN) of the snapshot.
    84  	Arn *string `pulumi:"arn"`
    85  	// The cluster identifier for which you want a snapshot.
    86  	ClusterIdentifier *string `pulumi:"clusterIdentifier"`
    87  	// The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken.
    88  	KmsKeyId *string `pulumi:"kmsKeyId"`
    89  	// The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
    90  	ManualSnapshotRetentionPeriod *int `pulumi:"manualSnapshotRetentionPeriod"`
    91  	// For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot.
    92  	OwnerAccount *string `pulumi:"ownerAccount"`
    93  	// A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
    94  	SnapshotIdentifier *string `pulumi:"snapshotIdentifier"`
    95  	// 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.
    96  	Tags map[string]string `pulumi:"tags"`
    97  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    98  	//
    99  	// Deprecated: Please use `tags` instead.
   100  	TagsAll map[string]string `pulumi:"tagsAll"`
   101  }
   102  
   103  type ClusterSnapshotState struct {
   104  	// Amazon Resource Name (ARN) of the snapshot.
   105  	Arn pulumi.StringPtrInput
   106  	// The cluster identifier for which you want a snapshot.
   107  	ClusterIdentifier pulumi.StringPtrInput
   108  	// The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken.
   109  	KmsKeyId pulumi.StringPtrInput
   110  	// The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
   111  	ManualSnapshotRetentionPeriod pulumi.IntPtrInput
   112  	// For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot.
   113  	OwnerAccount pulumi.StringPtrInput
   114  	// A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
   115  	SnapshotIdentifier pulumi.StringPtrInput
   116  	// 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.
   117  	Tags pulumi.StringMapInput
   118  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   119  	//
   120  	// Deprecated: Please use `tags` instead.
   121  	TagsAll pulumi.StringMapInput
   122  }
   123  
   124  func (ClusterSnapshotState) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*clusterSnapshotState)(nil)).Elem()
   126  }
   127  
   128  type clusterSnapshotArgs struct {
   129  	// The cluster identifier for which you want a snapshot.
   130  	ClusterIdentifier string `pulumi:"clusterIdentifier"`
   131  	// The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
   132  	ManualSnapshotRetentionPeriod *int `pulumi:"manualSnapshotRetentionPeriod"`
   133  	// A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
   134  	SnapshotIdentifier string `pulumi:"snapshotIdentifier"`
   135  	// 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.
   136  	Tags map[string]string `pulumi:"tags"`
   137  }
   138  
   139  // The set of arguments for constructing a ClusterSnapshot resource.
   140  type ClusterSnapshotArgs struct {
   141  	// The cluster identifier for which you want a snapshot.
   142  	ClusterIdentifier pulumi.StringInput
   143  	// The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
   144  	ManualSnapshotRetentionPeriod pulumi.IntPtrInput
   145  	// A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
   146  	SnapshotIdentifier pulumi.StringInput
   147  	// 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.
   148  	Tags pulumi.StringMapInput
   149  }
   150  
   151  func (ClusterSnapshotArgs) ElementType() reflect.Type {
   152  	return reflect.TypeOf((*clusterSnapshotArgs)(nil)).Elem()
   153  }
   154  
   155  type ClusterSnapshotInput interface {
   156  	pulumi.Input
   157  
   158  	ToClusterSnapshotOutput() ClusterSnapshotOutput
   159  	ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput
   160  }
   161  
   162  func (*ClusterSnapshot) ElementType() reflect.Type {
   163  	return reflect.TypeOf((**ClusterSnapshot)(nil)).Elem()
   164  }
   165  
   166  func (i *ClusterSnapshot) ToClusterSnapshotOutput() ClusterSnapshotOutput {
   167  	return i.ToClusterSnapshotOutputWithContext(context.Background())
   168  }
   169  
   170  func (i *ClusterSnapshot) ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput {
   171  	return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotOutput)
   172  }
   173  
   174  // ClusterSnapshotArrayInput is an input type that accepts ClusterSnapshotArray and ClusterSnapshotArrayOutput values.
   175  // You can construct a concrete instance of `ClusterSnapshotArrayInput` via:
   176  //
   177  //	ClusterSnapshotArray{ ClusterSnapshotArgs{...} }
   178  type ClusterSnapshotArrayInput interface {
   179  	pulumi.Input
   180  
   181  	ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput
   182  	ToClusterSnapshotArrayOutputWithContext(context.Context) ClusterSnapshotArrayOutput
   183  }
   184  
   185  type ClusterSnapshotArray []ClusterSnapshotInput
   186  
   187  func (ClusterSnapshotArray) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*[]*ClusterSnapshot)(nil)).Elem()
   189  }
   190  
   191  func (i ClusterSnapshotArray) ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput {
   192  	return i.ToClusterSnapshotArrayOutputWithContext(context.Background())
   193  }
   194  
   195  func (i ClusterSnapshotArray) ToClusterSnapshotArrayOutputWithContext(ctx context.Context) ClusterSnapshotArrayOutput {
   196  	return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotArrayOutput)
   197  }
   198  
   199  // ClusterSnapshotMapInput is an input type that accepts ClusterSnapshotMap and ClusterSnapshotMapOutput values.
   200  // You can construct a concrete instance of `ClusterSnapshotMapInput` via:
   201  //
   202  //	ClusterSnapshotMap{ "key": ClusterSnapshotArgs{...} }
   203  type ClusterSnapshotMapInput interface {
   204  	pulumi.Input
   205  
   206  	ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput
   207  	ToClusterSnapshotMapOutputWithContext(context.Context) ClusterSnapshotMapOutput
   208  }
   209  
   210  type ClusterSnapshotMap map[string]ClusterSnapshotInput
   211  
   212  func (ClusterSnapshotMap) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*map[string]*ClusterSnapshot)(nil)).Elem()
   214  }
   215  
   216  func (i ClusterSnapshotMap) ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput {
   217  	return i.ToClusterSnapshotMapOutputWithContext(context.Background())
   218  }
   219  
   220  func (i ClusterSnapshotMap) ToClusterSnapshotMapOutputWithContext(ctx context.Context) ClusterSnapshotMapOutput {
   221  	return pulumi.ToOutputWithContext(ctx, i).(ClusterSnapshotMapOutput)
   222  }
   223  
   224  type ClusterSnapshotOutput struct{ *pulumi.OutputState }
   225  
   226  func (ClusterSnapshotOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((**ClusterSnapshot)(nil)).Elem()
   228  }
   229  
   230  func (o ClusterSnapshotOutput) ToClusterSnapshotOutput() ClusterSnapshotOutput {
   231  	return o
   232  }
   233  
   234  func (o ClusterSnapshotOutput) ToClusterSnapshotOutputWithContext(ctx context.Context) ClusterSnapshotOutput {
   235  	return o
   236  }
   237  
   238  // Amazon Resource Name (ARN) of the snapshot.
   239  func (o ClusterSnapshotOutput) Arn() pulumi.StringOutput {
   240  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   241  }
   242  
   243  // The cluster identifier for which you want a snapshot.
   244  func (o ClusterSnapshotOutput) ClusterIdentifier() pulumi.StringOutput {
   245  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput)
   246  }
   247  
   248  // The Key Management Service (KMS) key ID of the encryption key that was used to encrypt data in the cluster from which the snapshot was taken.
   249  func (o ClusterSnapshotOutput) KmsKeyId() pulumi.StringOutput {
   250  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.KmsKeyId }).(pulumi.StringOutput)
   251  }
   252  
   253  // The number of days that a manual snapshot is retained. If the value is `-1`, the manual snapshot is retained indefinitely. Valid values are -1 and between `1` and `3653`.
   254  func (o ClusterSnapshotOutput) ManualSnapshotRetentionPeriod() pulumi.IntPtrOutput {
   255  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.IntPtrOutput { return v.ManualSnapshotRetentionPeriod }).(pulumi.IntPtrOutput)
   256  }
   257  
   258  // For manual snapshots, the Amazon Web Services account used to create or copy the snapshot. For automatic snapshots, the owner of the cluster. The owner can perform all snapshot actions, such as sharing a manual snapshot.
   259  func (o ClusterSnapshotOutput) OwnerAccount() pulumi.StringOutput {
   260  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.OwnerAccount }).(pulumi.StringOutput)
   261  }
   262  
   263  // A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the Amazon Web Services account.
   264  func (o ClusterSnapshotOutput) SnapshotIdentifier() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringOutput { return v.SnapshotIdentifier }).(pulumi.StringOutput)
   266  }
   267  
   268  // 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.
   269  func (o ClusterSnapshotOutput) Tags() pulumi.StringMapOutput {
   270  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   271  }
   272  
   273  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   274  //
   275  // Deprecated: Please use `tags` instead.
   276  func (o ClusterSnapshotOutput) TagsAll() pulumi.StringMapOutput {
   277  	return o.ApplyT(func(v *ClusterSnapshot) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   278  }
   279  
   280  type ClusterSnapshotArrayOutput struct{ *pulumi.OutputState }
   281  
   282  func (ClusterSnapshotArrayOutput) ElementType() reflect.Type {
   283  	return reflect.TypeOf((*[]*ClusterSnapshot)(nil)).Elem()
   284  }
   285  
   286  func (o ClusterSnapshotArrayOutput) ToClusterSnapshotArrayOutput() ClusterSnapshotArrayOutput {
   287  	return o
   288  }
   289  
   290  func (o ClusterSnapshotArrayOutput) ToClusterSnapshotArrayOutputWithContext(ctx context.Context) ClusterSnapshotArrayOutput {
   291  	return o
   292  }
   293  
   294  func (o ClusterSnapshotArrayOutput) Index(i pulumi.IntInput) ClusterSnapshotOutput {
   295  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ClusterSnapshot {
   296  		return vs[0].([]*ClusterSnapshot)[vs[1].(int)]
   297  	}).(ClusterSnapshotOutput)
   298  }
   299  
   300  type ClusterSnapshotMapOutput struct{ *pulumi.OutputState }
   301  
   302  func (ClusterSnapshotMapOutput) ElementType() reflect.Type {
   303  	return reflect.TypeOf((*map[string]*ClusterSnapshot)(nil)).Elem()
   304  }
   305  
   306  func (o ClusterSnapshotMapOutput) ToClusterSnapshotMapOutput() ClusterSnapshotMapOutput {
   307  	return o
   308  }
   309  
   310  func (o ClusterSnapshotMapOutput) ToClusterSnapshotMapOutputWithContext(ctx context.Context) ClusterSnapshotMapOutput {
   311  	return o
   312  }
   313  
   314  func (o ClusterSnapshotMapOutput) MapIndex(k pulumi.StringInput) ClusterSnapshotOutput {
   315  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ClusterSnapshot {
   316  		return vs[0].(map[string]*ClusterSnapshot)[vs[1].(string)]
   317  	}).(ClusterSnapshotOutput)
   318  }
   319  
   320  func init() {
   321  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotInput)(nil)).Elem(), &ClusterSnapshot{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotArrayInput)(nil)).Elem(), ClusterSnapshotArray{})
   323  	pulumi.RegisterInputType(reflect.TypeOf((*ClusterSnapshotMapInput)(nil)).Elem(), ClusterSnapshotMap{})
   324  	pulumi.RegisterOutputType(ClusterSnapshotOutput{})
   325  	pulumi.RegisterOutputType(ClusterSnapshotArrayOutput{})
   326  	pulumi.RegisterOutputType(ClusterSnapshotMapOutput{})
   327  }