/
userProfile.go
316 lines (270 loc) · 13.8 KB
/
userProfile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package sagemaker
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Sagemaker User Profile resource.
//
// ## Example Usage
// ### Basic usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/sagemaker"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := sagemaker.NewUserProfile(ctx, "example", &sagemaker.UserProfileArgs{
// DomainId: pulumi.Any(aws_sagemaker_domain.Test.Id),
// UserProfileName: pulumi.String("example"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Sagemaker Code User Profiles can be imported using the `arn`, e.g.,
//
// ```sh
// $ pulumi import aws:sagemaker/userProfile:UserProfile test_user_profile arn:aws:sagemaker:us-west-2:123456789012:user-profile/domain-id/profile-name
// ```
type UserProfile struct {
pulumi.CustomResourceState
// The user profile Amazon Resource Name (ARN).
Arn pulumi.StringOutput `pulumi:"arn"`
// The ID of the associated Domain.
DomainId pulumi.StringOutput `pulumi:"domainId"`
// The ID of the user's profile in the Amazon Elastic File System (EFS) volume.
HomeEfsFileSystemUid pulumi.StringOutput `pulumi:"homeEfsFileSystemUid"`
// A specifier for the type of value specified in `singleSignOnUserValue`. Currently, the only supported value is `UserName`. If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserIdentifier pulumi.StringPtrOutput `pulumi:"singleSignOnUserIdentifier"`
// The username of the associated AWS Single Sign-On User for this User Profile. If the Domain's AuthMode is SSO, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserValue pulumi.StringPtrOutput `pulumi:"singleSignOnUserValue"`
// 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.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The name for the User Profile.
UserProfileName pulumi.StringOutput `pulumi:"userProfileName"`
// The user settings. See User Settings below.
UserSettings UserProfileUserSettingsPtrOutput `pulumi:"userSettings"`
}
// NewUserProfile registers a new resource with the given unique name, arguments, and options.
func NewUserProfile(ctx *pulumi.Context,
name string, args *UserProfileArgs, opts ...pulumi.ResourceOption) (*UserProfile, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DomainId == nil {
return nil, errors.New("invalid value for required argument 'DomainId'")
}
if args.UserProfileName == nil {
return nil, errors.New("invalid value for required argument 'UserProfileName'")
}
var resource UserProfile
err := ctx.RegisterResource("aws:sagemaker/userProfile:UserProfile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetUserProfile gets an existing UserProfile resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetUserProfile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *UserProfileState, opts ...pulumi.ResourceOption) (*UserProfile, error) {
var resource UserProfile
err := ctx.ReadResource("aws:sagemaker/userProfile:UserProfile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering UserProfile resources.
type userProfileState struct {
// The user profile Amazon Resource Name (ARN).
Arn *string `pulumi:"arn"`
// The ID of the associated Domain.
DomainId *string `pulumi:"domainId"`
// The ID of the user's profile in the Amazon Elastic File System (EFS) volume.
HomeEfsFileSystemUid *string `pulumi:"homeEfsFileSystemUid"`
// A specifier for the type of value specified in `singleSignOnUserValue`. Currently, the only supported value is `UserName`. If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserIdentifier *string `pulumi:"singleSignOnUserIdentifier"`
// The username of the associated AWS Single Sign-On User for this User Profile. If the Domain's AuthMode is SSO, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserValue *string `pulumi:"singleSignOnUserValue"`
// 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.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll map[string]string `pulumi:"tagsAll"`
// The name for the User Profile.
UserProfileName *string `pulumi:"userProfileName"`
// The user settings. See User Settings below.
UserSettings *UserProfileUserSettings `pulumi:"userSettings"`
}
type UserProfileState struct {
// The user profile Amazon Resource Name (ARN).
Arn pulumi.StringPtrInput
// The ID of the associated Domain.
DomainId pulumi.StringPtrInput
// The ID of the user's profile in the Amazon Elastic File System (EFS) volume.
HomeEfsFileSystemUid pulumi.StringPtrInput
// A specifier for the type of value specified in `singleSignOnUserValue`. Currently, the only supported value is `UserName`. If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserIdentifier pulumi.StringPtrInput
// The username of the associated AWS Single Sign-On User for this User Profile. If the Domain's AuthMode is SSO, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserValue pulumi.StringPtrInput
// 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.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider .
TagsAll pulumi.StringMapInput
// The name for the User Profile.
UserProfileName pulumi.StringPtrInput
// The user settings. See User Settings below.
UserSettings UserProfileUserSettingsPtrInput
}
func (UserProfileState) ElementType() reflect.Type {
return reflect.TypeOf((*userProfileState)(nil)).Elem()
}
type userProfileArgs struct {
// The ID of the associated Domain.
DomainId string `pulumi:"domainId"`
// A specifier for the type of value specified in `singleSignOnUserValue`. Currently, the only supported value is `UserName`. If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserIdentifier *string `pulumi:"singleSignOnUserIdentifier"`
// The username of the associated AWS Single Sign-On User for this User Profile. If the Domain's AuthMode is SSO, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserValue *string `pulumi:"singleSignOnUserValue"`
// 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.
Tags map[string]string `pulumi:"tags"`
// The name for the User Profile.
UserProfileName string `pulumi:"userProfileName"`
// The user settings. See User Settings below.
UserSettings *UserProfileUserSettings `pulumi:"userSettings"`
}
// The set of arguments for constructing a UserProfile resource.
type UserProfileArgs struct {
// The ID of the associated Domain.
DomainId pulumi.StringInput
// A specifier for the type of value specified in `singleSignOnUserValue`. Currently, the only supported value is `UserName`. If the Domain's AuthMode is SSO, this field is required. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserIdentifier pulumi.StringPtrInput
// The username of the associated AWS Single Sign-On User for this User Profile. If the Domain's AuthMode is SSO, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not SSO, this field cannot be specified.
SingleSignOnUserValue pulumi.StringPtrInput
// 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.
Tags pulumi.StringMapInput
// The name for the User Profile.
UserProfileName pulumi.StringInput
// The user settings. See User Settings below.
UserSettings UserProfileUserSettingsPtrInput
}
func (UserProfileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*userProfileArgs)(nil)).Elem()
}
type UserProfileInput interface {
pulumi.Input
ToUserProfileOutput() UserProfileOutput
ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput
}
func (*UserProfile) ElementType() reflect.Type {
return reflect.TypeOf((**UserProfile)(nil)).Elem()
}
func (i *UserProfile) ToUserProfileOutput() UserProfileOutput {
return i.ToUserProfileOutputWithContext(context.Background())
}
func (i *UserProfile) ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserProfileOutput)
}
// UserProfileArrayInput is an input type that accepts UserProfileArray and UserProfileArrayOutput values.
// You can construct a concrete instance of `UserProfileArrayInput` via:
//
// UserProfileArray{ UserProfileArgs{...} }
type UserProfileArrayInput interface {
pulumi.Input
ToUserProfileArrayOutput() UserProfileArrayOutput
ToUserProfileArrayOutputWithContext(context.Context) UserProfileArrayOutput
}
type UserProfileArray []UserProfileInput
func (UserProfileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserProfile)(nil)).Elem()
}
func (i UserProfileArray) ToUserProfileArrayOutput() UserProfileArrayOutput {
return i.ToUserProfileArrayOutputWithContext(context.Background())
}
func (i UserProfileArray) ToUserProfileArrayOutputWithContext(ctx context.Context) UserProfileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserProfileArrayOutput)
}
// UserProfileMapInput is an input type that accepts UserProfileMap and UserProfileMapOutput values.
// You can construct a concrete instance of `UserProfileMapInput` via:
//
// UserProfileMap{ "key": UserProfileArgs{...} }
type UserProfileMapInput interface {
pulumi.Input
ToUserProfileMapOutput() UserProfileMapOutput
ToUserProfileMapOutputWithContext(context.Context) UserProfileMapOutput
}
type UserProfileMap map[string]UserProfileInput
func (UserProfileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserProfile)(nil)).Elem()
}
func (i UserProfileMap) ToUserProfileMapOutput() UserProfileMapOutput {
return i.ToUserProfileMapOutputWithContext(context.Background())
}
func (i UserProfileMap) ToUserProfileMapOutputWithContext(ctx context.Context) UserProfileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(UserProfileMapOutput)
}
type UserProfileOutput struct{ *pulumi.OutputState }
func (UserProfileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**UserProfile)(nil)).Elem()
}
func (o UserProfileOutput) ToUserProfileOutput() UserProfileOutput {
return o
}
func (o UserProfileOutput) ToUserProfileOutputWithContext(ctx context.Context) UserProfileOutput {
return o
}
type UserProfileArrayOutput struct{ *pulumi.OutputState }
func (UserProfileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*UserProfile)(nil)).Elem()
}
func (o UserProfileArrayOutput) ToUserProfileArrayOutput() UserProfileArrayOutput {
return o
}
func (o UserProfileArrayOutput) ToUserProfileArrayOutputWithContext(ctx context.Context) UserProfileArrayOutput {
return o
}
func (o UserProfileArrayOutput) Index(i pulumi.IntInput) UserProfileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *UserProfile {
return vs[0].([]*UserProfile)[vs[1].(int)]
}).(UserProfileOutput)
}
type UserProfileMapOutput struct{ *pulumi.OutputState }
func (UserProfileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*UserProfile)(nil)).Elem()
}
func (o UserProfileMapOutput) ToUserProfileMapOutput() UserProfileMapOutput {
return o
}
func (o UserProfileMapOutput) ToUserProfileMapOutputWithContext(ctx context.Context) UserProfileMapOutput {
return o
}
func (o UserProfileMapOutput) MapIndex(k pulumi.StringInput) UserProfileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *UserProfile {
return vs[0].(map[string]*UserProfile)[vs[1].(string)]
}).(UserProfileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*UserProfileInput)(nil)).Elem(), &UserProfile{})
pulumi.RegisterInputType(reflect.TypeOf((*UserProfileArrayInput)(nil)).Elem(), UserProfileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*UserProfileMapInput)(nil)).Elem(), UserProfileMap{})
pulumi.RegisterOutputType(UserProfileOutput{})
pulumi.RegisterOutputType(UserProfileArrayOutput{})
pulumi.RegisterOutputType(UserProfileMapOutput{})
}