github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/sagemaker/project.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 Project resource. 16 // 17 // > Note: If you are trying to use SageMaker projects with SageMaker studio you will need to add a tag with the key `sagemaker:studio-visibility` with value `true`. For more on requirements to use projects and permission needed see [AWS Docs](https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-templates-custom.html). 18 // 19 // ## Example 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.NewProject(ctx, "example", &sagemaker.ProjectArgs{ 35 // ProjectName: pulumi.String("example"), 36 // ServiceCatalogProvisioningDetails: &sagemaker.ProjectServiceCatalogProvisioningDetailsArgs{ 37 // ProductId: pulumi.Any(exampleAwsServicecatalogProduct.Id), 38 // }, 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 Projects using the `project_name`. For example: 53 // 54 // ```sh 55 // $ pulumi import aws:sagemaker/project:Project example example 56 // ``` 57 type Project struct { 58 pulumi.CustomResourceState 59 60 // The Amazon Resource Name (ARN) assigned by AWS to this Project. 61 Arn pulumi.StringOutput `pulumi:"arn"` 62 // A description for the project. 63 ProjectDescription pulumi.StringPtrOutput `pulumi:"projectDescription"` 64 // The ID of the project. 65 ProjectId pulumi.StringOutput `pulumi:"projectId"` 66 // The name of the Project. 67 ProjectName pulumi.StringOutput `pulumi:"projectName"` 68 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 69 ServiceCatalogProvisioningDetails ProjectServiceCatalogProvisioningDetailsOutput `pulumi:"serviceCatalogProvisioningDetails"` 70 // 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. 71 Tags pulumi.StringMapOutput `pulumi:"tags"` 72 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 73 // 74 // Deprecated: Please use `tags` instead. 75 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 76 } 77 78 // NewProject registers a new resource with the given unique name, arguments, and options. 79 func NewProject(ctx *pulumi.Context, 80 name string, args *ProjectArgs, opts ...pulumi.ResourceOption) (*Project, error) { 81 if args == nil { 82 return nil, errors.New("missing one or more required arguments") 83 } 84 85 if args.ProjectName == nil { 86 return nil, errors.New("invalid value for required argument 'ProjectName'") 87 } 88 if args.ServiceCatalogProvisioningDetails == nil { 89 return nil, errors.New("invalid value for required argument 'ServiceCatalogProvisioningDetails'") 90 } 91 opts = internal.PkgResourceDefaultOpts(opts) 92 var resource Project 93 err := ctx.RegisterResource("aws:sagemaker/project:Project", name, args, &resource, opts...) 94 if err != nil { 95 return nil, err 96 } 97 return &resource, nil 98 } 99 100 // GetProject gets an existing Project resource's state with the given name, ID, and optional 101 // state properties that are used to uniquely qualify the lookup (nil if not required). 102 func GetProject(ctx *pulumi.Context, 103 name string, id pulumi.IDInput, state *ProjectState, opts ...pulumi.ResourceOption) (*Project, error) { 104 var resource Project 105 err := ctx.ReadResource("aws:sagemaker/project:Project", name, id, state, &resource, opts...) 106 if err != nil { 107 return nil, err 108 } 109 return &resource, nil 110 } 111 112 // Input properties used for looking up and filtering Project resources. 113 type projectState struct { 114 // The Amazon Resource Name (ARN) assigned by AWS to this Project. 115 Arn *string `pulumi:"arn"` 116 // A description for the project. 117 ProjectDescription *string `pulumi:"projectDescription"` 118 // The ID of the project. 119 ProjectId *string `pulumi:"projectId"` 120 // The name of the Project. 121 ProjectName *string `pulumi:"projectName"` 122 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 123 ServiceCatalogProvisioningDetails *ProjectServiceCatalogProvisioningDetails `pulumi:"serviceCatalogProvisioningDetails"` 124 // 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. 125 Tags map[string]string `pulumi:"tags"` 126 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 127 // 128 // Deprecated: Please use `tags` instead. 129 TagsAll map[string]string `pulumi:"tagsAll"` 130 } 131 132 type ProjectState struct { 133 // The Amazon Resource Name (ARN) assigned by AWS to this Project. 134 Arn pulumi.StringPtrInput 135 // A description for the project. 136 ProjectDescription pulumi.StringPtrInput 137 // The ID of the project. 138 ProjectId pulumi.StringPtrInput 139 // The name of the Project. 140 ProjectName pulumi.StringPtrInput 141 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 142 ServiceCatalogProvisioningDetails ProjectServiceCatalogProvisioningDetailsPtrInput 143 // 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. 144 Tags pulumi.StringMapInput 145 // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 146 // 147 // Deprecated: Please use `tags` instead. 148 TagsAll pulumi.StringMapInput 149 } 150 151 func (ProjectState) ElementType() reflect.Type { 152 return reflect.TypeOf((*projectState)(nil)).Elem() 153 } 154 155 type projectArgs struct { 156 // A description for the project. 157 ProjectDescription *string `pulumi:"projectDescription"` 158 // The name of the Project. 159 ProjectName string `pulumi:"projectName"` 160 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 161 ServiceCatalogProvisioningDetails ProjectServiceCatalogProvisioningDetails `pulumi:"serviceCatalogProvisioningDetails"` 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 Project resource. 167 type ProjectArgs struct { 168 // A description for the project. 169 ProjectDescription pulumi.StringPtrInput 170 // The name of the Project. 171 ProjectName pulumi.StringInput 172 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 173 ServiceCatalogProvisioningDetails ProjectServiceCatalogProvisioningDetailsInput 174 // 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. 175 Tags pulumi.StringMapInput 176 } 177 178 func (ProjectArgs) ElementType() reflect.Type { 179 return reflect.TypeOf((*projectArgs)(nil)).Elem() 180 } 181 182 type ProjectInput interface { 183 pulumi.Input 184 185 ToProjectOutput() ProjectOutput 186 ToProjectOutputWithContext(ctx context.Context) ProjectOutput 187 } 188 189 func (*Project) ElementType() reflect.Type { 190 return reflect.TypeOf((**Project)(nil)).Elem() 191 } 192 193 func (i *Project) ToProjectOutput() ProjectOutput { 194 return i.ToProjectOutputWithContext(context.Background()) 195 } 196 197 func (i *Project) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 198 return pulumi.ToOutputWithContext(ctx, i).(ProjectOutput) 199 } 200 201 // ProjectArrayInput is an input type that accepts ProjectArray and ProjectArrayOutput values. 202 // You can construct a concrete instance of `ProjectArrayInput` via: 203 // 204 // ProjectArray{ ProjectArgs{...} } 205 type ProjectArrayInput interface { 206 pulumi.Input 207 208 ToProjectArrayOutput() ProjectArrayOutput 209 ToProjectArrayOutputWithContext(context.Context) ProjectArrayOutput 210 } 211 212 type ProjectArray []ProjectInput 213 214 func (ProjectArray) ElementType() reflect.Type { 215 return reflect.TypeOf((*[]*Project)(nil)).Elem() 216 } 217 218 func (i ProjectArray) ToProjectArrayOutput() ProjectArrayOutput { 219 return i.ToProjectArrayOutputWithContext(context.Background()) 220 } 221 222 func (i ProjectArray) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 223 return pulumi.ToOutputWithContext(ctx, i).(ProjectArrayOutput) 224 } 225 226 // ProjectMapInput is an input type that accepts ProjectMap and ProjectMapOutput values. 227 // You can construct a concrete instance of `ProjectMapInput` via: 228 // 229 // ProjectMap{ "key": ProjectArgs{...} } 230 type ProjectMapInput interface { 231 pulumi.Input 232 233 ToProjectMapOutput() ProjectMapOutput 234 ToProjectMapOutputWithContext(context.Context) ProjectMapOutput 235 } 236 237 type ProjectMap map[string]ProjectInput 238 239 func (ProjectMap) ElementType() reflect.Type { 240 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 241 } 242 243 func (i ProjectMap) ToProjectMapOutput() ProjectMapOutput { 244 return i.ToProjectMapOutputWithContext(context.Background()) 245 } 246 247 func (i ProjectMap) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 248 return pulumi.ToOutputWithContext(ctx, i).(ProjectMapOutput) 249 } 250 251 type ProjectOutput struct{ *pulumi.OutputState } 252 253 func (ProjectOutput) ElementType() reflect.Type { 254 return reflect.TypeOf((**Project)(nil)).Elem() 255 } 256 257 func (o ProjectOutput) ToProjectOutput() ProjectOutput { 258 return o 259 } 260 261 func (o ProjectOutput) ToProjectOutputWithContext(ctx context.Context) ProjectOutput { 262 return o 263 } 264 265 // The Amazon Resource Name (ARN) assigned by AWS to this Project. 266 func (o ProjectOutput) Arn() pulumi.StringOutput { 267 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 268 } 269 270 // A description for the project. 271 func (o ProjectOutput) ProjectDescription() pulumi.StringPtrOutput { 272 return o.ApplyT(func(v *Project) pulumi.StringPtrOutput { return v.ProjectDescription }).(pulumi.StringPtrOutput) 273 } 274 275 // The ID of the project. 276 func (o ProjectOutput) ProjectId() pulumi.StringOutput { 277 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput) 278 } 279 280 // The name of the Project. 281 func (o ProjectOutput) ProjectName() pulumi.StringOutput { 282 return o.ApplyT(func(v *Project) pulumi.StringOutput { return v.ProjectName }).(pulumi.StringOutput) 283 } 284 285 // The product ID and provisioning artifact ID to provision a service catalog. See Service Catalog Provisioning Details below. 286 func (o ProjectOutput) ServiceCatalogProvisioningDetails() ProjectServiceCatalogProvisioningDetailsOutput { 287 return o.ApplyT(func(v *Project) ProjectServiceCatalogProvisioningDetailsOutput { 288 return v.ServiceCatalogProvisioningDetails 289 }).(ProjectServiceCatalogProvisioningDetailsOutput) 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 ProjectOutput) Tags() pulumi.StringMapOutput { 294 return o.ApplyT(func(v *Project) 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 ProjectOutput) TagsAll() pulumi.StringMapOutput { 301 return o.ApplyT(func(v *Project) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 302 } 303 304 type ProjectArrayOutput struct{ *pulumi.OutputState } 305 306 func (ProjectArrayOutput) ElementType() reflect.Type { 307 return reflect.TypeOf((*[]*Project)(nil)).Elem() 308 } 309 310 func (o ProjectArrayOutput) ToProjectArrayOutput() ProjectArrayOutput { 311 return o 312 } 313 314 func (o ProjectArrayOutput) ToProjectArrayOutputWithContext(ctx context.Context) ProjectArrayOutput { 315 return o 316 } 317 318 func (o ProjectArrayOutput) Index(i pulumi.IntInput) ProjectOutput { 319 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Project { 320 return vs[0].([]*Project)[vs[1].(int)] 321 }).(ProjectOutput) 322 } 323 324 type ProjectMapOutput struct{ *pulumi.OutputState } 325 326 func (ProjectMapOutput) ElementType() reflect.Type { 327 return reflect.TypeOf((*map[string]*Project)(nil)).Elem() 328 } 329 330 func (o ProjectMapOutput) ToProjectMapOutput() ProjectMapOutput { 331 return o 332 } 333 334 func (o ProjectMapOutput) ToProjectMapOutputWithContext(ctx context.Context) ProjectMapOutput { 335 return o 336 } 337 338 func (o ProjectMapOutput) MapIndex(k pulumi.StringInput) ProjectOutput { 339 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Project { 340 return vs[0].(map[string]*Project)[vs[1].(string)] 341 }).(ProjectOutput) 342 } 343 344 func init() { 345 pulumi.RegisterInputType(reflect.TypeOf((*ProjectInput)(nil)).Elem(), &Project{}) 346 pulumi.RegisterInputType(reflect.TypeOf((*ProjectArrayInput)(nil)).Elem(), ProjectArray{}) 347 pulumi.RegisterInputType(reflect.TypeOf((*ProjectMapInput)(nil)).Elem(), ProjectMap{}) 348 pulumi.RegisterOutputType(ProjectOutput{}) 349 pulumi.RegisterOutputType(ProjectArrayOutput{}) 350 pulumi.RegisterOutputType(ProjectMapOutput{}) 351 }