github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/quicksight/refreshSchedule.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 quicksight
     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  // Resource for managing a QuickSight Refresh Schedule.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic Usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    28  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    29  //
    30  // )
    31  //
    32  //	func main() {
    33  //		pulumi.Run(func(ctx *pulumi.Context) error {
    34  //			_, err := quicksight.NewRefreshSchedule(ctx, "example", &quicksight.RefreshScheduleArgs{
    35  //				DataSetId:  pulumi.String("dataset-id"),
    36  //				ScheduleId: pulumi.String("schedule-id"),
    37  //				Schedule: &quicksight.RefreshScheduleScheduleArgs{
    38  //					RefreshType: pulumi.String("FULL_REFRESH"),
    39  //					ScheduleFrequency: &quicksight.RefreshScheduleScheduleScheduleFrequencyArgs{
    40  //						Interval: pulumi.String("HOURLY"),
    41  //					},
    42  //				},
    43  //			})
    44  //			if err != nil {
    45  //				return err
    46  //			}
    47  //			return nil
    48  //		})
    49  //	}
    50  //
    51  // ```
    52  // <!--End PulumiCodeChooser -->
    53  //
    54  // ### With Weekly Refresh
    55  //
    56  // <!--Start PulumiCodeChooser -->
    57  // ```go
    58  // package main
    59  //
    60  // import (
    61  //
    62  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
    63  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    64  //
    65  // )
    66  //
    67  //	func main() {
    68  //		pulumi.Run(func(ctx *pulumi.Context) error {
    69  //			_, err := quicksight.NewRefreshSchedule(ctx, "example", &quicksight.RefreshScheduleArgs{
    70  //				DataSetId:  pulumi.String("dataset-id"),
    71  //				ScheduleId: pulumi.String("schedule-id"),
    72  //				Schedule: &quicksight.RefreshScheduleScheduleArgs{
    73  //					RefreshType: pulumi.String("INCREMENTAL_REFRESH"),
    74  //					ScheduleFrequency: &quicksight.RefreshScheduleScheduleScheduleFrequencyArgs{
    75  //						Interval:     pulumi.String("WEEKLY"),
    76  //						TimeOfTheDay: pulumi.String("01:00"),
    77  //						Timezone:     pulumi.String("Europe/London"),
    78  //						RefreshOnDay: &quicksight.RefreshScheduleScheduleScheduleFrequencyRefreshOnDayArgs{
    79  //							DayOfWeek: pulumi.String("MONDAY"),
    80  //						},
    81  //					},
    82  //				},
    83  //			})
    84  //			if err != nil {
    85  //				return err
    86  //			}
    87  //			return nil
    88  //		})
    89  //	}
    90  //
    91  // ```
    92  // <!--End PulumiCodeChooser -->
    93  //
    94  // ### With Monthly Refresh
    95  //
    96  // <!--Start PulumiCodeChooser -->
    97  // ```go
    98  // package main
    99  //
   100  // import (
   101  //
   102  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/quicksight"
   103  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
   104  //
   105  // )
   106  //
   107  //	func main() {
   108  //		pulumi.Run(func(ctx *pulumi.Context) error {
   109  //			_, err := quicksight.NewRefreshSchedule(ctx, "example", &quicksight.RefreshScheduleArgs{
   110  //				DataSetId:  pulumi.String("dataset-id"),
   111  //				ScheduleId: pulumi.String("schedule-id"),
   112  //				Schedule: &quicksight.RefreshScheduleScheduleArgs{
   113  //					RefreshType: pulumi.String("INCREMENTAL_REFRESH"),
   114  //					ScheduleFrequency: &quicksight.RefreshScheduleScheduleScheduleFrequencyArgs{
   115  //						Interval:     pulumi.String("MONTHLY"),
   116  //						TimeOfTheDay: pulumi.String("01:00"),
   117  //						Timezone:     pulumi.String("Europe/London"),
   118  //						RefreshOnDay: &quicksight.RefreshScheduleScheduleScheduleFrequencyRefreshOnDayArgs{
   119  //							DayOfMonth: pulumi.String("1"),
   120  //						},
   121  //					},
   122  //				},
   123  //			})
   124  //			if err != nil {
   125  //				return err
   126  //			}
   127  //			return nil
   128  //		})
   129  //	}
   130  //
   131  // ```
   132  // <!--End PulumiCodeChooser -->
   133  //
   134  // ## Import
   135  //
   136  // Using `pulumi import`, import a QuickSight Refresh Schedule using the AWS account ID, data set ID and schedule ID separated by commas (`,`). For example:
   137  //
   138  // ```sh
   139  // $ pulumi import aws:quicksight/refreshSchedule:RefreshSchedule example 123456789012,dataset-id,schedule-id
   140  // ```
   141  type RefreshSchedule struct {
   142  	pulumi.CustomResourceState
   143  
   144  	// Amazon Resource Name (ARN) of the refresh schedule.
   145  	Arn pulumi.StringOutput `pulumi:"arn"`
   146  	// AWS account ID.
   147  	AwsAccountId pulumi.StringOutput `pulumi:"awsAccountId"`
   148  	// The ID of the dataset.
   149  	DataSetId pulumi.StringOutput `pulumi:"dataSetId"`
   150  	// The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   151  	//
   152  	// The following arguments are optional:
   153  	Schedule RefreshScheduleSchedulePtrOutput `pulumi:"schedule"`
   154  	// The ID of the refresh schedule.
   155  	ScheduleId pulumi.StringOutput `pulumi:"scheduleId"`
   156  }
   157  
   158  // NewRefreshSchedule registers a new resource with the given unique name, arguments, and options.
   159  func NewRefreshSchedule(ctx *pulumi.Context,
   160  	name string, args *RefreshScheduleArgs, opts ...pulumi.ResourceOption) (*RefreshSchedule, error) {
   161  	if args == nil {
   162  		return nil, errors.New("missing one or more required arguments")
   163  	}
   164  
   165  	if args.DataSetId == nil {
   166  		return nil, errors.New("invalid value for required argument 'DataSetId'")
   167  	}
   168  	if args.ScheduleId == nil {
   169  		return nil, errors.New("invalid value for required argument 'ScheduleId'")
   170  	}
   171  	opts = internal.PkgResourceDefaultOpts(opts)
   172  	var resource RefreshSchedule
   173  	err := ctx.RegisterResource("aws:quicksight/refreshSchedule:RefreshSchedule", name, args, &resource, opts...)
   174  	if err != nil {
   175  		return nil, err
   176  	}
   177  	return &resource, nil
   178  }
   179  
   180  // GetRefreshSchedule gets an existing RefreshSchedule resource's state with the given name, ID, and optional
   181  // state properties that are used to uniquely qualify the lookup (nil if not required).
   182  func GetRefreshSchedule(ctx *pulumi.Context,
   183  	name string, id pulumi.IDInput, state *RefreshScheduleState, opts ...pulumi.ResourceOption) (*RefreshSchedule, error) {
   184  	var resource RefreshSchedule
   185  	err := ctx.ReadResource("aws:quicksight/refreshSchedule:RefreshSchedule", name, id, state, &resource, opts...)
   186  	if err != nil {
   187  		return nil, err
   188  	}
   189  	return &resource, nil
   190  }
   191  
   192  // Input properties used for looking up and filtering RefreshSchedule resources.
   193  type refreshScheduleState struct {
   194  	// Amazon Resource Name (ARN) of the refresh schedule.
   195  	Arn *string `pulumi:"arn"`
   196  	// AWS account ID.
   197  	AwsAccountId *string `pulumi:"awsAccountId"`
   198  	// The ID of the dataset.
   199  	DataSetId *string `pulumi:"dataSetId"`
   200  	// The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   201  	//
   202  	// The following arguments are optional:
   203  	Schedule *RefreshScheduleSchedule `pulumi:"schedule"`
   204  	// The ID of the refresh schedule.
   205  	ScheduleId *string `pulumi:"scheduleId"`
   206  }
   207  
   208  type RefreshScheduleState struct {
   209  	// Amazon Resource Name (ARN) of the refresh schedule.
   210  	Arn pulumi.StringPtrInput
   211  	// AWS account ID.
   212  	AwsAccountId pulumi.StringPtrInput
   213  	// The ID of the dataset.
   214  	DataSetId pulumi.StringPtrInput
   215  	// The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   216  	//
   217  	// The following arguments are optional:
   218  	Schedule RefreshScheduleSchedulePtrInput
   219  	// The ID of the refresh schedule.
   220  	ScheduleId pulumi.StringPtrInput
   221  }
   222  
   223  func (RefreshScheduleState) ElementType() reflect.Type {
   224  	return reflect.TypeOf((*refreshScheduleState)(nil)).Elem()
   225  }
   226  
   227  type refreshScheduleArgs struct {
   228  	// AWS account ID.
   229  	AwsAccountId *string `pulumi:"awsAccountId"`
   230  	// The ID of the dataset.
   231  	DataSetId string `pulumi:"dataSetId"`
   232  	// The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   233  	//
   234  	// The following arguments are optional:
   235  	Schedule *RefreshScheduleSchedule `pulumi:"schedule"`
   236  	// The ID of the refresh schedule.
   237  	ScheduleId string `pulumi:"scheduleId"`
   238  }
   239  
   240  // The set of arguments for constructing a RefreshSchedule resource.
   241  type RefreshScheduleArgs struct {
   242  	// AWS account ID.
   243  	AwsAccountId pulumi.StringPtrInput
   244  	// The ID of the dataset.
   245  	DataSetId pulumi.StringInput
   246  	// The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   247  	//
   248  	// The following arguments are optional:
   249  	Schedule RefreshScheduleSchedulePtrInput
   250  	// The ID of the refresh schedule.
   251  	ScheduleId pulumi.StringInput
   252  }
   253  
   254  func (RefreshScheduleArgs) ElementType() reflect.Type {
   255  	return reflect.TypeOf((*refreshScheduleArgs)(nil)).Elem()
   256  }
   257  
   258  type RefreshScheduleInput interface {
   259  	pulumi.Input
   260  
   261  	ToRefreshScheduleOutput() RefreshScheduleOutput
   262  	ToRefreshScheduleOutputWithContext(ctx context.Context) RefreshScheduleOutput
   263  }
   264  
   265  func (*RefreshSchedule) ElementType() reflect.Type {
   266  	return reflect.TypeOf((**RefreshSchedule)(nil)).Elem()
   267  }
   268  
   269  func (i *RefreshSchedule) ToRefreshScheduleOutput() RefreshScheduleOutput {
   270  	return i.ToRefreshScheduleOutputWithContext(context.Background())
   271  }
   272  
   273  func (i *RefreshSchedule) ToRefreshScheduleOutputWithContext(ctx context.Context) RefreshScheduleOutput {
   274  	return pulumi.ToOutputWithContext(ctx, i).(RefreshScheduleOutput)
   275  }
   276  
   277  // RefreshScheduleArrayInput is an input type that accepts RefreshScheduleArray and RefreshScheduleArrayOutput values.
   278  // You can construct a concrete instance of `RefreshScheduleArrayInput` via:
   279  //
   280  //	RefreshScheduleArray{ RefreshScheduleArgs{...} }
   281  type RefreshScheduleArrayInput interface {
   282  	pulumi.Input
   283  
   284  	ToRefreshScheduleArrayOutput() RefreshScheduleArrayOutput
   285  	ToRefreshScheduleArrayOutputWithContext(context.Context) RefreshScheduleArrayOutput
   286  }
   287  
   288  type RefreshScheduleArray []RefreshScheduleInput
   289  
   290  func (RefreshScheduleArray) ElementType() reflect.Type {
   291  	return reflect.TypeOf((*[]*RefreshSchedule)(nil)).Elem()
   292  }
   293  
   294  func (i RefreshScheduleArray) ToRefreshScheduleArrayOutput() RefreshScheduleArrayOutput {
   295  	return i.ToRefreshScheduleArrayOutputWithContext(context.Background())
   296  }
   297  
   298  func (i RefreshScheduleArray) ToRefreshScheduleArrayOutputWithContext(ctx context.Context) RefreshScheduleArrayOutput {
   299  	return pulumi.ToOutputWithContext(ctx, i).(RefreshScheduleArrayOutput)
   300  }
   301  
   302  // RefreshScheduleMapInput is an input type that accepts RefreshScheduleMap and RefreshScheduleMapOutput values.
   303  // You can construct a concrete instance of `RefreshScheduleMapInput` via:
   304  //
   305  //	RefreshScheduleMap{ "key": RefreshScheduleArgs{...} }
   306  type RefreshScheduleMapInput interface {
   307  	pulumi.Input
   308  
   309  	ToRefreshScheduleMapOutput() RefreshScheduleMapOutput
   310  	ToRefreshScheduleMapOutputWithContext(context.Context) RefreshScheduleMapOutput
   311  }
   312  
   313  type RefreshScheduleMap map[string]RefreshScheduleInput
   314  
   315  func (RefreshScheduleMap) ElementType() reflect.Type {
   316  	return reflect.TypeOf((*map[string]*RefreshSchedule)(nil)).Elem()
   317  }
   318  
   319  func (i RefreshScheduleMap) ToRefreshScheduleMapOutput() RefreshScheduleMapOutput {
   320  	return i.ToRefreshScheduleMapOutputWithContext(context.Background())
   321  }
   322  
   323  func (i RefreshScheduleMap) ToRefreshScheduleMapOutputWithContext(ctx context.Context) RefreshScheduleMapOutput {
   324  	return pulumi.ToOutputWithContext(ctx, i).(RefreshScheduleMapOutput)
   325  }
   326  
   327  type RefreshScheduleOutput struct{ *pulumi.OutputState }
   328  
   329  func (RefreshScheduleOutput) ElementType() reflect.Type {
   330  	return reflect.TypeOf((**RefreshSchedule)(nil)).Elem()
   331  }
   332  
   333  func (o RefreshScheduleOutput) ToRefreshScheduleOutput() RefreshScheduleOutput {
   334  	return o
   335  }
   336  
   337  func (o RefreshScheduleOutput) ToRefreshScheduleOutputWithContext(ctx context.Context) RefreshScheduleOutput {
   338  	return o
   339  }
   340  
   341  // Amazon Resource Name (ARN) of the refresh schedule.
   342  func (o RefreshScheduleOutput) Arn() pulumi.StringOutput {
   343  	return o.ApplyT(func(v *RefreshSchedule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   344  }
   345  
   346  // AWS account ID.
   347  func (o RefreshScheduleOutput) AwsAccountId() pulumi.StringOutput {
   348  	return o.ApplyT(func(v *RefreshSchedule) pulumi.StringOutput { return v.AwsAccountId }).(pulumi.StringOutput)
   349  }
   350  
   351  // The ID of the dataset.
   352  func (o RefreshScheduleOutput) DataSetId() pulumi.StringOutput {
   353  	return o.ApplyT(func(v *RefreshSchedule) pulumi.StringOutput { return v.DataSetId }).(pulumi.StringOutput)
   354  }
   355  
   356  // The [refresh schedule](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RefreshSchedule.html). See schedule
   357  //
   358  // The following arguments are optional:
   359  func (o RefreshScheduleOutput) Schedule() RefreshScheduleSchedulePtrOutput {
   360  	return o.ApplyT(func(v *RefreshSchedule) RefreshScheduleSchedulePtrOutput { return v.Schedule }).(RefreshScheduleSchedulePtrOutput)
   361  }
   362  
   363  // The ID of the refresh schedule.
   364  func (o RefreshScheduleOutput) ScheduleId() pulumi.StringOutput {
   365  	return o.ApplyT(func(v *RefreshSchedule) pulumi.StringOutput { return v.ScheduleId }).(pulumi.StringOutput)
   366  }
   367  
   368  type RefreshScheduleArrayOutput struct{ *pulumi.OutputState }
   369  
   370  func (RefreshScheduleArrayOutput) ElementType() reflect.Type {
   371  	return reflect.TypeOf((*[]*RefreshSchedule)(nil)).Elem()
   372  }
   373  
   374  func (o RefreshScheduleArrayOutput) ToRefreshScheduleArrayOutput() RefreshScheduleArrayOutput {
   375  	return o
   376  }
   377  
   378  func (o RefreshScheduleArrayOutput) ToRefreshScheduleArrayOutputWithContext(ctx context.Context) RefreshScheduleArrayOutput {
   379  	return o
   380  }
   381  
   382  func (o RefreshScheduleArrayOutput) Index(i pulumi.IntInput) RefreshScheduleOutput {
   383  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RefreshSchedule {
   384  		return vs[0].([]*RefreshSchedule)[vs[1].(int)]
   385  	}).(RefreshScheduleOutput)
   386  }
   387  
   388  type RefreshScheduleMapOutput struct{ *pulumi.OutputState }
   389  
   390  func (RefreshScheduleMapOutput) ElementType() reflect.Type {
   391  	return reflect.TypeOf((*map[string]*RefreshSchedule)(nil)).Elem()
   392  }
   393  
   394  func (o RefreshScheduleMapOutput) ToRefreshScheduleMapOutput() RefreshScheduleMapOutput {
   395  	return o
   396  }
   397  
   398  func (o RefreshScheduleMapOutput) ToRefreshScheduleMapOutputWithContext(ctx context.Context) RefreshScheduleMapOutput {
   399  	return o
   400  }
   401  
   402  func (o RefreshScheduleMapOutput) MapIndex(k pulumi.StringInput) RefreshScheduleOutput {
   403  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RefreshSchedule {
   404  		return vs[0].(map[string]*RefreshSchedule)[vs[1].(string)]
   405  	}).(RefreshScheduleOutput)
   406  }
   407  
   408  func init() {
   409  	pulumi.RegisterInputType(reflect.TypeOf((*RefreshScheduleInput)(nil)).Elem(), &RefreshSchedule{})
   410  	pulumi.RegisterInputType(reflect.TypeOf((*RefreshScheduleArrayInput)(nil)).Elem(), RefreshScheduleArray{})
   411  	pulumi.RegisterInputType(reflect.TypeOf((*RefreshScheduleMapInput)(nil)).Elem(), RefreshScheduleMap{})
   412  	pulumi.RegisterOutputType(RefreshScheduleOutput{})
   413  	pulumi.RegisterOutputType(RefreshScheduleArrayOutput{})
   414  	pulumi.RegisterOutputType(RefreshScheduleMapOutput{})
   415  }