github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/scheduler/scheduleGroup.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 scheduler
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Provides an EventBridge Scheduler Schedule Group resource.
    15  //
    16  // You can find out more about EventBridge Scheduler in the [User Guide](https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html).
    17  //
    18  // > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical.
    19  //
    20  // ## Example Usage
    21  //
    22  // <!--Start PulumiCodeChooser -->
    23  // ```go
    24  // package main
    25  //
    26  // import (
    27  //
    28  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/scheduler"
    29  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    30  //
    31  // )
    32  //
    33  //	func main() {
    34  //		pulumi.Run(func(ctx *pulumi.Context) error {
    35  //			_, err := scheduler.NewScheduleGroup(ctx, "example", &scheduler.ScheduleGroupArgs{
    36  //				Name: pulumi.String("my-schedule-group"),
    37  //			})
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  //
    48  // ## Import
    49  //
    50  // Using `pulumi import`, import schedule groups using the `name`. For example:
    51  //
    52  // ```sh
    53  // $ pulumi import aws:scheduler/scheduleGroup:ScheduleGroup example my-schedule-group
    54  // ```
    55  type ScheduleGroup struct {
    56  	pulumi.CustomResourceState
    57  
    58  	// ARN of the schedule group.
    59  	Arn pulumi.StringOutput `pulumi:"arn"`
    60  	// Time at which the schedule group was created.
    61  	CreationDate pulumi.StringOutput `pulumi:"creationDate"`
    62  	// Time at which the schedule group was last modified.
    63  	LastModificationDate pulumi.StringOutput `pulumi:"lastModificationDate"`
    64  	// Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
    65  	Name pulumi.StringOutput `pulumi:"name"`
    66  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
    67  	NamePrefix pulumi.StringOutput `pulumi:"namePrefix"`
    68  	// State of the schedule group. Can be `ACTIVE` or `DELETING`.
    69  	State pulumi.StringOutput `pulumi:"state"`
    70  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    71  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    72  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    73  	//
    74  	// Deprecated: Please use `tags` instead.
    75  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    76  }
    77  
    78  // NewScheduleGroup registers a new resource with the given unique name, arguments, and options.
    79  func NewScheduleGroup(ctx *pulumi.Context,
    80  	name string, args *ScheduleGroupArgs, opts ...pulumi.ResourceOption) (*ScheduleGroup, error) {
    81  	if args == nil {
    82  		args = &ScheduleGroupArgs{}
    83  	}
    84  
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource ScheduleGroup
    87  	err := ctx.RegisterResource("aws:scheduler/scheduleGroup:ScheduleGroup", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetScheduleGroup gets an existing ScheduleGroup resource's state with the given name, ID, and optional
    95  // state properties that are used to uniquely qualify the lookup (nil if not required).
    96  func GetScheduleGroup(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *ScheduleGroupState, opts ...pulumi.ResourceOption) (*ScheduleGroup, error) {
    98  	var resource ScheduleGroup
    99  	err := ctx.ReadResource("aws:scheduler/scheduleGroup:ScheduleGroup", name, id, state, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // Input properties used for looking up and filtering ScheduleGroup resources.
   107  type scheduleGroupState struct {
   108  	// ARN of the schedule group.
   109  	Arn *string `pulumi:"arn"`
   110  	// Time at which the schedule group was created.
   111  	CreationDate *string `pulumi:"creationDate"`
   112  	// Time at which the schedule group was last modified.
   113  	LastModificationDate *string `pulumi:"lastModificationDate"`
   114  	// Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   115  	Name *string `pulumi:"name"`
   116  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   117  	NamePrefix *string `pulumi:"namePrefix"`
   118  	// State of the schedule group. Can be `ACTIVE` or `DELETING`.
   119  	State *string `pulumi:"state"`
   120  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   121  	Tags map[string]string `pulumi:"tags"`
   122  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   123  	//
   124  	// Deprecated: Please use `tags` instead.
   125  	TagsAll map[string]string `pulumi:"tagsAll"`
   126  }
   127  
   128  type ScheduleGroupState struct {
   129  	// ARN of the schedule group.
   130  	Arn pulumi.StringPtrInput
   131  	// Time at which the schedule group was created.
   132  	CreationDate pulumi.StringPtrInput
   133  	// Time at which the schedule group was last modified.
   134  	LastModificationDate pulumi.StringPtrInput
   135  	// Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   136  	Name pulumi.StringPtrInput
   137  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   138  	NamePrefix pulumi.StringPtrInput
   139  	// State of the schedule group. Can be `ACTIVE` or `DELETING`.
   140  	State pulumi.StringPtrInput
   141  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   142  	Tags pulumi.StringMapInput
   143  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   144  	//
   145  	// Deprecated: Please use `tags` instead.
   146  	TagsAll pulumi.StringMapInput
   147  }
   148  
   149  func (ScheduleGroupState) ElementType() reflect.Type {
   150  	return reflect.TypeOf((*scheduleGroupState)(nil)).Elem()
   151  }
   152  
   153  type scheduleGroupArgs struct {
   154  	// Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   155  	Name *string `pulumi:"name"`
   156  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   157  	NamePrefix *string `pulumi:"namePrefix"`
   158  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   159  	Tags map[string]string `pulumi:"tags"`
   160  }
   161  
   162  // The set of arguments for constructing a ScheduleGroup resource.
   163  type ScheduleGroupArgs struct {
   164  	// Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   165  	Name pulumi.StringPtrInput
   166  	// Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   167  	NamePrefix pulumi.StringPtrInput
   168  	// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   169  	Tags pulumi.StringMapInput
   170  }
   171  
   172  func (ScheduleGroupArgs) ElementType() reflect.Type {
   173  	return reflect.TypeOf((*scheduleGroupArgs)(nil)).Elem()
   174  }
   175  
   176  type ScheduleGroupInput interface {
   177  	pulumi.Input
   178  
   179  	ToScheduleGroupOutput() ScheduleGroupOutput
   180  	ToScheduleGroupOutputWithContext(ctx context.Context) ScheduleGroupOutput
   181  }
   182  
   183  func (*ScheduleGroup) ElementType() reflect.Type {
   184  	return reflect.TypeOf((**ScheduleGroup)(nil)).Elem()
   185  }
   186  
   187  func (i *ScheduleGroup) ToScheduleGroupOutput() ScheduleGroupOutput {
   188  	return i.ToScheduleGroupOutputWithContext(context.Background())
   189  }
   190  
   191  func (i *ScheduleGroup) ToScheduleGroupOutputWithContext(ctx context.Context) ScheduleGroupOutput {
   192  	return pulumi.ToOutputWithContext(ctx, i).(ScheduleGroupOutput)
   193  }
   194  
   195  // ScheduleGroupArrayInput is an input type that accepts ScheduleGroupArray and ScheduleGroupArrayOutput values.
   196  // You can construct a concrete instance of `ScheduleGroupArrayInput` via:
   197  //
   198  //	ScheduleGroupArray{ ScheduleGroupArgs{...} }
   199  type ScheduleGroupArrayInput interface {
   200  	pulumi.Input
   201  
   202  	ToScheduleGroupArrayOutput() ScheduleGroupArrayOutput
   203  	ToScheduleGroupArrayOutputWithContext(context.Context) ScheduleGroupArrayOutput
   204  }
   205  
   206  type ScheduleGroupArray []ScheduleGroupInput
   207  
   208  func (ScheduleGroupArray) ElementType() reflect.Type {
   209  	return reflect.TypeOf((*[]*ScheduleGroup)(nil)).Elem()
   210  }
   211  
   212  func (i ScheduleGroupArray) ToScheduleGroupArrayOutput() ScheduleGroupArrayOutput {
   213  	return i.ToScheduleGroupArrayOutputWithContext(context.Background())
   214  }
   215  
   216  func (i ScheduleGroupArray) ToScheduleGroupArrayOutputWithContext(ctx context.Context) ScheduleGroupArrayOutput {
   217  	return pulumi.ToOutputWithContext(ctx, i).(ScheduleGroupArrayOutput)
   218  }
   219  
   220  // ScheduleGroupMapInput is an input type that accepts ScheduleGroupMap and ScheduleGroupMapOutput values.
   221  // You can construct a concrete instance of `ScheduleGroupMapInput` via:
   222  //
   223  //	ScheduleGroupMap{ "key": ScheduleGroupArgs{...} }
   224  type ScheduleGroupMapInput interface {
   225  	pulumi.Input
   226  
   227  	ToScheduleGroupMapOutput() ScheduleGroupMapOutput
   228  	ToScheduleGroupMapOutputWithContext(context.Context) ScheduleGroupMapOutput
   229  }
   230  
   231  type ScheduleGroupMap map[string]ScheduleGroupInput
   232  
   233  func (ScheduleGroupMap) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*map[string]*ScheduleGroup)(nil)).Elem()
   235  }
   236  
   237  func (i ScheduleGroupMap) ToScheduleGroupMapOutput() ScheduleGroupMapOutput {
   238  	return i.ToScheduleGroupMapOutputWithContext(context.Background())
   239  }
   240  
   241  func (i ScheduleGroupMap) ToScheduleGroupMapOutputWithContext(ctx context.Context) ScheduleGroupMapOutput {
   242  	return pulumi.ToOutputWithContext(ctx, i).(ScheduleGroupMapOutput)
   243  }
   244  
   245  type ScheduleGroupOutput struct{ *pulumi.OutputState }
   246  
   247  func (ScheduleGroupOutput) ElementType() reflect.Type {
   248  	return reflect.TypeOf((**ScheduleGroup)(nil)).Elem()
   249  }
   250  
   251  func (o ScheduleGroupOutput) ToScheduleGroupOutput() ScheduleGroupOutput {
   252  	return o
   253  }
   254  
   255  func (o ScheduleGroupOutput) ToScheduleGroupOutputWithContext(ctx context.Context) ScheduleGroupOutput {
   256  	return o
   257  }
   258  
   259  // ARN of the schedule group.
   260  func (o ScheduleGroupOutput) Arn() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   262  }
   263  
   264  // Time at which the schedule group was created.
   265  func (o ScheduleGroupOutput) CreationDate() pulumi.StringOutput {
   266  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.CreationDate }).(pulumi.StringOutput)
   267  }
   268  
   269  // Time at which the schedule group was last modified.
   270  func (o ScheduleGroupOutput) LastModificationDate() pulumi.StringOutput {
   271  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.LastModificationDate }).(pulumi.StringOutput)
   272  }
   273  
   274  // Name of the schedule group. If omitted, the provider will assign a random, unique name. Conflicts with `namePrefix`.
   275  func (o ScheduleGroupOutput) Name() pulumi.StringOutput {
   276  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   277  }
   278  
   279  // Creates a unique name beginning with the specified prefix. Conflicts with `name`.
   280  func (o ScheduleGroupOutput) NamePrefix() pulumi.StringOutput {
   281  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.NamePrefix }).(pulumi.StringOutput)
   282  }
   283  
   284  // State of the schedule group. Can be `ACTIVE` or `DELETING`.
   285  func (o ScheduleGroupOutput) State() pulumi.StringOutput {
   286  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
   287  }
   288  
   289  // Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
   290  func (o ScheduleGroupOutput) Tags() pulumi.StringMapOutput {
   291  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   292  }
   293  
   294  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   295  //
   296  // Deprecated: Please use `tags` instead.
   297  func (o ScheduleGroupOutput) TagsAll() pulumi.StringMapOutput {
   298  	return o.ApplyT(func(v *ScheduleGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   299  }
   300  
   301  type ScheduleGroupArrayOutput struct{ *pulumi.OutputState }
   302  
   303  func (ScheduleGroupArrayOutput) ElementType() reflect.Type {
   304  	return reflect.TypeOf((*[]*ScheduleGroup)(nil)).Elem()
   305  }
   306  
   307  func (o ScheduleGroupArrayOutput) ToScheduleGroupArrayOutput() ScheduleGroupArrayOutput {
   308  	return o
   309  }
   310  
   311  func (o ScheduleGroupArrayOutput) ToScheduleGroupArrayOutputWithContext(ctx context.Context) ScheduleGroupArrayOutput {
   312  	return o
   313  }
   314  
   315  func (o ScheduleGroupArrayOutput) Index(i pulumi.IntInput) ScheduleGroupOutput {
   316  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ScheduleGroup {
   317  		return vs[0].([]*ScheduleGroup)[vs[1].(int)]
   318  	}).(ScheduleGroupOutput)
   319  }
   320  
   321  type ScheduleGroupMapOutput struct{ *pulumi.OutputState }
   322  
   323  func (ScheduleGroupMapOutput) ElementType() reflect.Type {
   324  	return reflect.TypeOf((*map[string]*ScheduleGroup)(nil)).Elem()
   325  }
   326  
   327  func (o ScheduleGroupMapOutput) ToScheduleGroupMapOutput() ScheduleGroupMapOutput {
   328  	return o
   329  }
   330  
   331  func (o ScheduleGroupMapOutput) ToScheduleGroupMapOutputWithContext(ctx context.Context) ScheduleGroupMapOutput {
   332  	return o
   333  }
   334  
   335  func (o ScheduleGroupMapOutput) MapIndex(k pulumi.StringInput) ScheduleGroupOutput {
   336  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ScheduleGroup {
   337  		return vs[0].(map[string]*ScheduleGroup)[vs[1].(string)]
   338  	}).(ScheduleGroupOutput)
   339  }
   340  
   341  func init() {
   342  	pulumi.RegisterInputType(reflect.TypeOf((*ScheduleGroupInput)(nil)).Elem(), &ScheduleGroup{})
   343  	pulumi.RegisterInputType(reflect.TypeOf((*ScheduleGroupArrayInput)(nil)).Elem(), ScheduleGroupArray{})
   344  	pulumi.RegisterInputType(reflect.TypeOf((*ScheduleGroupMapInput)(nil)).Elem(), ScheduleGroupMap{})
   345  	pulumi.RegisterOutputType(ScheduleGroupOutput{})
   346  	pulumi.RegisterOutputType(ScheduleGroupArrayOutput{})
   347  	pulumi.RegisterOutputType(ScheduleGroupMapOutput{})
   348  }