github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/workteam.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 Workteam resource.
    16  //
    17  // ## Example Usage
    18  //
    19  // ### Cognito 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.NewWorkteam(ctx, "example", &sagemaker.WorkteamArgs{
    35  //				WorkteamName:  pulumi.String("example"),
    36  //				WorkforceName: pulumi.Any(exampleAwsSagemakerWorkforce.Id),
    37  //				Description:   pulumi.String("example"),
    38  //				MemberDefinitions: sagemaker.WorkteamMemberDefinitionArray{
    39  //					&sagemaker.WorkteamMemberDefinitionArgs{
    40  //						CognitoMemberDefinition: &sagemaker.WorkteamMemberDefinitionCognitoMemberDefinitionArgs{
    41  //							ClientId:  pulumi.Any(exampleAwsCognitoUserPoolClient.Id),
    42  //							UserPool:  pulumi.Any(exampleAwsCognitoUserPoolDomain.UserPoolId),
    43  //							UserGroup: pulumi.Any(exampleAwsCognitoUserGroup.Id),
    44  //						},
    45  //					},
    46  //				},
    47  //			})
    48  //			if err != nil {
    49  //				return err
    50  //			}
    51  //			return nil
    52  //		})
    53  //	}
    54  //
    55  // ```
    56  // <!--End PulumiCodeChooser -->
    57  //
    58  // ### Oidc Usage
    59  //
    60  // <!--Start PulumiCodeChooser -->
    61  // ```go
    62  // package main
    63  //
    64  // import (
    65  //
    66  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
    67  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    68  //
    69  // )
    70  //
    71  //	func main() {
    72  //		pulumi.Run(func(ctx *pulumi.Context) error {
    73  //			_, err := sagemaker.NewWorkteam(ctx, "example", &sagemaker.WorkteamArgs{
    74  //				WorkteamName:  pulumi.String("example"),
    75  //				WorkforceName: pulumi.Any(exampleAwsSagemakerWorkforce.Id),
    76  //				Description:   pulumi.String("example"),
    77  //				MemberDefinitions: sagemaker.WorkteamMemberDefinitionArray{
    78  //					&sagemaker.WorkteamMemberDefinitionArgs{
    79  //						OidcMemberDefinition: &sagemaker.WorkteamMemberDefinitionOidcMemberDefinitionArgs{
    80  //							Groups: pulumi.StringArray{
    81  //								pulumi.String("example"),
    82  //							},
    83  //						},
    84  //					},
    85  //				},
    86  //			})
    87  //			if err != nil {
    88  //				return err
    89  //			}
    90  //			return nil
    91  //		})
    92  //	}
    93  //
    94  // ```
    95  // <!--End PulumiCodeChooser -->
    96  //
    97  // ## Import
    98  //
    99  // Using `pulumi import`, import SageMaker Workteams using the `workteam_name`. For example:
   100  //
   101  // ```sh
   102  // $ pulumi import aws:sagemaker/workteam:Workteam example example
   103  // ```
   104  type Workteam struct {
   105  	pulumi.CustomResourceState
   106  
   107  	// The Amazon Resource Name (ARN) assigned by AWS to this Workteam.
   108  	Arn pulumi.StringOutput `pulumi:"arn"`
   109  	// A description of the work team.
   110  	Description pulumi.StringOutput `pulumi:"description"`
   111  	// A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   112  	MemberDefinitions WorkteamMemberDefinitionArrayOutput `pulumi:"memberDefinitions"`
   113  	// Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   114  	NotificationConfiguration WorkteamNotificationConfigurationPtrOutput `pulumi:"notificationConfiguration"`
   115  	// The subdomain for your OIDC Identity Provider.
   116  	Subdomain pulumi.StringOutput `pulumi:"subdomain"`
   117  	// 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.
   118  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   119  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   120  	//
   121  	// Deprecated: Please use `tags` instead.
   122  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   123  	// The name of the Workteam (must be unique).
   124  	WorkforceName pulumi.StringOutput `pulumi:"workforceName"`
   125  	// The name of the workforce.
   126  	WorkteamName pulumi.StringOutput `pulumi:"workteamName"`
   127  }
   128  
   129  // NewWorkteam registers a new resource with the given unique name, arguments, and options.
   130  func NewWorkteam(ctx *pulumi.Context,
   131  	name string, args *WorkteamArgs, opts ...pulumi.ResourceOption) (*Workteam, error) {
   132  	if args == nil {
   133  		return nil, errors.New("missing one or more required arguments")
   134  	}
   135  
   136  	if args.Description == nil {
   137  		return nil, errors.New("invalid value for required argument 'Description'")
   138  	}
   139  	if args.MemberDefinitions == nil {
   140  		return nil, errors.New("invalid value for required argument 'MemberDefinitions'")
   141  	}
   142  	if args.WorkforceName == nil {
   143  		return nil, errors.New("invalid value for required argument 'WorkforceName'")
   144  	}
   145  	if args.WorkteamName == nil {
   146  		return nil, errors.New("invalid value for required argument 'WorkteamName'")
   147  	}
   148  	opts = internal.PkgResourceDefaultOpts(opts)
   149  	var resource Workteam
   150  	err := ctx.RegisterResource("aws:sagemaker/workteam:Workteam", name, args, &resource, opts...)
   151  	if err != nil {
   152  		return nil, err
   153  	}
   154  	return &resource, nil
   155  }
   156  
   157  // GetWorkteam gets an existing Workteam resource's state with the given name, ID, and optional
   158  // state properties that are used to uniquely qualify the lookup (nil if not required).
   159  func GetWorkteam(ctx *pulumi.Context,
   160  	name string, id pulumi.IDInput, state *WorkteamState, opts ...pulumi.ResourceOption) (*Workteam, error) {
   161  	var resource Workteam
   162  	err := ctx.ReadResource("aws:sagemaker/workteam:Workteam", name, id, state, &resource, opts...)
   163  	if err != nil {
   164  		return nil, err
   165  	}
   166  	return &resource, nil
   167  }
   168  
   169  // Input properties used for looking up and filtering Workteam resources.
   170  type workteamState struct {
   171  	// The Amazon Resource Name (ARN) assigned by AWS to this Workteam.
   172  	Arn *string `pulumi:"arn"`
   173  	// A description of the work team.
   174  	Description *string `pulumi:"description"`
   175  	// A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   176  	MemberDefinitions []WorkteamMemberDefinition `pulumi:"memberDefinitions"`
   177  	// Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   178  	NotificationConfiguration *WorkteamNotificationConfiguration `pulumi:"notificationConfiguration"`
   179  	// The subdomain for your OIDC Identity Provider.
   180  	Subdomain *string `pulumi:"subdomain"`
   181  	// 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.
   182  	Tags map[string]string `pulumi:"tags"`
   183  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   184  	//
   185  	// Deprecated: Please use `tags` instead.
   186  	TagsAll map[string]string `pulumi:"tagsAll"`
   187  	// The name of the Workteam (must be unique).
   188  	WorkforceName *string `pulumi:"workforceName"`
   189  	// The name of the workforce.
   190  	WorkteamName *string `pulumi:"workteamName"`
   191  }
   192  
   193  type WorkteamState struct {
   194  	// The Amazon Resource Name (ARN) assigned by AWS to this Workteam.
   195  	Arn pulumi.StringPtrInput
   196  	// A description of the work team.
   197  	Description pulumi.StringPtrInput
   198  	// A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   199  	MemberDefinitions WorkteamMemberDefinitionArrayInput
   200  	// Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   201  	NotificationConfiguration WorkteamNotificationConfigurationPtrInput
   202  	// The subdomain for your OIDC Identity Provider.
   203  	Subdomain pulumi.StringPtrInput
   204  	// 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.
   205  	Tags pulumi.StringMapInput
   206  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   207  	//
   208  	// Deprecated: Please use `tags` instead.
   209  	TagsAll pulumi.StringMapInput
   210  	// The name of the Workteam (must be unique).
   211  	WorkforceName pulumi.StringPtrInput
   212  	// The name of the workforce.
   213  	WorkteamName pulumi.StringPtrInput
   214  }
   215  
   216  func (WorkteamState) ElementType() reflect.Type {
   217  	return reflect.TypeOf((*workteamState)(nil)).Elem()
   218  }
   219  
   220  type workteamArgs struct {
   221  	// A description of the work team.
   222  	Description string `pulumi:"description"`
   223  	// A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   224  	MemberDefinitions []WorkteamMemberDefinition `pulumi:"memberDefinitions"`
   225  	// Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   226  	NotificationConfiguration *WorkteamNotificationConfiguration `pulumi:"notificationConfiguration"`
   227  	// 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.
   228  	Tags map[string]string `pulumi:"tags"`
   229  	// The name of the Workteam (must be unique).
   230  	WorkforceName string `pulumi:"workforceName"`
   231  	// The name of the workforce.
   232  	WorkteamName string `pulumi:"workteamName"`
   233  }
   234  
   235  // The set of arguments for constructing a Workteam resource.
   236  type WorkteamArgs struct {
   237  	// A description of the work team.
   238  	Description pulumi.StringInput
   239  	// A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   240  	MemberDefinitions WorkteamMemberDefinitionArrayInput
   241  	// Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   242  	NotificationConfiguration WorkteamNotificationConfigurationPtrInput
   243  	// 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.
   244  	Tags pulumi.StringMapInput
   245  	// The name of the Workteam (must be unique).
   246  	WorkforceName pulumi.StringInput
   247  	// The name of the workforce.
   248  	WorkteamName pulumi.StringInput
   249  }
   250  
   251  func (WorkteamArgs) ElementType() reflect.Type {
   252  	return reflect.TypeOf((*workteamArgs)(nil)).Elem()
   253  }
   254  
   255  type WorkteamInput interface {
   256  	pulumi.Input
   257  
   258  	ToWorkteamOutput() WorkteamOutput
   259  	ToWorkteamOutputWithContext(ctx context.Context) WorkteamOutput
   260  }
   261  
   262  func (*Workteam) ElementType() reflect.Type {
   263  	return reflect.TypeOf((**Workteam)(nil)).Elem()
   264  }
   265  
   266  func (i *Workteam) ToWorkteamOutput() WorkteamOutput {
   267  	return i.ToWorkteamOutputWithContext(context.Background())
   268  }
   269  
   270  func (i *Workteam) ToWorkteamOutputWithContext(ctx context.Context) WorkteamOutput {
   271  	return pulumi.ToOutputWithContext(ctx, i).(WorkteamOutput)
   272  }
   273  
   274  // WorkteamArrayInput is an input type that accepts WorkteamArray and WorkteamArrayOutput values.
   275  // You can construct a concrete instance of `WorkteamArrayInput` via:
   276  //
   277  //	WorkteamArray{ WorkteamArgs{...} }
   278  type WorkteamArrayInput interface {
   279  	pulumi.Input
   280  
   281  	ToWorkteamArrayOutput() WorkteamArrayOutput
   282  	ToWorkteamArrayOutputWithContext(context.Context) WorkteamArrayOutput
   283  }
   284  
   285  type WorkteamArray []WorkteamInput
   286  
   287  func (WorkteamArray) ElementType() reflect.Type {
   288  	return reflect.TypeOf((*[]*Workteam)(nil)).Elem()
   289  }
   290  
   291  func (i WorkteamArray) ToWorkteamArrayOutput() WorkteamArrayOutput {
   292  	return i.ToWorkteamArrayOutputWithContext(context.Background())
   293  }
   294  
   295  func (i WorkteamArray) ToWorkteamArrayOutputWithContext(ctx context.Context) WorkteamArrayOutput {
   296  	return pulumi.ToOutputWithContext(ctx, i).(WorkteamArrayOutput)
   297  }
   298  
   299  // WorkteamMapInput is an input type that accepts WorkteamMap and WorkteamMapOutput values.
   300  // You can construct a concrete instance of `WorkteamMapInput` via:
   301  //
   302  //	WorkteamMap{ "key": WorkteamArgs{...} }
   303  type WorkteamMapInput interface {
   304  	pulumi.Input
   305  
   306  	ToWorkteamMapOutput() WorkteamMapOutput
   307  	ToWorkteamMapOutputWithContext(context.Context) WorkteamMapOutput
   308  }
   309  
   310  type WorkteamMap map[string]WorkteamInput
   311  
   312  func (WorkteamMap) ElementType() reflect.Type {
   313  	return reflect.TypeOf((*map[string]*Workteam)(nil)).Elem()
   314  }
   315  
   316  func (i WorkteamMap) ToWorkteamMapOutput() WorkteamMapOutput {
   317  	return i.ToWorkteamMapOutputWithContext(context.Background())
   318  }
   319  
   320  func (i WorkteamMap) ToWorkteamMapOutputWithContext(ctx context.Context) WorkteamMapOutput {
   321  	return pulumi.ToOutputWithContext(ctx, i).(WorkteamMapOutput)
   322  }
   323  
   324  type WorkteamOutput struct{ *pulumi.OutputState }
   325  
   326  func (WorkteamOutput) ElementType() reflect.Type {
   327  	return reflect.TypeOf((**Workteam)(nil)).Elem()
   328  }
   329  
   330  func (o WorkteamOutput) ToWorkteamOutput() WorkteamOutput {
   331  	return o
   332  }
   333  
   334  func (o WorkteamOutput) ToWorkteamOutputWithContext(ctx context.Context) WorkteamOutput {
   335  	return o
   336  }
   337  
   338  // The Amazon Resource Name (ARN) assigned by AWS to this Workteam.
   339  func (o WorkteamOutput) Arn() pulumi.StringOutput {
   340  	return o.ApplyT(func(v *Workteam) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   341  }
   342  
   343  // A description of the work team.
   344  func (o WorkteamOutput) Description() pulumi.StringOutput {
   345  	return o.ApplyT(func(v *Workteam) pulumi.StringOutput { return v.Description }).(pulumi.StringOutput)
   346  }
   347  
   348  // A list of Member Definitions that contains objects that identify the workers that make up the work team. Workforces can be created using Amazon Cognito or your own OIDC Identity Provider (IdP). For private workforces created using Amazon Cognito use `cognitoMemberDefinition`. For workforces created using your own OIDC identity provider (IdP) use `oidcMemberDefinition`. Do not provide input for both of these parameters in a single request. see Member Definition details below.
   349  func (o WorkteamOutput) MemberDefinitions() WorkteamMemberDefinitionArrayOutput {
   350  	return o.ApplyT(func(v *Workteam) WorkteamMemberDefinitionArrayOutput { return v.MemberDefinitions }).(WorkteamMemberDefinitionArrayOutput)
   351  }
   352  
   353  // Configures notification of workers regarding available or expiring work items. see Notification Configuration details below.
   354  func (o WorkteamOutput) NotificationConfiguration() WorkteamNotificationConfigurationPtrOutput {
   355  	return o.ApplyT(func(v *Workteam) WorkteamNotificationConfigurationPtrOutput { return v.NotificationConfiguration }).(WorkteamNotificationConfigurationPtrOutput)
   356  }
   357  
   358  // The subdomain for your OIDC Identity Provider.
   359  func (o WorkteamOutput) Subdomain() pulumi.StringOutput {
   360  	return o.ApplyT(func(v *Workteam) pulumi.StringOutput { return v.Subdomain }).(pulumi.StringOutput)
   361  }
   362  
   363  // 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.
   364  func (o WorkteamOutput) Tags() pulumi.StringMapOutput {
   365  	return o.ApplyT(func(v *Workteam) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   366  }
   367  
   368  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   369  //
   370  // Deprecated: Please use `tags` instead.
   371  func (o WorkteamOutput) TagsAll() pulumi.StringMapOutput {
   372  	return o.ApplyT(func(v *Workteam) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   373  }
   374  
   375  // The name of the Workteam (must be unique).
   376  func (o WorkteamOutput) WorkforceName() pulumi.StringOutput {
   377  	return o.ApplyT(func(v *Workteam) pulumi.StringOutput { return v.WorkforceName }).(pulumi.StringOutput)
   378  }
   379  
   380  // The name of the workforce.
   381  func (o WorkteamOutput) WorkteamName() pulumi.StringOutput {
   382  	return o.ApplyT(func(v *Workteam) pulumi.StringOutput { return v.WorkteamName }).(pulumi.StringOutput)
   383  }
   384  
   385  type WorkteamArrayOutput struct{ *pulumi.OutputState }
   386  
   387  func (WorkteamArrayOutput) ElementType() reflect.Type {
   388  	return reflect.TypeOf((*[]*Workteam)(nil)).Elem()
   389  }
   390  
   391  func (o WorkteamArrayOutput) ToWorkteamArrayOutput() WorkteamArrayOutput {
   392  	return o
   393  }
   394  
   395  func (o WorkteamArrayOutput) ToWorkteamArrayOutputWithContext(ctx context.Context) WorkteamArrayOutput {
   396  	return o
   397  }
   398  
   399  func (o WorkteamArrayOutput) Index(i pulumi.IntInput) WorkteamOutput {
   400  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Workteam {
   401  		return vs[0].([]*Workteam)[vs[1].(int)]
   402  	}).(WorkteamOutput)
   403  }
   404  
   405  type WorkteamMapOutput struct{ *pulumi.OutputState }
   406  
   407  func (WorkteamMapOutput) ElementType() reflect.Type {
   408  	return reflect.TypeOf((*map[string]*Workteam)(nil)).Elem()
   409  }
   410  
   411  func (o WorkteamMapOutput) ToWorkteamMapOutput() WorkteamMapOutput {
   412  	return o
   413  }
   414  
   415  func (o WorkteamMapOutput) ToWorkteamMapOutputWithContext(ctx context.Context) WorkteamMapOutput {
   416  	return o
   417  }
   418  
   419  func (o WorkteamMapOutput) MapIndex(k pulumi.StringInput) WorkteamOutput {
   420  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Workteam {
   421  		return vs[0].(map[string]*Workteam)[vs[1].(string)]
   422  	}).(WorkteamOutput)
   423  }
   424  
   425  func init() {
   426  	pulumi.RegisterInputType(reflect.TypeOf((*WorkteamInput)(nil)).Elem(), &Workteam{})
   427  	pulumi.RegisterInputType(reflect.TypeOf((*WorkteamArrayInput)(nil)).Elem(), WorkteamArray{})
   428  	pulumi.RegisterInputType(reflect.TypeOf((*WorkteamMapInput)(nil)).Elem(), WorkteamMap{})
   429  	pulumi.RegisterOutputType(WorkteamOutput{})
   430  	pulumi.RegisterOutputType(WorkteamArrayOutput{})
   431  	pulumi.RegisterOutputType(WorkteamMapOutput{})
   432  }