github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/image.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 Image 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.NewImage(ctx, "example", &sagemaker.ImageArgs{ 35 // ImageName: pulumi.String("example"), 36 // RoleArn: pulumi.Any(test.Arn), 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 Code Images using the `name`. For example: 51 // 52 // ```sh 53 // $ pulumi import aws:sagemaker/image:Image test_image my-code-repo 54 // ``` 55 type Image struct { 56 pulumi.CustomResourceState 57 58 // The Amazon Resource Name (ARN) assigned by AWS to this Image. 59 Arn pulumi.StringOutput `pulumi:"arn"` 60 // The description of the image. 61 Description pulumi.StringPtrOutput `pulumi:"description"` 62 // The display name of the image. When the image is added to a domain (must be unique to the domain). 63 DisplayName pulumi.StringPtrOutput `pulumi:"displayName"` 64 // The name of the image. Must be unique to your account. 65 ImageName pulumi.StringOutput `pulumi:"imageName"` 66 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 67 RoleArn pulumi.StringOutput `pulumi:"roleArn"` 68 // 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. 69 Tags pulumi.StringMapOutput `pulumi:"tags"` 70 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 71 // 72 // Deprecated: Please use `tags` instead. 73 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 74 } 75 76 // NewImage registers a new resource with the given unique name, arguments, and options. 77 func NewImage(ctx *pulumi.Context, 78 name string, args *ImageArgs, opts ...pulumi.ResourceOption) (*Image, error) { 79 if args == nil { 80 return nil, errors.New("missing one or more required arguments") 81 } 82 83 if args.ImageName == nil { 84 return nil, errors.New("invalid value for required argument 'ImageName'") 85 } 86 if args.RoleArn == nil { 87 return nil, errors.New("invalid value for required argument 'RoleArn'") 88 } 89 opts = internal.PkgResourceDefaultOpts(opts) 90 var resource Image 91 err := ctx.RegisterResource("aws:sagemaker/image:Image", name, args, &resource, opts...) 92 if err != nil { 93 return nil, err 94 } 95 return &resource, nil 96 } 97 98 // GetImage gets an existing Image resource's state with the given name, ID, and optional 99 // state properties that are used to uniquely qualify the lookup (nil if not required). 100 func GetImage(ctx *pulumi.Context, 101 name string, id pulumi.IDInput, state *ImageState, opts ...pulumi.ResourceOption) (*Image, error) { 102 var resource Image 103 err := ctx.ReadResource("aws:sagemaker/image:Image", name, id, state, &resource, opts...) 104 if err != nil { 105 return nil, err 106 } 107 return &resource, nil 108 } 109 110 // Input properties used for looking up and filtering Image resources. 111 type imageState struct { 112 // The Amazon Resource Name (ARN) assigned by AWS to this Image. 113 Arn *string `pulumi:"arn"` 114 // The description of the image. 115 Description *string `pulumi:"description"` 116 // The display name of the image. When the image is added to a domain (must be unique to the domain). 117 DisplayName *string `pulumi:"displayName"` 118 // The name of the image. Must be unique to your account. 119 ImageName *string `pulumi:"imageName"` 120 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 121 RoleArn *string `pulumi:"roleArn"` 122 // 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. 123 Tags map[string]string `pulumi:"tags"` 124 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 125 // 126 // Deprecated: Please use `tags` instead. 127 TagsAll map[string]string `pulumi:"tagsAll"` 128 } 129 130 type ImageState struct { 131 // The Amazon Resource Name (ARN) assigned by AWS to this Image. 132 Arn pulumi.StringPtrInput 133 // The description of the image. 134 Description pulumi.StringPtrInput 135 // The display name of the image. When the image is added to a domain (must be unique to the domain). 136 DisplayName pulumi.StringPtrInput 137 // The name of the image. Must be unique to your account. 138 ImageName pulumi.StringPtrInput 139 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 140 RoleArn pulumi.StringPtrInput 141 // 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. 142 Tags pulumi.StringMapInput 143 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 144 // 145 // Deprecated: Please use `tags` instead. 146 TagsAll pulumi.StringMapInput 147 } 148 149 func (ImageState) ElementType() reflect.Type { 150 return reflect.TypeOf((*imageState)(nil)).Elem() 151 } 152 153 type imageArgs struct { 154 // The description of the image. 155 Description *string `pulumi:"description"` 156 // The display name of the image. When the image is added to a domain (must be unique to the domain). 157 DisplayName *string `pulumi:"displayName"` 158 // The name of the image. Must be unique to your account. 159 ImageName string `pulumi:"imageName"` 160 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 161 RoleArn string `pulumi:"roleArn"` 162 // 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. 163 Tags map[string]string `pulumi:"tags"` 164 } 165 166 // The set of arguments for constructing a Image resource. 167 type ImageArgs struct { 168 // The description of the image. 169 Description pulumi.StringPtrInput 170 // The display name of the image. When the image is added to a domain (must be unique to the domain). 171 DisplayName pulumi.StringPtrInput 172 // The name of the image. Must be unique to your account. 173 ImageName pulumi.StringInput 174 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 175 RoleArn pulumi.StringInput 176 // 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. 177 Tags pulumi.StringMapInput 178 } 179 180 func (ImageArgs) ElementType() reflect.Type { 181 return reflect.TypeOf((*imageArgs)(nil)).Elem() 182 } 183 184 type ImageInput interface { 185 pulumi.Input 186 187 ToImageOutput() ImageOutput 188 ToImageOutputWithContext(ctx context.Context) ImageOutput 189 } 190 191 func (*Image) ElementType() reflect.Type { 192 return reflect.TypeOf((**Image)(nil)).Elem() 193 } 194 195 func (i *Image) ToImageOutput() ImageOutput { 196 return i.ToImageOutputWithContext(context.Background()) 197 } 198 199 func (i *Image) ToImageOutputWithContext(ctx context.Context) ImageOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(ImageOutput) 201 } 202 203 // ImageArrayInput is an input type that accepts ImageArray and ImageArrayOutput values. 204 // You can construct a concrete instance of `ImageArrayInput` via: 205 // 206 // ImageArray{ ImageArgs{...} } 207 type ImageArrayInput interface { 208 pulumi.Input 209 210 ToImageArrayOutput() ImageArrayOutput 211 ToImageArrayOutputWithContext(context.Context) ImageArrayOutput 212 } 213 214 type ImageArray []ImageInput 215 216 func (ImageArray) ElementType() reflect.Type { 217 return reflect.TypeOf((*[]*Image)(nil)).Elem() 218 } 219 220 func (i ImageArray) ToImageArrayOutput() ImageArrayOutput { 221 return i.ToImageArrayOutputWithContext(context.Background()) 222 } 223 224 func (i ImageArray) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput { 225 return pulumi.ToOutputWithContext(ctx, i).(ImageArrayOutput) 226 } 227 228 // ImageMapInput is an input type that accepts ImageMap and ImageMapOutput values. 229 // You can construct a concrete instance of `ImageMapInput` via: 230 // 231 // ImageMap{ "key": ImageArgs{...} } 232 type ImageMapInput interface { 233 pulumi.Input 234 235 ToImageMapOutput() ImageMapOutput 236 ToImageMapOutputWithContext(context.Context) ImageMapOutput 237 } 238 239 type ImageMap map[string]ImageInput 240 241 func (ImageMap) ElementType() reflect.Type { 242 return reflect.TypeOf((*map[string]*Image)(nil)).Elem() 243 } 244 245 func (i ImageMap) ToImageMapOutput() ImageMapOutput { 246 return i.ToImageMapOutputWithContext(context.Background()) 247 } 248 249 func (i ImageMap) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput { 250 return pulumi.ToOutputWithContext(ctx, i).(ImageMapOutput) 251 } 252 253 type ImageOutput struct{ *pulumi.OutputState } 254 255 func (ImageOutput) ElementType() reflect.Type { 256 return reflect.TypeOf((**Image)(nil)).Elem() 257 } 258 259 func (o ImageOutput) ToImageOutput() ImageOutput { 260 return o 261 } 262 263 func (o ImageOutput) ToImageOutputWithContext(ctx context.Context) ImageOutput { 264 return o 265 } 266 267 // The Amazon Resource Name (ARN) assigned by AWS to this Image. 268 func (o ImageOutput) Arn() pulumi.StringOutput { 269 return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 270 } 271 272 // The description of the image. 273 func (o ImageOutput) Description() pulumi.StringPtrOutput { 274 return o.ApplyT(func(v *Image) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput) 275 } 276 277 // The display name of the image. When the image is added to a domain (must be unique to the domain). 278 func (o ImageOutput) DisplayName() pulumi.StringPtrOutput { 279 return o.ApplyT(func(v *Image) pulumi.StringPtrOutput { return v.DisplayName }).(pulumi.StringPtrOutput) 280 } 281 282 // The name of the image. Must be unique to your account. 283 func (o ImageOutput) ImageName() pulumi.StringOutput { 284 return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.ImageName }).(pulumi.StringOutput) 285 } 286 287 // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf. 288 func (o ImageOutput) RoleArn() pulumi.StringOutput { 289 return o.ApplyT(func(v *Image) pulumi.StringOutput { return v.RoleArn }).(pulumi.StringOutput) 290 } 291 292 // 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. 293 func (o ImageOutput) Tags() pulumi.StringMapOutput { 294 return o.ApplyT(func(v *Image) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 295 } 296 297 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 298 // 299 // Deprecated: Please use `tags` instead. 300 func (o ImageOutput) TagsAll() pulumi.StringMapOutput { 301 return o.ApplyT(func(v *Image) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 302 } 303 304 type ImageArrayOutput struct{ *pulumi.OutputState } 305 306 func (ImageArrayOutput) ElementType() reflect.Type { 307 return reflect.TypeOf((*[]*Image)(nil)).Elem() 308 } 309 310 func (o ImageArrayOutput) ToImageArrayOutput() ImageArrayOutput { 311 return o 312 } 313 314 func (o ImageArrayOutput) ToImageArrayOutputWithContext(ctx context.Context) ImageArrayOutput { 315 return o 316 } 317 318 func (o ImageArrayOutput) Index(i pulumi.IntInput) ImageOutput { 319 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Image { 320 return vs[0].([]*Image)[vs[1].(int)] 321 }).(ImageOutput) 322 } 323 324 type ImageMapOutput struct{ *pulumi.OutputState } 325 326 func (ImageMapOutput) ElementType() reflect.Type { 327 return reflect.TypeOf((*map[string]*Image)(nil)).Elem() 328 } 329 330 func (o ImageMapOutput) ToImageMapOutput() ImageMapOutput { 331 return o 332 } 333 334 func (o ImageMapOutput) ToImageMapOutputWithContext(ctx context.Context) ImageMapOutput { 335 return o 336 } 337 338 func (o ImageMapOutput) MapIndex(k pulumi.StringInput) ImageOutput { 339 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Image { 340 return vs[0].(map[string]*Image)[vs[1].(string)] 341 }).(ImageOutput) 342 } 343 344 func init() { 345 pulumi.RegisterInputType(reflect.TypeOf((*ImageInput)(nil)).Elem(), &Image{}) 346 pulumi.RegisterInputType(reflect.TypeOf((*ImageArrayInput)(nil)).Elem(), ImageArray{}) 347 pulumi.RegisterInputType(reflect.TypeOf((*ImageMapInput)(nil)).Elem(), ImageMap{}) 348 pulumi.RegisterOutputType(ImageOutput{}) 349 pulumi.RegisterOutputType(ImageArrayOutput{}) 350 pulumi.RegisterOutputType(ImageMapOutput{}) 351 }