github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/endpoint.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 Endpoint 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.NewEndpoint(ctx, "e", &sagemaker.EndpointArgs{ 35 // Name: pulumi.String("my-endpoint"), 36 // EndpointConfigName: pulumi.Any(ec.Name), 37 // Tags: pulumi.StringMap{ 38 // "Name": pulumi.String("foo"), 39 // }, 40 // }) 41 // if err != nil { 42 // return err 43 // } 44 // return nil 45 // }) 46 // } 47 // 48 // ``` 49 // <!--End PulumiCodeChooser --> 50 // 51 // ## Import 52 // 53 // Using `pulumi import`, import endpoints using the `name`. For example: 54 // 55 // ```sh 56 // $ pulumi import aws:sagemaker/endpoint:Endpoint test_endpoint my-endpoint 57 // ``` 58 type Endpoint struct { 59 pulumi.CustomResourceState 60 61 // The Amazon Resource Name (ARN) assigned by AWS to this endpoint. 62 Arn pulumi.StringOutput `pulumi:"arn"` 63 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 64 DeploymentConfig EndpointDeploymentConfigPtrOutput `pulumi:"deploymentConfig"` 65 // The name of the endpoint configuration to use. 66 EndpointConfigName pulumi.StringOutput `pulumi:"endpointConfigName"` 67 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 68 Name pulumi.StringOutput `pulumi:"name"` 69 // 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. 70 Tags pulumi.StringMapOutput `pulumi:"tags"` 71 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 72 // 73 // Deprecated: Please use `tags` instead. 74 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 75 } 76 77 // NewEndpoint registers a new resource with the given unique name, arguments, and options. 78 func NewEndpoint(ctx *pulumi.Context, 79 name string, args *EndpointArgs, opts ...pulumi.ResourceOption) (*Endpoint, error) { 80 if args == nil { 81 return nil, errors.New("missing one or more required arguments") 82 } 83 84 if args.EndpointConfigName == nil { 85 return nil, errors.New("invalid value for required argument 'EndpointConfigName'") 86 } 87 opts = internal.PkgResourceDefaultOpts(opts) 88 var resource Endpoint 89 err := ctx.RegisterResource("aws:sagemaker/endpoint:Endpoint", name, args, &resource, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return &resource, nil 94 } 95 96 // GetEndpoint gets an existing Endpoint resource's state with the given name, ID, and optional 97 // state properties that are used to uniquely qualify the lookup (nil if not required). 98 func GetEndpoint(ctx *pulumi.Context, 99 name string, id pulumi.IDInput, state *EndpointState, opts ...pulumi.ResourceOption) (*Endpoint, error) { 100 var resource Endpoint 101 err := ctx.ReadResource("aws:sagemaker/endpoint:Endpoint", name, id, state, &resource, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return &resource, nil 106 } 107 108 // Input properties used for looking up and filtering Endpoint resources. 109 type endpointState struct { 110 // The Amazon Resource Name (ARN) assigned by AWS to this endpoint. 111 Arn *string `pulumi:"arn"` 112 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 113 DeploymentConfig *EndpointDeploymentConfig `pulumi:"deploymentConfig"` 114 // The name of the endpoint configuration to use. 115 EndpointConfigName *string `pulumi:"endpointConfigName"` 116 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 117 Name *string `pulumi:"name"` 118 // 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. 119 Tags map[string]string `pulumi:"tags"` 120 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 121 // 122 // Deprecated: Please use `tags` instead. 123 TagsAll map[string]string `pulumi:"tagsAll"` 124 } 125 126 type EndpointState struct { 127 // The Amazon Resource Name (ARN) assigned by AWS to this endpoint. 128 Arn pulumi.StringPtrInput 129 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 130 DeploymentConfig EndpointDeploymentConfigPtrInput 131 // The name of the endpoint configuration to use. 132 EndpointConfigName pulumi.StringPtrInput 133 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 134 Name pulumi.StringPtrInput 135 // 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. 136 Tags pulumi.StringMapInput 137 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 138 // 139 // Deprecated: Please use `tags` instead. 140 TagsAll pulumi.StringMapInput 141 } 142 143 func (EndpointState) ElementType() reflect.Type { 144 return reflect.TypeOf((*endpointState)(nil)).Elem() 145 } 146 147 type endpointArgs struct { 148 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 149 DeploymentConfig *EndpointDeploymentConfig `pulumi:"deploymentConfig"` 150 // The name of the endpoint configuration to use. 151 EndpointConfigName string `pulumi:"endpointConfigName"` 152 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 153 Name *string `pulumi:"name"` 154 // 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. 155 Tags map[string]string `pulumi:"tags"` 156 } 157 158 // The set of arguments for constructing a Endpoint resource. 159 type EndpointArgs struct { 160 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 161 DeploymentConfig EndpointDeploymentConfigPtrInput 162 // The name of the endpoint configuration to use. 163 EndpointConfigName pulumi.StringInput 164 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 165 Name pulumi.StringPtrInput 166 // 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. 167 Tags pulumi.StringMapInput 168 } 169 170 func (EndpointArgs) ElementType() reflect.Type { 171 return reflect.TypeOf((*endpointArgs)(nil)).Elem() 172 } 173 174 type EndpointInput interface { 175 pulumi.Input 176 177 ToEndpointOutput() EndpointOutput 178 ToEndpointOutputWithContext(ctx context.Context) EndpointOutput 179 } 180 181 func (*Endpoint) ElementType() reflect.Type { 182 return reflect.TypeOf((**Endpoint)(nil)).Elem() 183 } 184 185 func (i *Endpoint) ToEndpointOutput() EndpointOutput { 186 return i.ToEndpointOutputWithContext(context.Background()) 187 } 188 189 func (i *Endpoint) ToEndpointOutputWithContext(ctx context.Context) EndpointOutput { 190 return pulumi.ToOutputWithContext(ctx, i).(EndpointOutput) 191 } 192 193 // EndpointArrayInput is an input type that accepts EndpointArray and EndpointArrayOutput values. 194 // You can construct a concrete instance of `EndpointArrayInput` via: 195 // 196 // EndpointArray{ EndpointArgs{...} } 197 type EndpointArrayInput interface { 198 pulumi.Input 199 200 ToEndpointArrayOutput() EndpointArrayOutput 201 ToEndpointArrayOutputWithContext(context.Context) EndpointArrayOutput 202 } 203 204 type EndpointArray []EndpointInput 205 206 func (EndpointArray) ElementType() reflect.Type { 207 return reflect.TypeOf((*[]*Endpoint)(nil)).Elem() 208 } 209 210 func (i EndpointArray) ToEndpointArrayOutput() EndpointArrayOutput { 211 return i.ToEndpointArrayOutputWithContext(context.Background()) 212 } 213 214 func (i EndpointArray) ToEndpointArrayOutputWithContext(ctx context.Context) EndpointArrayOutput { 215 return pulumi.ToOutputWithContext(ctx, i).(EndpointArrayOutput) 216 } 217 218 // EndpointMapInput is an input type that accepts EndpointMap and EndpointMapOutput values. 219 // You can construct a concrete instance of `EndpointMapInput` via: 220 // 221 // EndpointMap{ "key": EndpointArgs{...} } 222 type EndpointMapInput interface { 223 pulumi.Input 224 225 ToEndpointMapOutput() EndpointMapOutput 226 ToEndpointMapOutputWithContext(context.Context) EndpointMapOutput 227 } 228 229 type EndpointMap map[string]EndpointInput 230 231 func (EndpointMap) ElementType() reflect.Type { 232 return reflect.TypeOf((*map[string]*Endpoint)(nil)).Elem() 233 } 234 235 func (i EndpointMap) ToEndpointMapOutput() EndpointMapOutput { 236 return i.ToEndpointMapOutputWithContext(context.Background()) 237 } 238 239 func (i EndpointMap) ToEndpointMapOutputWithContext(ctx context.Context) EndpointMapOutput { 240 return pulumi.ToOutputWithContext(ctx, i).(EndpointMapOutput) 241 } 242 243 type EndpointOutput struct{ *pulumi.OutputState } 244 245 func (EndpointOutput) ElementType() reflect.Type { 246 return reflect.TypeOf((**Endpoint)(nil)).Elem() 247 } 248 249 func (o EndpointOutput) ToEndpointOutput() EndpointOutput { 250 return o 251 } 252 253 func (o EndpointOutput) ToEndpointOutputWithContext(ctx context.Context) EndpointOutput { 254 return o 255 } 256 257 // The Amazon Resource Name (ARN) assigned by AWS to this endpoint. 258 func (o EndpointOutput) Arn() pulumi.StringOutput { 259 return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 260 } 261 262 // The deployment configuration for an endpoint, which contains the desired deployment strategy and rollback configurations. See Deployment Config. 263 func (o EndpointOutput) DeploymentConfig() EndpointDeploymentConfigPtrOutput { 264 return o.ApplyT(func(v *Endpoint) EndpointDeploymentConfigPtrOutput { return v.DeploymentConfig }).(EndpointDeploymentConfigPtrOutput) 265 } 266 267 // The name of the endpoint configuration to use. 268 func (o EndpointOutput) EndpointConfigName() pulumi.StringOutput { 269 return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.EndpointConfigName }).(pulumi.StringOutput) 270 } 271 272 // The name of the endpoint. If omitted, the provider will assign a random, unique name. 273 func (o EndpointOutput) Name() pulumi.StringOutput { 274 return o.ApplyT(func(v *Endpoint) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 275 } 276 277 // 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. 278 func (o EndpointOutput) Tags() pulumi.StringMapOutput { 279 return o.ApplyT(func(v *Endpoint) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 280 } 281 282 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 283 // 284 // Deprecated: Please use `tags` instead. 285 func (o EndpointOutput) TagsAll() pulumi.StringMapOutput { 286 return o.ApplyT(func(v *Endpoint) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 287 } 288 289 type EndpointArrayOutput struct{ *pulumi.OutputState } 290 291 func (EndpointArrayOutput) ElementType() reflect.Type { 292 return reflect.TypeOf((*[]*Endpoint)(nil)).Elem() 293 } 294 295 func (o EndpointArrayOutput) ToEndpointArrayOutput() EndpointArrayOutput { 296 return o 297 } 298 299 func (o EndpointArrayOutput) ToEndpointArrayOutputWithContext(ctx context.Context) EndpointArrayOutput { 300 return o 301 } 302 303 func (o EndpointArrayOutput) Index(i pulumi.IntInput) EndpointOutput { 304 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Endpoint { 305 return vs[0].([]*Endpoint)[vs[1].(int)] 306 }).(EndpointOutput) 307 } 308 309 type EndpointMapOutput struct{ *pulumi.OutputState } 310 311 func (EndpointMapOutput) ElementType() reflect.Type { 312 return reflect.TypeOf((*map[string]*Endpoint)(nil)).Elem() 313 } 314 315 func (o EndpointMapOutput) ToEndpointMapOutput() EndpointMapOutput { 316 return o 317 } 318 319 func (o EndpointMapOutput) ToEndpointMapOutputWithContext(ctx context.Context) EndpointMapOutput { 320 return o 321 } 322 323 func (o EndpointMapOutput) MapIndex(k pulumi.StringInput) EndpointOutput { 324 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Endpoint { 325 return vs[0].(map[string]*Endpoint)[vs[1].(string)] 326 }).(EndpointOutput) 327 } 328 329 func init() { 330 pulumi.RegisterInputType(reflect.TypeOf((*EndpointInput)(nil)).Elem(), &Endpoint{}) 331 pulumi.RegisterInputType(reflect.TypeOf((*EndpointArrayInput)(nil)).Elem(), EndpointArray{}) 332 pulumi.RegisterInputType(reflect.TypeOf((*EndpointMapInput)(nil)).Elem(), EndpointMap{}) 333 pulumi.RegisterOutputType(EndpointOutput{}) 334 pulumi.RegisterOutputType(EndpointArrayOutput{}) 335 pulumi.RegisterOutputType(EndpointMapOutput{}) 336 }