github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/app.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 App 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.NewApp(ctx, "example", &sagemaker.AppArgs{
    35  //				DomainId:        pulumi.Any(exampleAwsSagemakerDomain.Id),
    36  //				UserProfileName: pulumi.Any(exampleAwsSagemakerUserProfile.UserProfileName),
    37  //				AppName:         pulumi.String("example"),
    38  //				AppType:         pulumi.String("JupyterServer"),
    39  //			})
    40  //			if err != nil {
    41  //				return err
    42  //			}
    43  //			return nil
    44  //		})
    45  //	}
    46  //
    47  // ```
    48  // <!--End PulumiCodeChooser -->
    49  //
    50  // ## Import
    51  //
    52  // Using `pulumi import`, import SageMaker Apps using the `id`. For example:
    53  //
    54  // ```sh
    55  // $ pulumi import aws:sagemaker/app:App example arn:aws:sagemaker:us-west-2:012345678912:app/domain-id/user-profile-name/app-type/app-name
    56  // ```
    57  type App struct {
    58  	pulumi.CustomResourceState
    59  
    60  	// The name of the app.
    61  	AppName pulumi.StringOutput `pulumi:"appName"`
    62  	// The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
    63  	AppType pulumi.StringOutput `pulumi:"appType"`
    64  	// The Amazon Resource Name (ARN) of the app.
    65  	Arn pulumi.StringOutput `pulumi:"arn"`
    66  	// The domain ID.
    67  	DomainId pulumi.StringOutput `pulumi:"domainId"`
    68  	// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
    69  	ResourceSpec AppResourceSpecOutput `pulumi:"resourceSpec"`
    70  	// The name of the space. At least one of `userProfileName` or `spaceName` required.
    71  	SpaceName pulumi.StringPtrOutput `pulumi:"spaceName"`
    72  	// 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.
    73  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    74  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    75  	//
    76  	// Deprecated: Please use `tags` instead.
    77  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    78  	// The user profile name. At least one of `userProfileName` or `spaceName` required.
    79  	UserProfileName pulumi.StringPtrOutput `pulumi:"userProfileName"`
    80  }
    81  
    82  // NewApp registers a new resource with the given unique name, arguments, and options.
    83  func NewApp(ctx *pulumi.Context,
    84  	name string, args *AppArgs, opts ...pulumi.ResourceOption) (*App, error) {
    85  	if args == nil {
    86  		return nil, errors.New("missing one or more required arguments")
    87  	}
    88  
    89  	if args.AppName == nil {
    90  		return nil, errors.New("invalid value for required argument 'AppName'")
    91  	}
    92  	if args.AppType == nil {
    93  		return nil, errors.New("invalid value for required argument 'AppType'")
    94  	}
    95  	if args.DomainId == nil {
    96  		return nil, errors.New("invalid value for required argument 'DomainId'")
    97  	}
    98  	opts = internal.PkgResourceDefaultOpts(opts)
    99  	var resource App
   100  	err := ctx.RegisterResource("aws:sagemaker/app:App", name, args, &resource, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return &resource, nil
   105  }
   106  
   107  // GetApp gets an existing App resource's state with the given name, ID, and optional
   108  // state properties that are used to uniquely qualify the lookup (nil if not required).
   109  func GetApp(ctx *pulumi.Context,
   110  	name string, id pulumi.IDInput, state *AppState, opts ...pulumi.ResourceOption) (*App, error) {
   111  	var resource App
   112  	err := ctx.ReadResource("aws:sagemaker/app:App", name, id, state, &resource, opts...)
   113  	if err != nil {
   114  		return nil, err
   115  	}
   116  	return &resource, nil
   117  }
   118  
   119  // Input properties used for looking up and filtering App resources.
   120  type appState struct {
   121  	// The name of the app.
   122  	AppName *string `pulumi:"appName"`
   123  	// The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
   124  	AppType *string `pulumi:"appType"`
   125  	// The Amazon Resource Name (ARN) of the app.
   126  	Arn *string `pulumi:"arn"`
   127  	// The domain ID.
   128  	DomainId *string `pulumi:"domainId"`
   129  	// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
   130  	ResourceSpec *AppResourceSpec `pulumi:"resourceSpec"`
   131  	// The name of the space. At least one of `userProfileName` or `spaceName` required.
   132  	SpaceName *string `pulumi:"spaceName"`
   133  	// 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.
   134  	Tags map[string]string `pulumi:"tags"`
   135  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   136  	//
   137  	// Deprecated: Please use `tags` instead.
   138  	TagsAll map[string]string `pulumi:"tagsAll"`
   139  	// The user profile name. At least one of `userProfileName` or `spaceName` required.
   140  	UserProfileName *string `pulumi:"userProfileName"`
   141  }
   142  
   143  type AppState struct {
   144  	// The name of the app.
   145  	AppName pulumi.StringPtrInput
   146  	// The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
   147  	AppType pulumi.StringPtrInput
   148  	// The Amazon Resource Name (ARN) of the app.
   149  	Arn pulumi.StringPtrInput
   150  	// The domain ID.
   151  	DomainId pulumi.StringPtrInput
   152  	// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
   153  	ResourceSpec AppResourceSpecPtrInput
   154  	// The name of the space. At least one of `userProfileName` or `spaceName` required.
   155  	SpaceName pulumi.StringPtrInput
   156  	// 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.
   157  	Tags pulumi.StringMapInput
   158  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   159  	//
   160  	// Deprecated: Please use `tags` instead.
   161  	TagsAll pulumi.StringMapInput
   162  	// The user profile name. At least one of `userProfileName` or `spaceName` required.
   163  	UserProfileName pulumi.StringPtrInput
   164  }
   165  
   166  func (AppState) ElementType() reflect.Type {
   167  	return reflect.TypeOf((*appState)(nil)).Elem()
   168  }
   169  
   170  type appArgs struct {
   171  	// The name of the app.
   172  	AppName string `pulumi:"appName"`
   173  	// The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
   174  	AppType string `pulumi:"appType"`
   175  	// The domain ID.
   176  	DomainId string `pulumi:"domainId"`
   177  	// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
   178  	ResourceSpec *AppResourceSpec `pulumi:"resourceSpec"`
   179  	// The name of the space. At least one of `userProfileName` or `spaceName` required.
   180  	SpaceName *string `pulumi:"spaceName"`
   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  	// The user profile name. At least one of `userProfileName` or `spaceName` required.
   184  	UserProfileName *string `pulumi:"userProfileName"`
   185  }
   186  
   187  // The set of arguments for constructing a App resource.
   188  type AppArgs struct {
   189  	// The name of the app.
   190  	AppName pulumi.StringInput
   191  	// The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
   192  	AppType pulumi.StringInput
   193  	// The domain ID.
   194  	DomainId pulumi.StringInput
   195  	// The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
   196  	ResourceSpec AppResourceSpecPtrInput
   197  	// The name of the space. At least one of `userProfileName` or `spaceName` required.
   198  	SpaceName pulumi.StringPtrInput
   199  	// 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.
   200  	Tags pulumi.StringMapInput
   201  	// The user profile name. At least one of `userProfileName` or `spaceName` required.
   202  	UserProfileName pulumi.StringPtrInput
   203  }
   204  
   205  func (AppArgs) ElementType() reflect.Type {
   206  	return reflect.TypeOf((*appArgs)(nil)).Elem()
   207  }
   208  
   209  type AppInput interface {
   210  	pulumi.Input
   211  
   212  	ToAppOutput() AppOutput
   213  	ToAppOutputWithContext(ctx context.Context) AppOutput
   214  }
   215  
   216  func (*App) ElementType() reflect.Type {
   217  	return reflect.TypeOf((**App)(nil)).Elem()
   218  }
   219  
   220  func (i *App) ToAppOutput() AppOutput {
   221  	return i.ToAppOutputWithContext(context.Background())
   222  }
   223  
   224  func (i *App) ToAppOutputWithContext(ctx context.Context) AppOutput {
   225  	return pulumi.ToOutputWithContext(ctx, i).(AppOutput)
   226  }
   227  
   228  // AppArrayInput is an input type that accepts AppArray and AppArrayOutput values.
   229  // You can construct a concrete instance of `AppArrayInput` via:
   230  //
   231  //	AppArray{ AppArgs{...} }
   232  type AppArrayInput interface {
   233  	pulumi.Input
   234  
   235  	ToAppArrayOutput() AppArrayOutput
   236  	ToAppArrayOutputWithContext(context.Context) AppArrayOutput
   237  }
   238  
   239  type AppArray []AppInput
   240  
   241  func (AppArray) ElementType() reflect.Type {
   242  	return reflect.TypeOf((*[]*App)(nil)).Elem()
   243  }
   244  
   245  func (i AppArray) ToAppArrayOutput() AppArrayOutput {
   246  	return i.ToAppArrayOutputWithContext(context.Background())
   247  }
   248  
   249  func (i AppArray) ToAppArrayOutputWithContext(ctx context.Context) AppArrayOutput {
   250  	return pulumi.ToOutputWithContext(ctx, i).(AppArrayOutput)
   251  }
   252  
   253  // AppMapInput is an input type that accepts AppMap and AppMapOutput values.
   254  // You can construct a concrete instance of `AppMapInput` via:
   255  //
   256  //	AppMap{ "key": AppArgs{...} }
   257  type AppMapInput interface {
   258  	pulumi.Input
   259  
   260  	ToAppMapOutput() AppMapOutput
   261  	ToAppMapOutputWithContext(context.Context) AppMapOutput
   262  }
   263  
   264  type AppMap map[string]AppInput
   265  
   266  func (AppMap) ElementType() reflect.Type {
   267  	return reflect.TypeOf((*map[string]*App)(nil)).Elem()
   268  }
   269  
   270  func (i AppMap) ToAppMapOutput() AppMapOutput {
   271  	return i.ToAppMapOutputWithContext(context.Background())
   272  }
   273  
   274  func (i AppMap) ToAppMapOutputWithContext(ctx context.Context) AppMapOutput {
   275  	return pulumi.ToOutputWithContext(ctx, i).(AppMapOutput)
   276  }
   277  
   278  type AppOutput struct{ *pulumi.OutputState }
   279  
   280  func (AppOutput) ElementType() reflect.Type {
   281  	return reflect.TypeOf((**App)(nil)).Elem()
   282  }
   283  
   284  func (o AppOutput) ToAppOutput() AppOutput {
   285  	return o
   286  }
   287  
   288  func (o AppOutput) ToAppOutputWithContext(ctx context.Context) AppOutput {
   289  	return o
   290  }
   291  
   292  // The name of the app.
   293  func (o AppOutput) AppName() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *App) pulumi.StringOutput { return v.AppName }).(pulumi.StringOutput)
   295  }
   296  
   297  // The type of app. Valid values are `JupyterServer`, `KernelGateway`, `RStudioServerPro`, `RSessionGateway` and `TensorBoard`.
   298  func (o AppOutput) AppType() pulumi.StringOutput {
   299  	return o.ApplyT(func(v *App) pulumi.StringOutput { return v.AppType }).(pulumi.StringOutput)
   300  }
   301  
   302  // The Amazon Resource Name (ARN) of the app.
   303  func (o AppOutput) Arn() pulumi.StringOutput {
   304  	return o.ApplyT(func(v *App) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   305  }
   306  
   307  // The domain ID.
   308  func (o AppOutput) DomainId() pulumi.StringOutput {
   309  	return o.ApplyT(func(v *App) pulumi.StringOutput { return v.DomainId }).(pulumi.StringOutput)
   310  }
   311  
   312  // The instance type and the Amazon Resource Name (ARN) of the SageMaker image created on the instance.See Resource Spec below.
   313  func (o AppOutput) ResourceSpec() AppResourceSpecOutput {
   314  	return o.ApplyT(func(v *App) AppResourceSpecOutput { return v.ResourceSpec }).(AppResourceSpecOutput)
   315  }
   316  
   317  // The name of the space. At least one of `userProfileName` or `spaceName` required.
   318  func (o AppOutput) SpaceName() pulumi.StringPtrOutput {
   319  	return o.ApplyT(func(v *App) pulumi.StringPtrOutput { return v.SpaceName }).(pulumi.StringPtrOutput)
   320  }
   321  
   322  // 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.
   323  func (o AppOutput) Tags() pulumi.StringMapOutput {
   324  	return o.ApplyT(func(v *App) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   325  }
   326  
   327  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   328  //
   329  // Deprecated: Please use `tags` instead.
   330  func (o AppOutput) TagsAll() pulumi.StringMapOutput {
   331  	return o.ApplyT(func(v *App) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   332  }
   333  
   334  // The user profile name. At least one of `userProfileName` or `spaceName` required.
   335  func (o AppOutput) UserProfileName() pulumi.StringPtrOutput {
   336  	return o.ApplyT(func(v *App) pulumi.StringPtrOutput { return v.UserProfileName }).(pulumi.StringPtrOutput)
   337  }
   338  
   339  type AppArrayOutput struct{ *pulumi.OutputState }
   340  
   341  func (AppArrayOutput) ElementType() reflect.Type {
   342  	return reflect.TypeOf((*[]*App)(nil)).Elem()
   343  }
   344  
   345  func (o AppArrayOutput) ToAppArrayOutput() AppArrayOutput {
   346  	return o
   347  }
   348  
   349  func (o AppArrayOutput) ToAppArrayOutputWithContext(ctx context.Context) AppArrayOutput {
   350  	return o
   351  }
   352  
   353  func (o AppArrayOutput) Index(i pulumi.IntInput) AppOutput {
   354  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *App {
   355  		return vs[0].([]*App)[vs[1].(int)]
   356  	}).(AppOutput)
   357  }
   358  
   359  type AppMapOutput struct{ *pulumi.OutputState }
   360  
   361  func (AppMapOutput) ElementType() reflect.Type {
   362  	return reflect.TypeOf((*map[string]*App)(nil)).Elem()
   363  }
   364  
   365  func (o AppMapOutput) ToAppMapOutput() AppMapOutput {
   366  	return o
   367  }
   368  
   369  func (o AppMapOutput) ToAppMapOutputWithContext(ctx context.Context) AppMapOutput {
   370  	return o
   371  }
   372  
   373  func (o AppMapOutput) MapIndex(k pulumi.StringInput) AppOutput {
   374  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *App {
   375  		return vs[0].(map[string]*App)[vs[1].(string)]
   376  	}).(AppOutput)
   377  }
   378  
   379  func init() {
   380  	pulumi.RegisterInputType(reflect.TypeOf((*AppInput)(nil)).Elem(), &App{})
   381  	pulumi.RegisterInputType(reflect.TypeOf((*AppArrayInput)(nil)).Elem(), AppArray{})
   382  	pulumi.RegisterInputType(reflect.TypeOf((*AppMapInput)(nil)).Elem(), AppMap{})
   383  	pulumi.RegisterOutputType(AppOutput{})
   384  	pulumi.RegisterOutputType(AppArrayOutput{})
   385  	pulumi.RegisterOutputType(AppMapOutput{})
   386  }