github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/monitoringSchedule.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 sagemaker
     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  // Provides a SageMaker monitoring schedule resource.
    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/sagemaker"
    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 := sagemaker.NewMonitoringSchedule(ctx, "test", &sagemaker.MonitoringScheduleArgs{
    35  //				Name: pulumi.String("my-monitoring-schedule"),
    36  //				MonitoringScheduleConfig: &sagemaker.MonitoringScheduleMonitoringScheduleConfigArgs{
    37  //					MonitoringJobDefinitionName: pulumi.Any(testAwsSagemakerDataQualityJobDefinition.Name),
    38  //					MonitoringType:              pulumi.String("DataQuality"),
    39  //				},
    40  //			})
    41  //			if err != nil {
    42  //				return err
    43  //			}
    44  //			return nil
    45  //		})
    46  //	}
    47  //
    48  // ```
    49  // <!--End PulumiCodeChooser -->
    50  //
    51  // ## Import
    52  //
    53  // Using `pulumi import`, import monitoring schedules using the `name`. For example:
    54  //
    55  // ```sh
    56  // $ pulumi import aws:sagemaker/monitoringSchedule:MonitoringSchedule test_monitoring_schedule monitoring-schedule-foo
    57  // ```
    58  type MonitoringSchedule struct {
    59  	pulumi.CustomResourceState
    60  
    61  	// The Amazon Resource Name (ARN) assigned by AWS to this monitoring schedule.
    62  	Arn pulumi.StringOutput `pulumi:"arn"`
    63  	// The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
    64  	MonitoringScheduleConfig MonitoringScheduleMonitoringScheduleConfigOutput `pulumi:"monitoringScheduleConfig"`
    65  	// The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
    66  	Name pulumi.StringOutput `pulumi:"name"`
    67  	// A mapping 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.
    68  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    69  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    70  	//
    71  	// Deprecated: Please use `tags` instead.
    72  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    73  }
    74  
    75  // NewMonitoringSchedule registers a new resource with the given unique name, arguments, and options.
    76  func NewMonitoringSchedule(ctx *pulumi.Context,
    77  	name string, args *MonitoringScheduleArgs, opts ...pulumi.ResourceOption) (*MonitoringSchedule, error) {
    78  	if args == nil {
    79  		return nil, errors.New("missing one or more required arguments")
    80  	}
    81  
    82  	if args.MonitoringScheduleConfig == nil {
    83  		return nil, errors.New("invalid value for required argument 'MonitoringScheduleConfig'")
    84  	}
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource MonitoringSchedule
    87  	err := ctx.RegisterResource("aws:sagemaker/monitoringSchedule:MonitoringSchedule", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetMonitoringSchedule gets an existing MonitoringSchedule 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 GetMonitoringSchedule(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *MonitoringScheduleState, opts ...pulumi.ResourceOption) (*MonitoringSchedule, error) {
    98  	var resource MonitoringSchedule
    99  	err := ctx.ReadResource("aws:sagemaker/monitoringSchedule:MonitoringSchedule", 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 MonitoringSchedule resources.
   107  type monitoringScheduleState struct {
   108  	// The Amazon Resource Name (ARN) assigned by AWS to this monitoring schedule.
   109  	Arn *string `pulumi:"arn"`
   110  	// The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
   111  	MonitoringScheduleConfig *MonitoringScheduleMonitoringScheduleConfig `pulumi:"monitoringScheduleConfig"`
   112  	// The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
   113  	Name *string `pulumi:"name"`
   114  	// A mapping 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.
   115  	Tags map[string]string `pulumi:"tags"`
   116  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   117  	//
   118  	// Deprecated: Please use `tags` instead.
   119  	TagsAll map[string]string `pulumi:"tagsAll"`
   120  }
   121  
   122  type MonitoringScheduleState struct {
   123  	// The Amazon Resource Name (ARN) assigned by AWS to this monitoring schedule.
   124  	Arn pulumi.StringPtrInput
   125  	// The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
   126  	MonitoringScheduleConfig MonitoringScheduleMonitoringScheduleConfigPtrInput
   127  	// The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
   128  	Name pulumi.StringPtrInput
   129  	// A mapping 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.
   130  	Tags pulumi.StringMapInput
   131  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   132  	//
   133  	// Deprecated: Please use `tags` instead.
   134  	TagsAll pulumi.StringMapInput
   135  }
   136  
   137  func (MonitoringScheduleState) ElementType() reflect.Type {
   138  	return reflect.TypeOf((*monitoringScheduleState)(nil)).Elem()
   139  }
   140  
   141  type monitoringScheduleArgs struct {
   142  	// The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
   143  	MonitoringScheduleConfig MonitoringScheduleMonitoringScheduleConfig `pulumi:"monitoringScheduleConfig"`
   144  	// The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
   145  	Name *string `pulumi:"name"`
   146  	// A mapping 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.
   147  	Tags map[string]string `pulumi:"tags"`
   148  }
   149  
   150  // The set of arguments for constructing a MonitoringSchedule resource.
   151  type MonitoringScheduleArgs struct {
   152  	// The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
   153  	MonitoringScheduleConfig MonitoringScheduleMonitoringScheduleConfigInput
   154  	// The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
   155  	Name pulumi.StringPtrInput
   156  	// A mapping 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.
   157  	Tags pulumi.StringMapInput
   158  }
   159  
   160  func (MonitoringScheduleArgs) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*monitoringScheduleArgs)(nil)).Elem()
   162  }
   163  
   164  type MonitoringScheduleInput interface {
   165  	pulumi.Input
   166  
   167  	ToMonitoringScheduleOutput() MonitoringScheduleOutput
   168  	ToMonitoringScheduleOutputWithContext(ctx context.Context) MonitoringScheduleOutput
   169  }
   170  
   171  func (*MonitoringSchedule) ElementType() reflect.Type {
   172  	return reflect.TypeOf((**MonitoringSchedule)(nil)).Elem()
   173  }
   174  
   175  func (i *MonitoringSchedule) ToMonitoringScheduleOutput() MonitoringScheduleOutput {
   176  	return i.ToMonitoringScheduleOutputWithContext(context.Background())
   177  }
   178  
   179  func (i *MonitoringSchedule) ToMonitoringScheduleOutputWithContext(ctx context.Context) MonitoringScheduleOutput {
   180  	return pulumi.ToOutputWithContext(ctx, i).(MonitoringScheduleOutput)
   181  }
   182  
   183  // MonitoringScheduleArrayInput is an input type that accepts MonitoringScheduleArray and MonitoringScheduleArrayOutput values.
   184  // You can construct a concrete instance of `MonitoringScheduleArrayInput` via:
   185  //
   186  //	MonitoringScheduleArray{ MonitoringScheduleArgs{...} }
   187  type MonitoringScheduleArrayInput interface {
   188  	pulumi.Input
   189  
   190  	ToMonitoringScheduleArrayOutput() MonitoringScheduleArrayOutput
   191  	ToMonitoringScheduleArrayOutputWithContext(context.Context) MonitoringScheduleArrayOutput
   192  }
   193  
   194  type MonitoringScheduleArray []MonitoringScheduleInput
   195  
   196  func (MonitoringScheduleArray) ElementType() reflect.Type {
   197  	return reflect.TypeOf((*[]*MonitoringSchedule)(nil)).Elem()
   198  }
   199  
   200  func (i MonitoringScheduleArray) ToMonitoringScheduleArrayOutput() MonitoringScheduleArrayOutput {
   201  	return i.ToMonitoringScheduleArrayOutputWithContext(context.Background())
   202  }
   203  
   204  func (i MonitoringScheduleArray) ToMonitoringScheduleArrayOutputWithContext(ctx context.Context) MonitoringScheduleArrayOutput {
   205  	return pulumi.ToOutputWithContext(ctx, i).(MonitoringScheduleArrayOutput)
   206  }
   207  
   208  // MonitoringScheduleMapInput is an input type that accepts MonitoringScheduleMap and MonitoringScheduleMapOutput values.
   209  // You can construct a concrete instance of `MonitoringScheduleMapInput` via:
   210  //
   211  //	MonitoringScheduleMap{ "key": MonitoringScheduleArgs{...} }
   212  type MonitoringScheduleMapInput interface {
   213  	pulumi.Input
   214  
   215  	ToMonitoringScheduleMapOutput() MonitoringScheduleMapOutput
   216  	ToMonitoringScheduleMapOutputWithContext(context.Context) MonitoringScheduleMapOutput
   217  }
   218  
   219  type MonitoringScheduleMap map[string]MonitoringScheduleInput
   220  
   221  func (MonitoringScheduleMap) ElementType() reflect.Type {
   222  	return reflect.TypeOf((*map[string]*MonitoringSchedule)(nil)).Elem()
   223  }
   224  
   225  func (i MonitoringScheduleMap) ToMonitoringScheduleMapOutput() MonitoringScheduleMapOutput {
   226  	return i.ToMonitoringScheduleMapOutputWithContext(context.Background())
   227  }
   228  
   229  func (i MonitoringScheduleMap) ToMonitoringScheduleMapOutputWithContext(ctx context.Context) MonitoringScheduleMapOutput {
   230  	return pulumi.ToOutputWithContext(ctx, i).(MonitoringScheduleMapOutput)
   231  }
   232  
   233  type MonitoringScheduleOutput struct{ *pulumi.OutputState }
   234  
   235  func (MonitoringScheduleOutput) ElementType() reflect.Type {
   236  	return reflect.TypeOf((**MonitoringSchedule)(nil)).Elem()
   237  }
   238  
   239  func (o MonitoringScheduleOutput) ToMonitoringScheduleOutput() MonitoringScheduleOutput {
   240  	return o
   241  }
   242  
   243  func (o MonitoringScheduleOutput) ToMonitoringScheduleOutputWithContext(ctx context.Context) MonitoringScheduleOutput {
   244  	return o
   245  }
   246  
   247  // The Amazon Resource Name (ARN) assigned by AWS to this monitoring schedule.
   248  func (o MonitoringScheduleOutput) Arn() pulumi.StringOutput {
   249  	return o.ApplyT(func(v *MonitoringSchedule) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   250  }
   251  
   252  // The configuration object that specifies the monitoring schedule and defines the monitoring job. Fields are documented below.
   253  func (o MonitoringScheduleOutput) MonitoringScheduleConfig() MonitoringScheduleMonitoringScheduleConfigOutput {
   254  	return o.ApplyT(func(v *MonitoringSchedule) MonitoringScheduleMonitoringScheduleConfigOutput {
   255  		return v.MonitoringScheduleConfig
   256  	}).(MonitoringScheduleMonitoringScheduleConfigOutput)
   257  }
   258  
   259  // The name of the monitoring schedule. The name must be unique within an AWS Region within an AWS account. If omitted, the provider will assign a random, unique name.
   260  func (o MonitoringScheduleOutput) Name() pulumi.StringOutput {
   261  	return o.ApplyT(func(v *MonitoringSchedule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   262  }
   263  
   264  // A mapping 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.
   265  func (o MonitoringScheduleOutput) Tags() pulumi.StringMapOutput {
   266  	return o.ApplyT(func(v *MonitoringSchedule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   267  }
   268  
   269  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   270  //
   271  // Deprecated: Please use `tags` instead.
   272  func (o MonitoringScheduleOutput) TagsAll() pulumi.StringMapOutput {
   273  	return o.ApplyT(func(v *MonitoringSchedule) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   274  }
   275  
   276  type MonitoringScheduleArrayOutput struct{ *pulumi.OutputState }
   277  
   278  func (MonitoringScheduleArrayOutput) ElementType() reflect.Type {
   279  	return reflect.TypeOf((*[]*MonitoringSchedule)(nil)).Elem()
   280  }
   281  
   282  func (o MonitoringScheduleArrayOutput) ToMonitoringScheduleArrayOutput() MonitoringScheduleArrayOutput {
   283  	return o
   284  }
   285  
   286  func (o MonitoringScheduleArrayOutput) ToMonitoringScheduleArrayOutputWithContext(ctx context.Context) MonitoringScheduleArrayOutput {
   287  	return o
   288  }
   289  
   290  func (o MonitoringScheduleArrayOutput) Index(i pulumi.IntInput) MonitoringScheduleOutput {
   291  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *MonitoringSchedule {
   292  		return vs[0].([]*MonitoringSchedule)[vs[1].(int)]
   293  	}).(MonitoringScheduleOutput)
   294  }
   295  
   296  type MonitoringScheduleMapOutput struct{ *pulumi.OutputState }
   297  
   298  func (MonitoringScheduleMapOutput) ElementType() reflect.Type {
   299  	return reflect.TypeOf((*map[string]*MonitoringSchedule)(nil)).Elem()
   300  }
   301  
   302  func (o MonitoringScheduleMapOutput) ToMonitoringScheduleMapOutput() MonitoringScheduleMapOutput {
   303  	return o
   304  }
   305  
   306  func (o MonitoringScheduleMapOutput) ToMonitoringScheduleMapOutputWithContext(ctx context.Context) MonitoringScheduleMapOutput {
   307  	return o
   308  }
   309  
   310  func (o MonitoringScheduleMapOutput) MapIndex(k pulumi.StringInput) MonitoringScheduleOutput {
   311  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *MonitoringSchedule {
   312  		return vs[0].(map[string]*MonitoringSchedule)[vs[1].(string)]
   313  	}).(MonitoringScheduleOutput)
   314  }
   315  
   316  func init() {
   317  	pulumi.RegisterInputType(reflect.TypeOf((*MonitoringScheduleInput)(nil)).Elem(), &MonitoringSchedule{})
   318  	pulumi.RegisterInputType(reflect.TypeOf((*MonitoringScheduleArrayInput)(nil)).Elem(), MonitoringScheduleArray{})
   319  	pulumi.RegisterInputType(reflect.TypeOf((*MonitoringScheduleMapInput)(nil)).Elem(), MonitoringScheduleMap{})
   320  	pulumi.RegisterOutputType(MonitoringScheduleOutput{})
   321  	pulumi.RegisterOutputType(MonitoringScheduleArrayOutput{})
   322  	pulumi.RegisterOutputType(MonitoringScheduleMapOutput{})
   323  }