github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/snapshotSchedule.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  // ## Example Usage
    16  //
    17  // <!--Start PulumiCodeChooser -->
    18  // ```go
    19  // package main
    20  //
    21  // import (
    22  //
    23  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/redshift"
    24  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    25  //
    26  // )
    27  //
    28  //	func main() {
    29  //		pulumi.Run(func(ctx *pulumi.Context) error {
    30  //			_, err := redshift.NewSnapshotSchedule(ctx, "default", &redshift.SnapshotScheduleArgs{
    31  //				Identifier: pulumi.String("tf-redshift-snapshot-schedule"),
    32  //				Definitions: pulumi.StringArray{
    33  //					pulumi.String("rate(12 hours)"),
    34  //				},
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import Redshift Snapshot Schedule using the `identifier`. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:redshift/snapshotSchedule:SnapshotSchedule default tf-redshift-snapshot-schedule
    52  // ```
    53  type SnapshotSchedule struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// Amazon Resource Name (ARN) of the Redshift Snapshot Schedule.
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
    59  	Definitions pulumi.StringArrayOutput `pulumi:"definitions"`
    60  	// The description of the snapshot schedule.
    61  	Description pulumi.StringPtrOutput `pulumi:"description"`
    62  	// Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
    63  	ForceDestroy pulumi.BoolPtrOutput `pulumi:"forceDestroy"`
    64  	// The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
    65  	Identifier pulumi.StringOutput `pulumi:"identifier"`
    66  	// Creates a unique
    67  	// identifier beginning with the specified prefix. Conflicts with `identifier`.
    68  	IdentifierPrefix pulumi.StringOutput `pulumi:"identifierPrefix"`
    69  	// 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.
    70  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    71  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    72  	//
    73  	// Deprecated: Please use `tags` instead.
    74  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    75  }
    76  
    77  // NewSnapshotSchedule registers a new resource with the given unique name, arguments, and options.
    78  func NewSnapshotSchedule(ctx *pulumi.Context,
    79  	name string, args *SnapshotScheduleArgs, opts ...pulumi.ResourceOption) (*SnapshotSchedule, error) {
    80  	if args == nil {
    81  		return nil, errors.New("missing one or more required arguments")
    82  	}
    83  
    84  	if args.Definitions == nil {
    85  		return nil, errors.New("invalid value for required argument 'Definitions'")
    86  	}
    87  	opts = internal.PkgResourceDefaultOpts(opts)
    88  	var resource SnapshotSchedule
    89  	err := ctx.RegisterResource("aws:redshift/snapshotSchedule:SnapshotSchedule", name, args, &resource, opts...)
    90  	if err != nil {
    91  		return nil, err
    92  	}
    93  	return &resource, nil
    94  }
    95  
    96  // GetSnapshotSchedule gets an existing SnapshotSchedule resource's state with the given name, ID, and optional
    97  // state properties that are used to uniquely qualify the lookup (nil if not required).
    98  func GetSnapshotSchedule(ctx *pulumi.Context,
    99  	name string, id pulumi.IDInput, state *SnapshotScheduleState, opts ...pulumi.ResourceOption) (*SnapshotSchedule, error) {
   100  	var resource SnapshotSchedule
   101  	err := ctx.ReadResource("aws:redshift/snapshotSchedule:SnapshotSchedule", name, id, state, &resource, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	return &resource, nil
   106  }
   107  
   108  // Input properties used for looking up and filtering SnapshotSchedule resources.
   109  type snapshotScheduleState struct {
   110  	// Amazon Resource Name (ARN) of the Redshift Snapshot Schedule.
   111  	Arn *string `pulumi:"arn"`
   112  	// The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
   113  	Definitions []string `pulumi:"definitions"`
   114  	// The description of the snapshot schedule.
   115  	Description *string `pulumi:"description"`
   116  	// Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
   117  	ForceDestroy *bool `pulumi:"forceDestroy"`
   118  	// The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
   119  	Identifier *string `pulumi:"identifier"`
   120  	// Creates a unique
   121  	// identifier beginning with the specified prefix. Conflicts with `identifier`.
   122  	IdentifierPrefix *string `pulumi:"identifierPrefix"`
   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 map[string]string `pulumi:"tags"`
   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 map[string]string `pulumi:"tagsAll"`
   129  }
   130  
   131  type SnapshotScheduleState struct {
   132  	// Amazon Resource Name (ARN) of the Redshift Snapshot Schedule.
   133  	Arn pulumi.StringPtrInput
   134  	// The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
   135  	Definitions pulumi.StringArrayInput
   136  	// The description of the snapshot schedule.
   137  	Description pulumi.StringPtrInput
   138  	// Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
   139  	ForceDestroy pulumi.BoolPtrInput
   140  	// The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
   141  	Identifier pulumi.StringPtrInput
   142  	// Creates a unique
   143  	// identifier beginning with the specified prefix. Conflicts with `identifier`.
   144  	IdentifierPrefix pulumi.StringPtrInput
   145  	// 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.
   146  	Tags pulumi.StringMapInput
   147  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   148  	//
   149  	// Deprecated: Please use `tags` instead.
   150  	TagsAll pulumi.StringMapInput
   151  }
   152  
   153  func (SnapshotScheduleState) ElementType() reflect.Type {
   154  	return reflect.TypeOf((*snapshotScheduleState)(nil)).Elem()
   155  }
   156  
   157  type snapshotScheduleArgs struct {
   158  	// The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
   159  	Definitions []string `pulumi:"definitions"`
   160  	// The description of the snapshot schedule.
   161  	Description *string `pulumi:"description"`
   162  	// Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
   163  	ForceDestroy *bool `pulumi:"forceDestroy"`
   164  	// The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
   165  	Identifier *string `pulumi:"identifier"`
   166  	// Creates a unique
   167  	// identifier beginning with the specified prefix. Conflicts with `identifier`.
   168  	IdentifierPrefix *string `pulumi:"identifierPrefix"`
   169  	// 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.
   170  	Tags map[string]string `pulumi:"tags"`
   171  }
   172  
   173  // The set of arguments for constructing a SnapshotSchedule resource.
   174  type SnapshotScheduleArgs struct {
   175  	// The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
   176  	Definitions pulumi.StringArrayInput
   177  	// The description of the snapshot schedule.
   178  	Description pulumi.StringPtrInput
   179  	// Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
   180  	ForceDestroy pulumi.BoolPtrInput
   181  	// The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
   182  	Identifier pulumi.StringPtrInput
   183  	// Creates a unique
   184  	// identifier beginning with the specified prefix. Conflicts with `identifier`.
   185  	IdentifierPrefix pulumi.StringPtrInput
   186  	// 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.
   187  	Tags pulumi.StringMapInput
   188  }
   189  
   190  func (SnapshotScheduleArgs) ElementType() reflect.Type {
   191  	return reflect.TypeOf((*snapshotScheduleArgs)(nil)).Elem()
   192  }
   193  
   194  type SnapshotScheduleInput interface {
   195  	pulumi.Input
   196  
   197  	ToSnapshotScheduleOutput() SnapshotScheduleOutput
   198  	ToSnapshotScheduleOutputWithContext(ctx context.Context) SnapshotScheduleOutput
   199  }
   200  
   201  func (*SnapshotSchedule) ElementType() reflect.Type {
   202  	return reflect.TypeOf((**SnapshotSchedule)(nil)).Elem()
   203  }
   204  
   205  func (i *SnapshotSchedule) ToSnapshotScheduleOutput() SnapshotScheduleOutput {
   206  	return i.ToSnapshotScheduleOutputWithContext(context.Background())
   207  }
   208  
   209  func (i *SnapshotSchedule) ToSnapshotScheduleOutputWithContext(ctx context.Context) SnapshotScheduleOutput {
   210  	return pulumi.ToOutputWithContext(ctx, i).(SnapshotScheduleOutput)
   211  }
   212  
   213  // SnapshotScheduleArrayInput is an input type that accepts SnapshotScheduleArray and SnapshotScheduleArrayOutput values.
   214  // You can construct a concrete instance of `SnapshotScheduleArrayInput` via:
   215  //
   216  //	SnapshotScheduleArray{ SnapshotScheduleArgs{...} }
   217  type SnapshotScheduleArrayInput interface {
   218  	pulumi.Input
   219  
   220  	ToSnapshotScheduleArrayOutput() SnapshotScheduleArrayOutput
   221  	ToSnapshotScheduleArrayOutputWithContext(context.Context) SnapshotScheduleArrayOutput
   222  }
   223  
   224  type SnapshotScheduleArray []SnapshotScheduleInput
   225  
   226  func (SnapshotScheduleArray) ElementType() reflect.Type {
   227  	return reflect.TypeOf((*[]*SnapshotSchedule)(nil)).Elem()
   228  }
   229  
   230  func (i SnapshotScheduleArray) ToSnapshotScheduleArrayOutput() SnapshotScheduleArrayOutput {
   231  	return i.ToSnapshotScheduleArrayOutputWithContext(context.Background())
   232  }
   233  
   234  func (i SnapshotScheduleArray) ToSnapshotScheduleArrayOutputWithContext(ctx context.Context) SnapshotScheduleArrayOutput {
   235  	return pulumi.ToOutputWithContext(ctx, i).(SnapshotScheduleArrayOutput)
   236  }
   237  
   238  // SnapshotScheduleMapInput is an input type that accepts SnapshotScheduleMap and SnapshotScheduleMapOutput values.
   239  // You can construct a concrete instance of `SnapshotScheduleMapInput` via:
   240  //
   241  //	SnapshotScheduleMap{ "key": SnapshotScheduleArgs{...} }
   242  type SnapshotScheduleMapInput interface {
   243  	pulumi.Input
   244  
   245  	ToSnapshotScheduleMapOutput() SnapshotScheduleMapOutput
   246  	ToSnapshotScheduleMapOutputWithContext(context.Context) SnapshotScheduleMapOutput
   247  }
   248  
   249  type SnapshotScheduleMap map[string]SnapshotScheduleInput
   250  
   251  func (SnapshotScheduleMap) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*map[string]*SnapshotSchedule)(nil)).Elem()
   253  }
   254  
   255  func (i SnapshotScheduleMap) ToSnapshotScheduleMapOutput() SnapshotScheduleMapOutput {
   256  	return i.ToSnapshotScheduleMapOutputWithContext(context.Background())
   257  }
   258  
   259  func (i SnapshotScheduleMap) ToSnapshotScheduleMapOutputWithContext(ctx context.Context) SnapshotScheduleMapOutput {
   260  	return pulumi.ToOutputWithContext(ctx, i).(SnapshotScheduleMapOutput)
   261  }
   262  
   263  type SnapshotScheduleOutput struct{ *pulumi.OutputState }
   264  
   265  func (SnapshotScheduleOutput) ElementType() reflect.Type {
   266  	return reflect.TypeOf((**SnapshotSchedule)(nil)).Elem()
   267  }
   268  
   269  func (o SnapshotScheduleOutput) ToSnapshotScheduleOutput() SnapshotScheduleOutput {
   270  	return o
   271  }
   272  
   273  func (o SnapshotScheduleOutput) ToSnapshotScheduleOutputWithContext(ctx context.Context) SnapshotScheduleOutput {
   274  	return o
   275  }
   276  
   277  // Amazon Resource Name (ARN) of the Redshift Snapshot Schedule.
   278  func (o SnapshotScheduleOutput) Arn() pulumi.StringOutput {
   279  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   280  }
   281  
   282  // The definition of the snapshot schedule. The definition is made up of schedule expressions, for example `cron(30 12 *)` or `rate(12 hours)`.
   283  func (o SnapshotScheduleOutput) Definitions() pulumi.StringArrayOutput {
   284  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringArrayOutput { return v.Definitions }).(pulumi.StringArrayOutput)
   285  }
   286  
   287  // The description of the snapshot schedule.
   288  func (o SnapshotScheduleOutput) Description() pulumi.StringPtrOutput {
   289  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   290  }
   291  
   292  // Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion.
   293  func (o SnapshotScheduleOutput) ForceDestroy() pulumi.BoolPtrOutput {
   294  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.BoolPtrOutput { return v.ForceDestroy }).(pulumi.BoolPtrOutput)
   295  }
   296  
   297  // The snapshot schedule identifier. If omitted, this provider will assign a random, unique identifier.
   298  func (o SnapshotScheduleOutput) Identifier() pulumi.StringOutput {
   299  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringOutput { return v.Identifier }).(pulumi.StringOutput)
   300  }
   301  
   302  // Creates a unique
   303  // identifier beginning with the specified prefix. Conflicts with `identifier`.
   304  func (o SnapshotScheduleOutput) IdentifierPrefix() pulumi.StringOutput {
   305  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringOutput { return v.IdentifierPrefix }).(pulumi.StringOutput)
   306  }
   307  
   308  // 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.
   309  func (o SnapshotScheduleOutput) Tags() pulumi.StringMapOutput {
   310  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   311  }
   312  
   313  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   314  //
   315  // Deprecated: Please use `tags` instead.
   316  func (o SnapshotScheduleOutput) TagsAll() pulumi.StringMapOutput {
   317  	return o.ApplyT(func(v *SnapshotSchedule) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   318  }
   319  
   320  type SnapshotScheduleArrayOutput struct{ *pulumi.OutputState }
   321  
   322  func (SnapshotScheduleArrayOutput) ElementType() reflect.Type {
   323  	return reflect.TypeOf((*[]*SnapshotSchedule)(nil)).Elem()
   324  }
   325  
   326  func (o SnapshotScheduleArrayOutput) ToSnapshotScheduleArrayOutput() SnapshotScheduleArrayOutput {
   327  	return o
   328  }
   329  
   330  func (o SnapshotScheduleArrayOutput) ToSnapshotScheduleArrayOutputWithContext(ctx context.Context) SnapshotScheduleArrayOutput {
   331  	return o
   332  }
   333  
   334  func (o SnapshotScheduleArrayOutput) Index(i pulumi.IntInput) SnapshotScheduleOutput {
   335  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *SnapshotSchedule {
   336  		return vs[0].([]*SnapshotSchedule)[vs[1].(int)]
   337  	}).(SnapshotScheduleOutput)
   338  }
   339  
   340  type SnapshotScheduleMapOutput struct{ *pulumi.OutputState }
   341  
   342  func (SnapshotScheduleMapOutput) ElementType() reflect.Type {
   343  	return reflect.TypeOf((*map[string]*SnapshotSchedule)(nil)).Elem()
   344  }
   345  
   346  func (o SnapshotScheduleMapOutput) ToSnapshotScheduleMapOutput() SnapshotScheduleMapOutput {
   347  	return o
   348  }
   349  
   350  func (o SnapshotScheduleMapOutput) ToSnapshotScheduleMapOutputWithContext(ctx context.Context) SnapshotScheduleMapOutput {
   351  	return o
   352  }
   353  
   354  func (o SnapshotScheduleMapOutput) MapIndex(k pulumi.StringInput) SnapshotScheduleOutput {
   355  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *SnapshotSchedule {
   356  		return vs[0].(map[string]*SnapshotSchedule)[vs[1].(string)]
   357  	}).(SnapshotScheduleOutput)
   358  }
   359  
   360  func init() {
   361  	pulumi.RegisterInputType(reflect.TypeOf((*SnapshotScheduleInput)(nil)).Elem(), &SnapshotSchedule{})
   362  	pulumi.RegisterInputType(reflect.TypeOf((*SnapshotScheduleArrayInput)(nil)).Elem(), SnapshotScheduleArray{})
   363  	pulumi.RegisterInputType(reflect.TypeOf((*SnapshotScheduleMapInput)(nil)).Elem(), SnapshotScheduleMap{})
   364  	pulumi.RegisterOutputType(SnapshotScheduleOutput{})
   365  	pulumi.RegisterOutputType(SnapshotScheduleArrayOutput{})
   366  	pulumi.RegisterOutputType(SnapshotScheduleMapOutput{})
   367  }