github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/pipeline.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 Pipeline resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Basic usage
    20  //
    21  // <!--Start PulumiCodeChooser -->
    22  // ```go
    23  // package main
    24  //
    25  // import (
    26  //
    27  //	"encoding/json"
    28  //
    29  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
    30  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    31  //
    32  // )
    33  //
    34  //	func main() {
    35  //		pulumi.Run(func(ctx *pulumi.Context) error {
    36  //			tmpJSON0, err := json.Marshal(map[string]interface{}{
    37  //				"Version": "2020-12-01",
    38  //				"Steps": []map[string]interface{}{
    39  //					map[string]interface{}{
    40  //						"Name": "Test",
    41  //						"Type": "Fail",
    42  //						"Arguments": map[string]interface{}{
    43  //							"ErrorMessage": "test",
    44  //						},
    45  //					},
    46  //				},
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			json0 := string(tmpJSON0)
    52  //			_, err = sagemaker.NewPipeline(ctx, "example", &sagemaker.PipelineArgs{
    53  //				PipelineName:        pulumi.String("example"),
    54  //				PipelineDisplayName: pulumi.String("example"),
    55  //				RoleArn:             pulumi.Any(exampleAwsIamRole.Arn),
    56  //				PipelineDefinition:  pulumi.String(json0),
    57  //			})
    58  //			if err != nil {
    59  //				return err
    60  //			}
    61  //			return nil
    62  //		})
    63  //	}
    64  //
    65  // ```
    66  // <!--End PulumiCodeChooser -->
    67  //
    68  // ## Import
    69  //
    70  // Using `pulumi import`, import pipelines using the `pipeline_name`. For example:
    71  //
    72  // ```sh
    73  // $ pulumi import aws:sagemaker/pipeline:Pipeline test_pipeline pipeline
    74  // ```
    75  type Pipeline struct {
    76  	pulumi.CustomResourceState
    77  
    78  	// The Amazon Resource Name (ARN) assigned by AWS to this Pipeline.
    79  	Arn pulumi.StringOutput `pulumi:"arn"`
    80  	// This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
    81  	ParallelismConfiguration PipelineParallelismConfigurationPtrOutput `pulumi:"parallelismConfiguration"`
    82  	// The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
    83  	PipelineDefinition pulumi.StringPtrOutput `pulumi:"pipelineDefinition"`
    84  	// The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
    85  	PipelineDefinitionS3Location PipelinePipelineDefinitionS3LocationPtrOutput `pulumi:"pipelineDefinitionS3Location"`
    86  	// A description of the pipeline.
    87  	PipelineDescription pulumi.StringPtrOutput `pulumi:"pipelineDescription"`
    88  	// The display name of the pipeline.
    89  	PipelineDisplayName pulumi.StringOutput `pulumi:"pipelineDisplayName"`
    90  	// The name of the pipeline.
    91  	PipelineName pulumi.StringOutput `pulumi:"pipelineName"`
    92  	// The name of the Pipeline (must be unique).
    93  	RoleArn pulumi.StringPtrOutput `pulumi:"roleArn"`
    94  	// 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.
    95  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    96  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    97  	//
    98  	// Deprecated: Please use `tags` instead.
    99  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   100  }
   101  
   102  // NewPipeline registers a new resource with the given unique name, arguments, and options.
   103  func NewPipeline(ctx *pulumi.Context,
   104  	name string, args *PipelineArgs, opts ...pulumi.ResourceOption) (*Pipeline, error) {
   105  	if args == nil {
   106  		return nil, errors.New("missing one or more required arguments")
   107  	}
   108  
   109  	if args.PipelineDisplayName == nil {
   110  		return nil, errors.New("invalid value for required argument 'PipelineDisplayName'")
   111  	}
   112  	if args.PipelineName == nil {
   113  		return nil, errors.New("invalid value for required argument 'PipelineName'")
   114  	}
   115  	opts = internal.PkgResourceDefaultOpts(opts)
   116  	var resource Pipeline
   117  	err := ctx.RegisterResource("aws:sagemaker/pipeline:Pipeline", name, args, &resource, opts...)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	return &resource, nil
   122  }
   123  
   124  // GetPipeline gets an existing Pipeline resource's state with the given name, ID, and optional
   125  // state properties that are used to uniquely qualify the lookup (nil if not required).
   126  func GetPipeline(ctx *pulumi.Context,
   127  	name string, id pulumi.IDInput, state *PipelineState, opts ...pulumi.ResourceOption) (*Pipeline, error) {
   128  	var resource Pipeline
   129  	err := ctx.ReadResource("aws:sagemaker/pipeline:Pipeline", name, id, state, &resource, opts...)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return &resource, nil
   134  }
   135  
   136  // Input properties used for looking up and filtering Pipeline resources.
   137  type pipelineState struct {
   138  	// The Amazon Resource Name (ARN) assigned by AWS to this Pipeline.
   139  	Arn *string `pulumi:"arn"`
   140  	// This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
   141  	ParallelismConfiguration *PipelineParallelismConfiguration `pulumi:"parallelismConfiguration"`
   142  	// The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
   143  	PipelineDefinition *string `pulumi:"pipelineDefinition"`
   144  	// The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
   145  	PipelineDefinitionS3Location *PipelinePipelineDefinitionS3Location `pulumi:"pipelineDefinitionS3Location"`
   146  	// A description of the pipeline.
   147  	PipelineDescription *string `pulumi:"pipelineDescription"`
   148  	// The display name of the pipeline.
   149  	PipelineDisplayName *string `pulumi:"pipelineDisplayName"`
   150  	// The name of the pipeline.
   151  	PipelineName *string `pulumi:"pipelineName"`
   152  	// The name of the Pipeline (must be unique).
   153  	RoleArn *string `pulumi:"roleArn"`
   154  	// 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.
   155  	Tags map[string]string `pulumi:"tags"`
   156  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   157  	//
   158  	// Deprecated: Please use `tags` instead.
   159  	TagsAll map[string]string `pulumi:"tagsAll"`
   160  }
   161  
   162  type PipelineState struct {
   163  	// The Amazon Resource Name (ARN) assigned by AWS to this Pipeline.
   164  	Arn pulumi.StringPtrInput
   165  	// This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
   166  	ParallelismConfiguration PipelineParallelismConfigurationPtrInput
   167  	// The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
   168  	PipelineDefinition pulumi.StringPtrInput
   169  	// The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
   170  	PipelineDefinitionS3Location PipelinePipelineDefinitionS3LocationPtrInput
   171  	// A description of the pipeline.
   172  	PipelineDescription pulumi.StringPtrInput
   173  	// The display name of the pipeline.
   174  	PipelineDisplayName pulumi.StringPtrInput
   175  	// The name of the pipeline.
   176  	PipelineName pulumi.StringPtrInput
   177  	// The name of the Pipeline (must be unique).
   178  	RoleArn pulumi.StringPtrInput
   179  	// 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.
   180  	Tags pulumi.StringMapInput
   181  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   182  	//
   183  	// Deprecated: Please use `tags` instead.
   184  	TagsAll pulumi.StringMapInput
   185  }
   186  
   187  func (PipelineState) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*pipelineState)(nil)).Elem()
   189  }
   190  
   191  type pipelineArgs struct {
   192  	// This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
   193  	ParallelismConfiguration *PipelineParallelismConfiguration `pulumi:"parallelismConfiguration"`
   194  	// The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
   195  	PipelineDefinition *string `pulumi:"pipelineDefinition"`
   196  	// The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
   197  	PipelineDefinitionS3Location *PipelinePipelineDefinitionS3Location `pulumi:"pipelineDefinitionS3Location"`
   198  	// A description of the pipeline.
   199  	PipelineDescription *string `pulumi:"pipelineDescription"`
   200  	// The display name of the pipeline.
   201  	PipelineDisplayName string `pulumi:"pipelineDisplayName"`
   202  	// The name of the pipeline.
   203  	PipelineName string `pulumi:"pipelineName"`
   204  	// The name of the Pipeline (must be unique).
   205  	RoleArn *string `pulumi:"roleArn"`
   206  	// 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.
   207  	Tags map[string]string `pulumi:"tags"`
   208  }
   209  
   210  // The set of arguments for constructing a Pipeline resource.
   211  type PipelineArgs struct {
   212  	// This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
   213  	ParallelismConfiguration PipelineParallelismConfigurationPtrInput
   214  	// The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
   215  	PipelineDefinition pulumi.StringPtrInput
   216  	// The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
   217  	PipelineDefinitionS3Location PipelinePipelineDefinitionS3LocationPtrInput
   218  	// A description of the pipeline.
   219  	PipelineDescription pulumi.StringPtrInput
   220  	// The display name of the pipeline.
   221  	PipelineDisplayName pulumi.StringInput
   222  	// The name of the pipeline.
   223  	PipelineName pulumi.StringInput
   224  	// The name of the Pipeline (must be unique).
   225  	RoleArn pulumi.StringPtrInput
   226  	// 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.
   227  	Tags pulumi.StringMapInput
   228  }
   229  
   230  func (PipelineArgs) ElementType() reflect.Type {
   231  	return reflect.TypeOf((*pipelineArgs)(nil)).Elem()
   232  }
   233  
   234  type PipelineInput interface {
   235  	pulumi.Input
   236  
   237  	ToPipelineOutput() PipelineOutput
   238  	ToPipelineOutputWithContext(ctx context.Context) PipelineOutput
   239  }
   240  
   241  func (*Pipeline) ElementType() reflect.Type {
   242  	return reflect.TypeOf((**Pipeline)(nil)).Elem()
   243  }
   244  
   245  func (i *Pipeline) ToPipelineOutput() PipelineOutput {
   246  	return i.ToPipelineOutputWithContext(context.Background())
   247  }
   248  
   249  func (i *Pipeline) ToPipelineOutputWithContext(ctx context.Context) PipelineOutput {
   250  	return pulumi.ToOutputWithContext(ctx, i).(PipelineOutput)
   251  }
   252  
   253  // PipelineArrayInput is an input type that accepts PipelineArray and PipelineArrayOutput values.
   254  // You can construct a concrete instance of `PipelineArrayInput` via:
   255  //
   256  //	PipelineArray{ PipelineArgs{...} }
   257  type PipelineArrayInput interface {
   258  	pulumi.Input
   259  
   260  	ToPipelineArrayOutput() PipelineArrayOutput
   261  	ToPipelineArrayOutputWithContext(context.Context) PipelineArrayOutput
   262  }
   263  
   264  type PipelineArray []PipelineInput
   265  
   266  func (PipelineArray) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*[]*Pipeline)(nil)).Elem()
   268  }
   269  
   270  func (i PipelineArray) ToPipelineArrayOutput() PipelineArrayOutput {
   271  	return i.ToPipelineArrayOutputWithContext(context.Background())
   272  }
   273  
   274  func (i PipelineArray) ToPipelineArrayOutputWithContext(ctx context.Context) PipelineArrayOutput {
   275  	return pulumi.ToOutputWithContext(ctx, i).(PipelineArrayOutput)
   276  }
   277  
   278  // PipelineMapInput is an input type that accepts PipelineMap and PipelineMapOutput values.
   279  // You can construct a concrete instance of `PipelineMapInput` via:
   280  //
   281  //	PipelineMap{ "key": PipelineArgs{...} }
   282  type PipelineMapInput interface {
   283  	pulumi.Input
   284  
   285  	ToPipelineMapOutput() PipelineMapOutput
   286  	ToPipelineMapOutputWithContext(context.Context) PipelineMapOutput
   287  }
   288  
   289  type PipelineMap map[string]PipelineInput
   290  
   291  func (PipelineMap) ElementType() reflect.Type {
   292  	return reflect.TypeOf((*map[string]*Pipeline)(nil)).Elem()
   293  }
   294  
   295  func (i PipelineMap) ToPipelineMapOutput() PipelineMapOutput {
   296  	return i.ToPipelineMapOutputWithContext(context.Background())
   297  }
   298  
   299  func (i PipelineMap) ToPipelineMapOutputWithContext(ctx context.Context) PipelineMapOutput {
   300  	return pulumi.ToOutputWithContext(ctx, i).(PipelineMapOutput)
   301  }
   302  
   303  type PipelineOutput struct{ *pulumi.OutputState }
   304  
   305  func (PipelineOutput) ElementType() reflect.Type {
   306  	return reflect.TypeOf((**Pipeline)(nil)).Elem()
   307  }
   308  
   309  func (o PipelineOutput) ToPipelineOutput() PipelineOutput {
   310  	return o
   311  }
   312  
   313  func (o PipelineOutput) ToPipelineOutputWithContext(ctx context.Context) PipelineOutput {
   314  	return o
   315  }
   316  
   317  // The Amazon Resource Name (ARN) assigned by AWS to this Pipeline.
   318  func (o PipelineOutput) Arn() pulumi.StringOutput {
   319  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   320  }
   321  
   322  // This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default. see Parallelism Configuration details below.
   323  func (o PipelineOutput) ParallelismConfiguration() PipelineParallelismConfigurationPtrOutput {
   324  	return o.ApplyT(func(v *Pipeline) PipelineParallelismConfigurationPtrOutput { return v.ParallelismConfiguration }).(PipelineParallelismConfigurationPtrOutput)
   325  }
   326  
   327  // The [JSON pipeline definition](https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/) of the pipeline.
   328  func (o PipelineOutput) PipelineDefinition() pulumi.StringPtrOutput {
   329  	return o.ApplyT(func(v *Pipeline) pulumi.StringPtrOutput { return v.PipelineDefinition }).(pulumi.StringPtrOutput)
   330  }
   331  
   332  // The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location. see Pipeline Definition S3 Location details below.
   333  func (o PipelineOutput) PipelineDefinitionS3Location() PipelinePipelineDefinitionS3LocationPtrOutput {
   334  	return o.ApplyT(func(v *Pipeline) PipelinePipelineDefinitionS3LocationPtrOutput { return v.PipelineDefinitionS3Location }).(PipelinePipelineDefinitionS3LocationPtrOutput)
   335  }
   336  
   337  // A description of the pipeline.
   338  func (o PipelineOutput) PipelineDescription() pulumi.StringPtrOutput {
   339  	return o.ApplyT(func(v *Pipeline) pulumi.StringPtrOutput { return v.PipelineDescription }).(pulumi.StringPtrOutput)
   340  }
   341  
   342  // The display name of the pipeline.
   343  func (o PipelineOutput) PipelineDisplayName() pulumi.StringOutput {
   344  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.PipelineDisplayName }).(pulumi.StringOutput)
   345  }
   346  
   347  // The name of the pipeline.
   348  func (o PipelineOutput) PipelineName() pulumi.StringOutput {
   349  	return o.ApplyT(func(v *Pipeline) pulumi.StringOutput { return v.PipelineName }).(pulumi.StringOutput)
   350  }
   351  
   352  // The name of the Pipeline (must be unique).
   353  func (o PipelineOutput) RoleArn() pulumi.StringPtrOutput {
   354  	return o.ApplyT(func(v *Pipeline) pulumi.StringPtrOutput { return v.RoleArn }).(pulumi.StringPtrOutput)
   355  }
   356  
   357  // 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.
   358  func (o PipelineOutput) Tags() pulumi.StringMapOutput {
   359  	return o.ApplyT(func(v *Pipeline) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   360  }
   361  
   362  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   363  //
   364  // Deprecated: Please use `tags` instead.
   365  func (o PipelineOutput) TagsAll() pulumi.StringMapOutput {
   366  	return o.ApplyT(func(v *Pipeline) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   367  }
   368  
   369  type PipelineArrayOutput struct{ *pulumi.OutputState }
   370  
   371  func (PipelineArrayOutput) ElementType() reflect.Type {
   372  	return reflect.TypeOf((*[]*Pipeline)(nil)).Elem()
   373  }
   374  
   375  func (o PipelineArrayOutput) ToPipelineArrayOutput() PipelineArrayOutput {
   376  	return o
   377  }
   378  
   379  func (o PipelineArrayOutput) ToPipelineArrayOutputWithContext(ctx context.Context) PipelineArrayOutput {
   380  	return o
   381  }
   382  
   383  func (o PipelineArrayOutput) Index(i pulumi.IntInput) PipelineOutput {
   384  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Pipeline {
   385  		return vs[0].([]*Pipeline)[vs[1].(int)]
   386  	}).(PipelineOutput)
   387  }
   388  
   389  type PipelineMapOutput struct{ *pulumi.OutputState }
   390  
   391  func (PipelineMapOutput) ElementType() reflect.Type {
   392  	return reflect.TypeOf((*map[string]*Pipeline)(nil)).Elem()
   393  }
   394  
   395  func (o PipelineMapOutput) ToPipelineMapOutput() PipelineMapOutput {
   396  	return o
   397  }
   398  
   399  func (o PipelineMapOutput) ToPipelineMapOutputWithContext(ctx context.Context) PipelineMapOutput {
   400  	return o
   401  }
   402  
   403  func (o PipelineMapOutput) MapIndex(k pulumi.StringInput) PipelineOutput {
   404  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Pipeline {
   405  		return vs[0].(map[string]*Pipeline)[vs[1].(string)]
   406  	}).(PipelineOutput)
   407  }
   408  
   409  func init() {
   410  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineInput)(nil)).Elem(), &Pipeline{})
   411  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineArrayInput)(nil)).Elem(), PipelineArray{})
   412  	pulumi.RegisterInputType(reflect.TypeOf((*PipelineMapInput)(nil)).Elem(), PipelineMap{})
   413  	pulumi.RegisterOutputType(PipelineOutput{})
   414  	pulumi.RegisterOutputType(PipelineArrayOutput{})
   415  	pulumi.RegisterOutputType(PipelineMapOutput{})
   416  }