github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/space.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 Space 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.NewSpace(ctx, "example", &sagemaker.SpaceArgs{
    35  //				DomainId:  pulumi.Any(test.Id),
    36  //				SpaceName: pulumi.String("example"),
    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 SageMaker Spaces using the `id`. For example:
    51  //
    52  // ```sh
    53  // $ pulumi import aws:sagemaker/space:Space test_space arn:aws:sagemaker:us-west-2:123456789012:space/domain-id/space-name
    54  // ```
    55  type Space struct {
    56  	pulumi.CustomResourceState
    57  
    58  	// The space's Amazon Resource Name (ARN).
    59  	Arn pulumi.StringOutput `pulumi:"arn"`
    60  	// The ID of the associated Domain.
    61  	DomainId pulumi.StringOutput `pulumi:"domainId"`
    62  	// The ID of the space's profile in the Amazon Elastic File System volume.
    63  	HomeEfsFileSystemUid pulumi.StringOutput `pulumi:"homeEfsFileSystemUid"`
    64  	// A collection of ownership settings. See Ownership Settings below.
    65  	OwnershipSettings SpaceOwnershipSettingsPtrOutput `pulumi:"ownershipSettings"`
    66  	// The name of the space that appears in the SageMaker Studio UI.
    67  	SpaceDisplayName pulumi.StringPtrOutput `pulumi:"spaceDisplayName"`
    68  	// The name of the space.
    69  	SpaceName pulumi.StringOutput `pulumi:"spaceName"`
    70  	// A collection of space settings. See Space Settings below.
    71  	SpaceSettings SpaceSpaceSettingsPtrOutput `pulumi:"spaceSettings"`
    72  	// A collection of space sharing settings. See Space Sharing Settings below.
    73  	SpaceSharingSettings SpaceSpaceSharingSettingsPtrOutput `pulumi:"spaceSharingSettings"`
    74  	// 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.
    75  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    76  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    77  	//
    78  	// Deprecated: Please use `tags` instead.
    79  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    80  	// Returns the URL of the space. If the space is created with Amazon Web Services IAM Identity Center (Successor to Amazon Web Services Single Sign-On) authentication, users can navigate to the URL after appending the respective redirect parameter for the application type to be federated through Amazon Web Services IAM Identity Center.
    81  	Url pulumi.StringOutput `pulumi:"url"`
    82  }
    83  
    84  // NewSpace registers a new resource with the given unique name, arguments, and options.
    85  func NewSpace(ctx *pulumi.Context,
    86  	name string, args *SpaceArgs, opts ...pulumi.ResourceOption) (*Space, error) {
    87  	if args == nil {
    88  		return nil, errors.New("missing one or more required arguments")
    89  	}
    90  
    91  	if args.DomainId == nil {
    92  		return nil, errors.New("invalid value for required argument 'DomainId'")
    93  	}
    94  	if args.SpaceName == nil {
    95  		return nil, errors.New("invalid value for required argument 'SpaceName'")
    96  	}
    97  	opts = internal.PkgResourceDefaultOpts(opts)
    98  	var resource Space
    99  	err := ctx.RegisterResource("aws:sagemaker/space:Space", name, args, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // GetSpace gets an existing Space resource's state with the given name, ID, and optional
   107  // state properties that are used to uniquely qualify the lookup (nil if not required).
   108  func GetSpace(ctx *pulumi.Context,
   109  	name string, id pulumi.IDInput, state *SpaceState, opts ...pulumi.ResourceOption) (*Space, error) {
   110  	var resource Space
   111  	err := ctx.ReadResource("aws:sagemaker/space:Space", name, id, state, &resource, opts...)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return &resource, nil
   116  }
   117  
   118  // Input properties used for looking up and filtering Space resources.
   119  type spaceState struct {
   120  	// The space's Amazon Resource Name (ARN).
   121  	Arn *string `pulumi:"arn"`
   122  	// The ID of the associated Domain.
   123  	DomainId *string `pulumi:"domainId"`
   124  	// The ID of the space's profile in the Amazon Elastic File System volume.
   125  	HomeEfsFileSystemUid *string `pulumi:"homeEfsFileSystemUid"`
   126  	// A collection of ownership settings. See Ownership Settings below.
   127  	OwnershipSettings *SpaceOwnershipSettings `pulumi:"ownershipSettings"`
   128  	// The name of the space that appears in the SageMaker Studio UI.
   129  	SpaceDisplayName *string `pulumi:"spaceDisplayName"`
   130  	// The name of the space.
   131  	SpaceName *string `pulumi:"spaceName"`
   132  	// A collection of space settings. See Space Settings below.
   133  	SpaceSettings *SpaceSpaceSettings `pulumi:"spaceSettings"`
   134  	// A collection of space sharing settings. See Space Sharing Settings below.
   135  	SpaceSharingSettings *SpaceSpaceSharingSettings `pulumi:"spaceSharingSettings"`
   136  	// 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.
   137  	Tags map[string]string `pulumi:"tags"`
   138  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   139  	//
   140  	// Deprecated: Please use `tags` instead.
   141  	TagsAll map[string]string `pulumi:"tagsAll"`
   142  	// Returns the URL of the space. If the space is created with Amazon Web Services IAM Identity Center (Successor to Amazon Web Services Single Sign-On) authentication, users can navigate to the URL after appending the respective redirect parameter for the application type to be federated through Amazon Web Services IAM Identity Center.
   143  	Url *string `pulumi:"url"`
   144  }
   145  
   146  type SpaceState struct {
   147  	// The space's Amazon Resource Name (ARN).
   148  	Arn pulumi.StringPtrInput
   149  	// The ID of the associated Domain.
   150  	DomainId pulumi.StringPtrInput
   151  	// The ID of the space's profile in the Amazon Elastic File System volume.
   152  	HomeEfsFileSystemUid pulumi.StringPtrInput
   153  	// A collection of ownership settings. See Ownership Settings below.
   154  	OwnershipSettings SpaceOwnershipSettingsPtrInput
   155  	// The name of the space that appears in the SageMaker Studio UI.
   156  	SpaceDisplayName pulumi.StringPtrInput
   157  	// The name of the space.
   158  	SpaceName pulumi.StringPtrInput
   159  	// A collection of space settings. See Space Settings below.
   160  	SpaceSettings SpaceSpaceSettingsPtrInput
   161  	// A collection of space sharing settings. See Space Sharing Settings below.
   162  	SpaceSharingSettings SpaceSpaceSharingSettingsPtrInput
   163  	// 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.
   164  	Tags pulumi.StringMapInput
   165  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   166  	//
   167  	// Deprecated: Please use `tags` instead.
   168  	TagsAll pulumi.StringMapInput
   169  	// Returns the URL of the space. If the space is created with Amazon Web Services IAM Identity Center (Successor to Amazon Web Services Single Sign-On) authentication, users can navigate to the URL after appending the respective redirect parameter for the application type to be federated through Amazon Web Services IAM Identity Center.
   170  	Url pulumi.StringPtrInput
   171  }
   172  
   173  func (SpaceState) ElementType() reflect.Type {
   174  	return reflect.TypeOf((*spaceState)(nil)).Elem()
   175  }
   176  
   177  type spaceArgs struct {
   178  	// The ID of the associated Domain.
   179  	DomainId string `pulumi:"domainId"`
   180  	// A collection of ownership settings. See Ownership Settings below.
   181  	OwnershipSettings *SpaceOwnershipSettings `pulumi:"ownershipSettings"`
   182  	// The name of the space that appears in the SageMaker Studio UI.
   183  	SpaceDisplayName *string `pulumi:"spaceDisplayName"`
   184  	// The name of the space.
   185  	SpaceName string `pulumi:"spaceName"`
   186  	// A collection of space settings. See Space Settings below.
   187  	SpaceSettings *SpaceSpaceSettings `pulumi:"spaceSettings"`
   188  	// A collection of space sharing settings. See Space Sharing Settings below.
   189  	SpaceSharingSettings *SpaceSpaceSharingSettings `pulumi:"spaceSharingSettings"`
   190  	// 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.
   191  	Tags map[string]string `pulumi:"tags"`
   192  }
   193  
   194  // The set of arguments for constructing a Space resource.
   195  type SpaceArgs struct {
   196  	// The ID of the associated Domain.
   197  	DomainId pulumi.StringInput
   198  	// A collection of ownership settings. See Ownership Settings below.
   199  	OwnershipSettings SpaceOwnershipSettingsPtrInput
   200  	// The name of the space that appears in the SageMaker Studio UI.
   201  	SpaceDisplayName pulumi.StringPtrInput
   202  	// The name of the space.
   203  	SpaceName pulumi.StringInput
   204  	// A collection of space settings. See Space Settings below.
   205  	SpaceSettings SpaceSpaceSettingsPtrInput
   206  	// A collection of space sharing settings. See Space Sharing Settings below.
   207  	SpaceSharingSettings SpaceSpaceSharingSettingsPtrInput
   208  	// 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.
   209  	Tags pulumi.StringMapInput
   210  }
   211  
   212  func (SpaceArgs) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*spaceArgs)(nil)).Elem()
   214  }
   215  
   216  type SpaceInput interface {
   217  	pulumi.Input
   218  
   219  	ToSpaceOutput() SpaceOutput
   220  	ToSpaceOutputWithContext(ctx context.Context) SpaceOutput
   221  }
   222  
   223  func (*Space) ElementType() reflect.Type {
   224  	return reflect.TypeOf((**Space)(nil)).Elem()
   225  }
   226  
   227  func (i *Space) ToSpaceOutput() SpaceOutput {
   228  	return i.ToSpaceOutputWithContext(context.Background())
   229  }
   230  
   231  func (i *Space) ToSpaceOutputWithContext(ctx context.Context) SpaceOutput {
   232  	return pulumi.ToOutputWithContext(ctx, i).(SpaceOutput)
   233  }
   234  
   235  // SpaceArrayInput is an input type that accepts SpaceArray and SpaceArrayOutput values.
   236  // You can construct a concrete instance of `SpaceArrayInput` via:
   237  //
   238  //	SpaceArray{ SpaceArgs{...} }
   239  type SpaceArrayInput interface {
   240  	pulumi.Input
   241  
   242  	ToSpaceArrayOutput() SpaceArrayOutput
   243  	ToSpaceArrayOutputWithContext(context.Context) SpaceArrayOutput
   244  }
   245  
   246  type SpaceArray []SpaceInput
   247  
   248  func (SpaceArray) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*[]*Space)(nil)).Elem()
   250  }
   251  
   252  func (i SpaceArray) ToSpaceArrayOutput() SpaceArrayOutput {
   253  	return i.ToSpaceArrayOutputWithContext(context.Background())
   254  }
   255  
   256  func (i SpaceArray) ToSpaceArrayOutputWithContext(ctx context.Context) SpaceArrayOutput {
   257  	return pulumi.ToOutputWithContext(ctx, i).(SpaceArrayOutput)
   258  }
   259  
   260  // SpaceMapInput is an input type that accepts SpaceMap and SpaceMapOutput values.
   261  // You can construct a concrete instance of `SpaceMapInput` via:
   262  //
   263  //	SpaceMap{ "key": SpaceArgs{...} }
   264  type SpaceMapInput interface {
   265  	pulumi.Input
   266  
   267  	ToSpaceMapOutput() SpaceMapOutput
   268  	ToSpaceMapOutputWithContext(context.Context) SpaceMapOutput
   269  }
   270  
   271  type SpaceMap map[string]SpaceInput
   272  
   273  func (SpaceMap) ElementType() reflect.Type {
   274  	return reflect.TypeOf((*map[string]*Space)(nil)).Elem()
   275  }
   276  
   277  func (i SpaceMap) ToSpaceMapOutput() SpaceMapOutput {
   278  	return i.ToSpaceMapOutputWithContext(context.Background())
   279  }
   280  
   281  func (i SpaceMap) ToSpaceMapOutputWithContext(ctx context.Context) SpaceMapOutput {
   282  	return pulumi.ToOutputWithContext(ctx, i).(SpaceMapOutput)
   283  }
   284  
   285  type SpaceOutput struct{ *pulumi.OutputState }
   286  
   287  func (SpaceOutput) ElementType() reflect.Type {
   288  	return reflect.TypeOf((**Space)(nil)).Elem()
   289  }
   290  
   291  func (o SpaceOutput) ToSpaceOutput() SpaceOutput {
   292  	return o
   293  }
   294  
   295  func (o SpaceOutput) ToSpaceOutputWithContext(ctx context.Context) SpaceOutput {
   296  	return o
   297  }
   298  
   299  // The space's Amazon Resource Name (ARN).
   300  func (o SpaceOutput) Arn() pulumi.StringOutput {
   301  	return o.ApplyT(func(v *Space) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   302  }
   303  
   304  // The ID of the associated Domain.
   305  func (o SpaceOutput) DomainId() pulumi.StringOutput {
   306  	return o.ApplyT(func(v *Space) pulumi.StringOutput { return v.DomainId }).(pulumi.StringOutput)
   307  }
   308  
   309  // The ID of the space's profile in the Amazon Elastic File System volume.
   310  func (o SpaceOutput) HomeEfsFileSystemUid() pulumi.StringOutput {
   311  	return o.ApplyT(func(v *Space) pulumi.StringOutput { return v.HomeEfsFileSystemUid }).(pulumi.StringOutput)
   312  }
   313  
   314  // A collection of ownership settings. See Ownership Settings below.
   315  func (o SpaceOutput) OwnershipSettings() SpaceOwnershipSettingsPtrOutput {
   316  	return o.ApplyT(func(v *Space) SpaceOwnershipSettingsPtrOutput { return v.OwnershipSettings }).(SpaceOwnershipSettingsPtrOutput)
   317  }
   318  
   319  // The name of the space that appears in the SageMaker Studio UI.
   320  func (o SpaceOutput) SpaceDisplayName() pulumi.StringPtrOutput {
   321  	return o.ApplyT(func(v *Space) pulumi.StringPtrOutput { return v.SpaceDisplayName }).(pulumi.StringPtrOutput)
   322  }
   323  
   324  // The name of the space.
   325  func (o SpaceOutput) SpaceName() pulumi.StringOutput {
   326  	return o.ApplyT(func(v *Space) pulumi.StringOutput { return v.SpaceName }).(pulumi.StringOutput)
   327  }
   328  
   329  // A collection of space settings. See Space Settings below.
   330  func (o SpaceOutput) SpaceSettings() SpaceSpaceSettingsPtrOutput {
   331  	return o.ApplyT(func(v *Space) SpaceSpaceSettingsPtrOutput { return v.SpaceSettings }).(SpaceSpaceSettingsPtrOutput)
   332  }
   333  
   334  // A collection of space sharing settings. See Space Sharing Settings below.
   335  func (o SpaceOutput) SpaceSharingSettings() SpaceSpaceSharingSettingsPtrOutput {
   336  	return o.ApplyT(func(v *Space) SpaceSpaceSharingSettingsPtrOutput { return v.SpaceSharingSettings }).(SpaceSpaceSharingSettingsPtrOutput)
   337  }
   338  
   339  // 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.
   340  func (o SpaceOutput) Tags() pulumi.StringMapOutput {
   341  	return o.ApplyT(func(v *Space) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   342  }
   343  
   344  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   345  //
   346  // Deprecated: Please use `tags` instead.
   347  func (o SpaceOutput) TagsAll() pulumi.StringMapOutput {
   348  	return o.ApplyT(func(v *Space) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   349  }
   350  
   351  // Returns the URL of the space. If the space is created with Amazon Web Services IAM Identity Center (Successor to Amazon Web Services Single Sign-On) authentication, users can navigate to the URL after appending the respective redirect parameter for the application type to be federated through Amazon Web Services IAM Identity Center.
   352  func (o SpaceOutput) Url() pulumi.StringOutput {
   353  	return o.ApplyT(func(v *Space) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
   354  }
   355  
   356  type SpaceArrayOutput struct{ *pulumi.OutputState }
   357  
   358  func (SpaceArrayOutput) ElementType() reflect.Type {
   359  	return reflect.TypeOf((*[]*Space)(nil)).Elem()
   360  }
   361  
   362  func (o SpaceArrayOutput) ToSpaceArrayOutput() SpaceArrayOutput {
   363  	return o
   364  }
   365  
   366  func (o SpaceArrayOutput) ToSpaceArrayOutputWithContext(ctx context.Context) SpaceArrayOutput {
   367  	return o
   368  }
   369  
   370  func (o SpaceArrayOutput) Index(i pulumi.IntInput) SpaceOutput {
   371  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Space {
   372  		return vs[0].([]*Space)[vs[1].(int)]
   373  	}).(SpaceOutput)
   374  }
   375  
   376  type SpaceMapOutput struct{ *pulumi.OutputState }
   377  
   378  func (SpaceMapOutput) ElementType() reflect.Type {
   379  	return reflect.TypeOf((*map[string]*Space)(nil)).Elem()
   380  }
   381  
   382  func (o SpaceMapOutput) ToSpaceMapOutput() SpaceMapOutput {
   383  	return o
   384  }
   385  
   386  func (o SpaceMapOutput) ToSpaceMapOutputWithContext(ctx context.Context) SpaceMapOutput {
   387  	return o
   388  }
   389  
   390  func (o SpaceMapOutput) MapIndex(k pulumi.StringInput) SpaceOutput {
   391  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Space {
   392  		return vs[0].(map[string]*Space)[vs[1].(string)]
   393  	}).(SpaceOutput)
   394  }
   395  
   396  func init() {
   397  	pulumi.RegisterInputType(reflect.TypeOf((*SpaceInput)(nil)).Elem(), &Space{})
   398  	pulumi.RegisterInputType(reflect.TypeOf((*SpaceArrayInput)(nil)).Elem(), SpaceArray{})
   399  	pulumi.RegisterInputType(reflect.TypeOf((*SpaceMapInput)(nil)).Elem(), SpaceMap{})
   400  	pulumi.RegisterOutputType(SpaceOutput{})
   401  	pulumi.RegisterOutputType(SpaceArrayOutput{})
   402  	pulumi.RegisterOutputType(SpaceMapOutput{})
   403  }