github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/appImageConfig.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 Image Config 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.NewAppImageConfig(ctx, "test", &sagemaker.AppImageConfigArgs{
    35  //				AppImageConfigName: pulumi.String("example"),
    36  //				KernelGatewayImageConfig: &sagemaker.AppImageConfigKernelGatewayImageConfigArgs{
    37  //					KernelSpec: &sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArgs{
    38  //						Name: pulumi.String("example"),
    39  //					},
    40  //				},
    41  //			})
    42  //			if err != nil {
    43  //				return err
    44  //			}
    45  //			return nil
    46  //		})
    47  //	}
    48  //
    49  // ```
    50  // <!--End PulumiCodeChooser -->
    51  //
    52  // ### Default File System Config
    53  //
    54  // <!--Start PulumiCodeChooser -->
    55  // ```go
    56  // package main
    57  //
    58  // import (
    59  //
    60  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
    61  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    62  //
    63  // )
    64  //
    65  //	func main() {
    66  //		pulumi.Run(func(ctx *pulumi.Context) error {
    67  //			_, err := sagemaker.NewAppImageConfig(ctx, "test", &sagemaker.AppImageConfigArgs{
    68  //				AppImageConfigName: pulumi.String("example"),
    69  //				KernelGatewayImageConfig: &sagemaker.AppImageConfigKernelGatewayImageConfigArgs{
    70  //					KernelSpec: &sagemaker.AppImageConfigKernelGatewayImageConfigKernelSpecArgs{
    71  //						Name: pulumi.String("example"),
    72  //					},
    73  //					FileSystemConfig: nil,
    74  //				},
    75  //			})
    76  //			if err != nil {
    77  //				return err
    78  //			}
    79  //			return nil
    80  //		})
    81  //	}
    82  //
    83  // ```
    84  // <!--End PulumiCodeChooser -->
    85  //
    86  // ## Import
    87  //
    88  // Using `pulumi import`, import SageMaker App Image Configs using the `name`. For example:
    89  //
    90  // ```sh
    91  // $ pulumi import aws:sagemaker/appImageConfig:AppImageConfig example example
    92  // ```
    93  type AppImageConfig struct {
    94  	pulumi.CustomResourceState
    95  
    96  	// The name of the App Image Config.
    97  	AppImageConfigName pulumi.StringOutput `pulumi:"appImageConfigName"`
    98  	// The Amazon Resource Name (ARN) assigned by AWS to this App Image Config.
    99  	Arn                   pulumi.StringOutput                          `pulumi:"arn"`
   100  	JupyterLabImageConfig AppImageConfigJupyterLabImageConfigPtrOutput `pulumi:"jupyterLabImageConfig"`
   101  	// The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   102  	KernelGatewayImageConfig AppImageConfigKernelGatewayImageConfigPtrOutput `pulumi:"kernelGatewayImageConfig"`
   103  	// 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.
   104  	Tags pulumi.StringMapOutput `pulumi:"tags"`
   105  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   106  	//
   107  	// Deprecated: Please use `tags` instead.
   108  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
   109  }
   110  
   111  // NewAppImageConfig registers a new resource with the given unique name, arguments, and options.
   112  func NewAppImageConfig(ctx *pulumi.Context,
   113  	name string, args *AppImageConfigArgs, opts ...pulumi.ResourceOption) (*AppImageConfig, error) {
   114  	if args == nil {
   115  		return nil, errors.New("missing one or more required arguments")
   116  	}
   117  
   118  	if args.AppImageConfigName == nil {
   119  		return nil, errors.New("invalid value for required argument 'AppImageConfigName'")
   120  	}
   121  	opts = internal.PkgResourceDefaultOpts(opts)
   122  	var resource AppImageConfig
   123  	err := ctx.RegisterResource("aws:sagemaker/appImageConfig:AppImageConfig", name, args, &resource, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	return &resource, nil
   128  }
   129  
   130  // GetAppImageConfig gets an existing AppImageConfig resource's state with the given name, ID, and optional
   131  // state properties that are used to uniquely qualify the lookup (nil if not required).
   132  func GetAppImageConfig(ctx *pulumi.Context,
   133  	name string, id pulumi.IDInput, state *AppImageConfigState, opts ...pulumi.ResourceOption) (*AppImageConfig, error) {
   134  	var resource AppImageConfig
   135  	err := ctx.ReadResource("aws:sagemaker/appImageConfig:AppImageConfig", name, id, state, &resource, opts...)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return &resource, nil
   140  }
   141  
   142  // Input properties used for looking up and filtering AppImageConfig resources.
   143  type appImageConfigState struct {
   144  	// The name of the App Image Config.
   145  	AppImageConfigName *string `pulumi:"appImageConfigName"`
   146  	// The Amazon Resource Name (ARN) assigned by AWS to this App Image Config.
   147  	Arn                   *string                              `pulumi:"arn"`
   148  	JupyterLabImageConfig *AppImageConfigJupyterLabImageConfig `pulumi:"jupyterLabImageConfig"`
   149  	// The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   150  	KernelGatewayImageConfig *AppImageConfigKernelGatewayImageConfig `pulumi:"kernelGatewayImageConfig"`
   151  	// 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.
   152  	Tags map[string]string `pulumi:"tags"`
   153  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   154  	//
   155  	// Deprecated: Please use `tags` instead.
   156  	TagsAll map[string]string `pulumi:"tagsAll"`
   157  }
   158  
   159  type AppImageConfigState struct {
   160  	// The name of the App Image Config.
   161  	AppImageConfigName pulumi.StringPtrInput
   162  	// The Amazon Resource Name (ARN) assigned by AWS to this App Image Config.
   163  	Arn                   pulumi.StringPtrInput
   164  	JupyterLabImageConfig AppImageConfigJupyterLabImageConfigPtrInput
   165  	// The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   166  	KernelGatewayImageConfig AppImageConfigKernelGatewayImageConfigPtrInput
   167  	// 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.
   168  	Tags pulumi.StringMapInput
   169  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   170  	//
   171  	// Deprecated: Please use `tags` instead.
   172  	TagsAll pulumi.StringMapInput
   173  }
   174  
   175  func (AppImageConfigState) ElementType() reflect.Type {
   176  	return reflect.TypeOf((*appImageConfigState)(nil)).Elem()
   177  }
   178  
   179  type appImageConfigArgs struct {
   180  	// The name of the App Image Config.
   181  	AppImageConfigName    string                               `pulumi:"appImageConfigName"`
   182  	JupyterLabImageConfig *AppImageConfigJupyterLabImageConfig `pulumi:"jupyterLabImageConfig"`
   183  	// The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   184  	KernelGatewayImageConfig *AppImageConfigKernelGatewayImageConfig `pulumi:"kernelGatewayImageConfig"`
   185  	// 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.
   186  	Tags map[string]string `pulumi:"tags"`
   187  }
   188  
   189  // The set of arguments for constructing a AppImageConfig resource.
   190  type AppImageConfigArgs struct {
   191  	// The name of the App Image Config.
   192  	AppImageConfigName    pulumi.StringInput
   193  	JupyterLabImageConfig AppImageConfigJupyterLabImageConfigPtrInput
   194  	// The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   195  	KernelGatewayImageConfig AppImageConfigKernelGatewayImageConfigPtrInput
   196  	// 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.
   197  	Tags pulumi.StringMapInput
   198  }
   199  
   200  func (AppImageConfigArgs) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*appImageConfigArgs)(nil)).Elem()
   202  }
   203  
   204  type AppImageConfigInput interface {
   205  	pulumi.Input
   206  
   207  	ToAppImageConfigOutput() AppImageConfigOutput
   208  	ToAppImageConfigOutputWithContext(ctx context.Context) AppImageConfigOutput
   209  }
   210  
   211  func (*AppImageConfig) ElementType() reflect.Type {
   212  	return reflect.TypeOf((**AppImageConfig)(nil)).Elem()
   213  }
   214  
   215  func (i *AppImageConfig) ToAppImageConfigOutput() AppImageConfigOutput {
   216  	return i.ToAppImageConfigOutputWithContext(context.Background())
   217  }
   218  
   219  func (i *AppImageConfig) ToAppImageConfigOutputWithContext(ctx context.Context) AppImageConfigOutput {
   220  	return pulumi.ToOutputWithContext(ctx, i).(AppImageConfigOutput)
   221  }
   222  
   223  // AppImageConfigArrayInput is an input type that accepts AppImageConfigArray and AppImageConfigArrayOutput values.
   224  // You can construct a concrete instance of `AppImageConfigArrayInput` via:
   225  //
   226  //	AppImageConfigArray{ AppImageConfigArgs{...} }
   227  type AppImageConfigArrayInput interface {
   228  	pulumi.Input
   229  
   230  	ToAppImageConfigArrayOutput() AppImageConfigArrayOutput
   231  	ToAppImageConfigArrayOutputWithContext(context.Context) AppImageConfigArrayOutput
   232  }
   233  
   234  type AppImageConfigArray []AppImageConfigInput
   235  
   236  func (AppImageConfigArray) ElementType() reflect.Type {
   237  	return reflect.TypeOf((*[]*AppImageConfig)(nil)).Elem()
   238  }
   239  
   240  func (i AppImageConfigArray) ToAppImageConfigArrayOutput() AppImageConfigArrayOutput {
   241  	return i.ToAppImageConfigArrayOutputWithContext(context.Background())
   242  }
   243  
   244  func (i AppImageConfigArray) ToAppImageConfigArrayOutputWithContext(ctx context.Context) AppImageConfigArrayOutput {
   245  	return pulumi.ToOutputWithContext(ctx, i).(AppImageConfigArrayOutput)
   246  }
   247  
   248  // AppImageConfigMapInput is an input type that accepts AppImageConfigMap and AppImageConfigMapOutput values.
   249  // You can construct a concrete instance of `AppImageConfigMapInput` via:
   250  //
   251  //	AppImageConfigMap{ "key": AppImageConfigArgs{...} }
   252  type AppImageConfigMapInput interface {
   253  	pulumi.Input
   254  
   255  	ToAppImageConfigMapOutput() AppImageConfigMapOutput
   256  	ToAppImageConfigMapOutputWithContext(context.Context) AppImageConfigMapOutput
   257  }
   258  
   259  type AppImageConfigMap map[string]AppImageConfigInput
   260  
   261  func (AppImageConfigMap) ElementType() reflect.Type {
   262  	return reflect.TypeOf((*map[string]*AppImageConfig)(nil)).Elem()
   263  }
   264  
   265  func (i AppImageConfigMap) ToAppImageConfigMapOutput() AppImageConfigMapOutput {
   266  	return i.ToAppImageConfigMapOutputWithContext(context.Background())
   267  }
   268  
   269  func (i AppImageConfigMap) ToAppImageConfigMapOutputWithContext(ctx context.Context) AppImageConfigMapOutput {
   270  	return pulumi.ToOutputWithContext(ctx, i).(AppImageConfigMapOutput)
   271  }
   272  
   273  type AppImageConfigOutput struct{ *pulumi.OutputState }
   274  
   275  func (AppImageConfigOutput) ElementType() reflect.Type {
   276  	return reflect.TypeOf((**AppImageConfig)(nil)).Elem()
   277  }
   278  
   279  func (o AppImageConfigOutput) ToAppImageConfigOutput() AppImageConfigOutput {
   280  	return o
   281  }
   282  
   283  func (o AppImageConfigOutput) ToAppImageConfigOutputWithContext(ctx context.Context) AppImageConfigOutput {
   284  	return o
   285  }
   286  
   287  // The name of the App Image Config.
   288  func (o AppImageConfigOutput) AppImageConfigName() pulumi.StringOutput {
   289  	return o.ApplyT(func(v *AppImageConfig) pulumi.StringOutput { return v.AppImageConfigName }).(pulumi.StringOutput)
   290  }
   291  
   292  // The Amazon Resource Name (ARN) assigned by AWS to this App Image Config.
   293  func (o AppImageConfigOutput) Arn() pulumi.StringOutput {
   294  	return o.ApplyT(func(v *AppImageConfig) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   295  }
   296  
   297  func (o AppImageConfigOutput) JupyterLabImageConfig() AppImageConfigJupyterLabImageConfigPtrOutput {
   298  	return o.ApplyT(func(v *AppImageConfig) AppImageConfigJupyterLabImageConfigPtrOutput { return v.JupyterLabImageConfig }).(AppImageConfigJupyterLabImageConfigPtrOutput)
   299  }
   300  
   301  // The configuration for the file system and kernels in a SageMaker image running as a KernelGateway app. See Kernel Gateway Image Config details below.
   302  func (o AppImageConfigOutput) KernelGatewayImageConfig() AppImageConfigKernelGatewayImageConfigPtrOutput {
   303  	return o.ApplyT(func(v *AppImageConfig) AppImageConfigKernelGatewayImageConfigPtrOutput {
   304  		return v.KernelGatewayImageConfig
   305  	}).(AppImageConfigKernelGatewayImageConfigPtrOutput)
   306  }
   307  
   308  // 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.
   309  func (o AppImageConfigOutput) Tags() pulumi.StringMapOutput {
   310  	return o.ApplyT(func(v *AppImageConfig) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   311  }
   312  
   313  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   314  //
   315  // Deprecated: Please use `tags` instead.
   316  func (o AppImageConfigOutput) TagsAll() pulumi.StringMapOutput {
   317  	return o.ApplyT(func(v *AppImageConfig) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   318  }
   319  
   320  type AppImageConfigArrayOutput struct{ *pulumi.OutputState }
   321  
   322  func (AppImageConfigArrayOutput) ElementType() reflect.Type {
   323  	return reflect.TypeOf((*[]*AppImageConfig)(nil)).Elem()
   324  }
   325  
   326  func (o AppImageConfigArrayOutput) ToAppImageConfigArrayOutput() AppImageConfigArrayOutput {
   327  	return o
   328  }
   329  
   330  func (o AppImageConfigArrayOutput) ToAppImageConfigArrayOutputWithContext(ctx context.Context) AppImageConfigArrayOutput {
   331  	return o
   332  }
   333  
   334  func (o AppImageConfigArrayOutput) Index(i pulumi.IntInput) AppImageConfigOutput {
   335  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AppImageConfig {
   336  		return vs[0].([]*AppImageConfig)[vs[1].(int)]
   337  	}).(AppImageConfigOutput)
   338  }
   339  
   340  type AppImageConfigMapOutput struct{ *pulumi.OutputState }
   341  
   342  func (AppImageConfigMapOutput) ElementType() reflect.Type {
   343  	return reflect.TypeOf((*map[string]*AppImageConfig)(nil)).Elem()
   344  }
   345  
   346  func (o AppImageConfigMapOutput) ToAppImageConfigMapOutput() AppImageConfigMapOutput {
   347  	return o
   348  }
   349  
   350  func (o AppImageConfigMapOutput) ToAppImageConfigMapOutputWithContext(ctx context.Context) AppImageConfigMapOutput {
   351  	return o
   352  }
   353  
   354  func (o AppImageConfigMapOutput) MapIndex(k pulumi.StringInput) AppImageConfigOutput {
   355  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AppImageConfig {
   356  		return vs[0].(map[string]*AppImageConfig)[vs[1].(string)]
   357  	}).(AppImageConfigOutput)
   358  }
   359  
   360  func init() {
   361  	pulumi.RegisterInputType(reflect.TypeOf((*AppImageConfigInput)(nil)).Elem(), &AppImageConfig{})
   362  	pulumi.RegisterInputType(reflect.TypeOf((*AppImageConfigArrayInput)(nil)).Elem(), AppImageConfigArray{})
   363  	pulumi.RegisterInputType(reflect.TypeOf((*AppImageConfigMapInput)(nil)).Elem(), AppImageConfigMap{})
   364  	pulumi.RegisterOutputType(AppImageConfigOutput{})
   365  	pulumi.RegisterOutputType(AppImageConfigArrayOutput{})
   366  	pulumi.RegisterOutputType(AppImageConfigMapOutput{})
   367  }