/
studio.go
406 lines (360 loc) · 22 KB
/
studio.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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
// *** 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 emr
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an Elastic MapReduce Studio.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "fmt"
//
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/emr"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := emr.NewStudio(ctx, "example", &emr.StudioArgs{
// AuthMode: pulumi.String("SSO"),
// DefaultS3Location: pulumi.String(fmt.Sprintf("%v%v%v", "s3://", aws_s3_bucket.Test.Bucket, "/test")),
// EngineSecurityGroupId: pulumi.Any(aws_security_group.Test.Id),
// ServiceRole: pulumi.Any(aws_iam_role.Test.Arn),
// SubnetIds: pulumi.StringArray{
// pulumi.Any(aws_subnet.Test.Id),
// },
// UserRole: pulumi.Any(aws_iam_role.Test.Arn),
// VpcId: pulumi.Any(aws_vpc.Test.Id),
// WorkspaceSecurityGroupId: pulumi.Any(aws_security_group.Test.Id),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// EMR studios can be imported using the `id`, e.g.,
//
// ```sh
// $ pulumi import aws:emr/studio:Studio studio es-123456ABCDEF
// ```
type Studio struct {
pulumi.CustomResourceState
Arn pulumi.StringOutput `pulumi:"arn"`
// Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO. Valid values are `SSO` or `IAM`.
AuthMode pulumi.StringOutput `pulumi:"authMode"`
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
DefaultS3Location pulumi.StringOutput `pulumi:"defaultS3Location"`
// A detailed description of the Amazon EMR Studio.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by `vpcId`.
EngineSecurityGroupId pulumi.StringOutput `pulumi:"engineSecurityGroupId"`
// The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.
IdpAuthUrl pulumi.StringPtrOutput `pulumi:"idpAuthUrl"`
// The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.
IdpRelayStateParameterName pulumi.StringPtrOutput `pulumi:"idpRelayStateParameterName"`
// A descriptive name for the Amazon EMR Studio.
Name pulumi.StringOutput `pulumi:"name"`
// The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
ServiceRole pulumi.StringOutput `pulumi:"serviceRole"`
// A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by `vpcId`. Studio users can create a Workspace in any of the specified subnets.
SubnetIds pulumi.StringArrayOutput `pulumi:"subnetIds"`
// list of tags to apply to the EMR Cluster. 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"`
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// The unique access URL of the Amazon EMR Studio.
Url pulumi.StringOutput `pulumi:"url"`
// - The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a User Role when you use Amazon Web Services SSO authentication. The permissions attached to the User Role can be scoped down for each user or group using session policies.
UserRole pulumi.StringPtrOutput `pulumi:"userRole"`
// The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
// The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by `vpcId`.
WorkspaceSecurityGroupId pulumi.StringOutput `pulumi:"workspaceSecurityGroupId"`
}
// NewStudio registers a new resource with the given unique name, arguments, and options.
func NewStudio(ctx *pulumi.Context,
name string, args *StudioArgs, opts ...pulumi.ResourceOption) (*Studio, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.AuthMode == nil {
return nil, errors.New("invalid value for required argument 'AuthMode'")
}
if args.DefaultS3Location == nil {
return nil, errors.New("invalid value for required argument 'DefaultS3Location'")
}
if args.EngineSecurityGroupId == nil {
return nil, errors.New("invalid value for required argument 'EngineSecurityGroupId'")
}
if args.ServiceRole == nil {
return nil, errors.New("invalid value for required argument 'ServiceRole'")
}
if args.SubnetIds == nil {
return nil, errors.New("invalid value for required argument 'SubnetIds'")
}
if args.VpcId == nil {
return nil, errors.New("invalid value for required argument 'VpcId'")
}
if args.WorkspaceSecurityGroupId == nil {
return nil, errors.New("invalid value for required argument 'WorkspaceSecurityGroupId'")
}
var resource Studio
err := ctx.RegisterResource("aws:emr/studio:Studio", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetStudio gets an existing Studio 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 GetStudio(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *StudioState, opts ...pulumi.ResourceOption) (*Studio, error) {
var resource Studio
err := ctx.ReadResource("aws:emr/studio:Studio", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Studio resources.
type studioState struct {
Arn *string `pulumi:"arn"`
// Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO. Valid values are `SSO` or `IAM`.
AuthMode *string `pulumi:"authMode"`
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
DefaultS3Location *string `pulumi:"defaultS3Location"`
// A detailed description of the Amazon EMR Studio.
Description *string `pulumi:"description"`
// The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by `vpcId`.
EngineSecurityGroupId *string `pulumi:"engineSecurityGroupId"`
// The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.
IdpAuthUrl *string `pulumi:"idpAuthUrl"`
// The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.
IdpRelayStateParameterName *string `pulumi:"idpRelayStateParameterName"`
// A descriptive name for the Amazon EMR Studio.
Name *string `pulumi:"name"`
// The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
ServiceRole *string `pulumi:"serviceRole"`
// A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by `vpcId`. Studio users can create a Workspace in any of the specified subnets.
SubnetIds []string `pulumi:"subnetIds"`
// list of tags to apply to the EMR Cluster. 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"`
TagsAll map[string]string `pulumi:"tagsAll"`
// The unique access URL of the Amazon EMR Studio.
Url *string `pulumi:"url"`
// - The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a User Role when you use Amazon Web Services SSO authentication. The permissions attached to the User Role can be scoped down for each user or group using session policies.
UserRole *string `pulumi:"userRole"`
// The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
VpcId *string `pulumi:"vpcId"`
// The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by `vpcId`.
WorkspaceSecurityGroupId *string `pulumi:"workspaceSecurityGroupId"`
}
type StudioState struct {
Arn pulumi.StringPtrInput
// Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO. Valid values are `SSO` or `IAM`.
AuthMode pulumi.StringPtrInput
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
DefaultS3Location pulumi.StringPtrInput
// A detailed description of the Amazon EMR Studio.
Description pulumi.StringPtrInput
// The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by `vpcId`.
EngineSecurityGroupId pulumi.StringPtrInput
// The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.
IdpAuthUrl pulumi.StringPtrInput
// The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.
IdpRelayStateParameterName pulumi.StringPtrInput
// A descriptive name for the Amazon EMR Studio.
Name pulumi.StringPtrInput
// The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
ServiceRole pulumi.StringPtrInput
// A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by `vpcId`. Studio users can create a Workspace in any of the specified subnets.
SubnetIds pulumi.StringArrayInput
// list of tags to apply to the EMR Cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
TagsAll pulumi.StringMapInput
// The unique access URL of the Amazon EMR Studio.
Url pulumi.StringPtrInput
// - The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a User Role when you use Amazon Web Services SSO authentication. The permissions attached to the User Role can be scoped down for each user or group using session policies.
UserRole pulumi.StringPtrInput
// The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
VpcId pulumi.StringPtrInput
// The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by `vpcId`.
WorkspaceSecurityGroupId pulumi.StringPtrInput
}
func (StudioState) ElementType() reflect.Type {
return reflect.TypeOf((*studioState)(nil)).Elem()
}
type studioArgs struct {
// Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO. Valid values are `SSO` or `IAM`.
AuthMode string `pulumi:"authMode"`
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
DefaultS3Location string `pulumi:"defaultS3Location"`
// A detailed description of the Amazon EMR Studio.
Description *string `pulumi:"description"`
// The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by `vpcId`.
EngineSecurityGroupId string `pulumi:"engineSecurityGroupId"`
// The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.
IdpAuthUrl *string `pulumi:"idpAuthUrl"`
// The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.
IdpRelayStateParameterName *string `pulumi:"idpRelayStateParameterName"`
// A descriptive name for the Amazon EMR Studio.
Name *string `pulumi:"name"`
// The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
ServiceRole string `pulumi:"serviceRole"`
// A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by `vpcId`. Studio users can create a Workspace in any of the specified subnets.
SubnetIds []string `pulumi:"subnetIds"`
// list of tags to apply to the EMR Cluster. 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"`
TagsAll map[string]string `pulumi:"tagsAll"`
// - The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a User Role when you use Amazon Web Services SSO authentication. The permissions attached to the User Role can be scoped down for each user or group using session policies.
UserRole *string `pulumi:"userRole"`
// The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
VpcId string `pulumi:"vpcId"`
// The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by `vpcId`.
WorkspaceSecurityGroupId string `pulumi:"workspaceSecurityGroupId"`
}
// The set of arguments for constructing a Studio resource.
type StudioArgs struct {
// Specifies whether the Studio authenticates users using IAM or Amazon Web Services SSO. Valid values are `SSO` or `IAM`.
AuthMode pulumi.StringInput
// The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.
DefaultS3Location pulumi.StringInput
// A detailed description of the Amazon EMR Studio.
Description pulumi.StringPtrInput
// The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by `vpcId`.
EngineSecurityGroupId pulumi.StringInput
// The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.
IdpAuthUrl pulumi.StringPtrInput
// The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.
IdpRelayStateParameterName pulumi.StringPtrInput
// A descriptive name for the Amazon EMR Studio.
Name pulumi.StringPtrInput
// The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.
ServiceRole pulumi.StringInput
// A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by `vpcId`. Studio users can create a Workspace in any of the specified subnets.
SubnetIds pulumi.StringArrayInput
// list of tags to apply to the EMR Cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
TagsAll pulumi.StringMapInput
// - The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a User Role when you use Amazon Web Services SSO authentication. The permissions attached to the User Role can be scoped down for each user or group using session policies.
UserRole pulumi.StringPtrInput
// The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.
VpcId pulumi.StringInput
// The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by `vpcId`.
WorkspaceSecurityGroupId pulumi.StringInput
}
func (StudioArgs) ElementType() reflect.Type {
return reflect.TypeOf((*studioArgs)(nil)).Elem()
}
type StudioInput interface {
pulumi.Input
ToStudioOutput() StudioOutput
ToStudioOutputWithContext(ctx context.Context) StudioOutput
}
func (*Studio) ElementType() reflect.Type {
return reflect.TypeOf((**Studio)(nil)).Elem()
}
func (i *Studio) ToStudioOutput() StudioOutput {
return i.ToStudioOutputWithContext(context.Background())
}
func (i *Studio) ToStudioOutputWithContext(ctx context.Context) StudioOutput {
return pulumi.ToOutputWithContext(ctx, i).(StudioOutput)
}
// StudioArrayInput is an input type that accepts StudioArray and StudioArrayOutput values.
// You can construct a concrete instance of `StudioArrayInput` via:
//
// StudioArray{ StudioArgs{...} }
type StudioArrayInput interface {
pulumi.Input
ToStudioArrayOutput() StudioArrayOutput
ToStudioArrayOutputWithContext(context.Context) StudioArrayOutput
}
type StudioArray []StudioInput
func (StudioArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Studio)(nil)).Elem()
}
func (i StudioArray) ToStudioArrayOutput() StudioArrayOutput {
return i.ToStudioArrayOutputWithContext(context.Background())
}
func (i StudioArray) ToStudioArrayOutputWithContext(ctx context.Context) StudioArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(StudioArrayOutput)
}
// StudioMapInput is an input type that accepts StudioMap and StudioMapOutput values.
// You can construct a concrete instance of `StudioMapInput` via:
//
// StudioMap{ "key": StudioArgs{...} }
type StudioMapInput interface {
pulumi.Input
ToStudioMapOutput() StudioMapOutput
ToStudioMapOutputWithContext(context.Context) StudioMapOutput
}
type StudioMap map[string]StudioInput
func (StudioMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Studio)(nil)).Elem()
}
func (i StudioMap) ToStudioMapOutput() StudioMapOutput {
return i.ToStudioMapOutputWithContext(context.Background())
}
func (i StudioMap) ToStudioMapOutputWithContext(ctx context.Context) StudioMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(StudioMapOutput)
}
type StudioOutput struct{ *pulumi.OutputState }
func (StudioOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Studio)(nil)).Elem()
}
func (o StudioOutput) ToStudioOutput() StudioOutput {
return o
}
func (o StudioOutput) ToStudioOutputWithContext(ctx context.Context) StudioOutput {
return o
}
type StudioArrayOutput struct{ *pulumi.OutputState }
func (StudioArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Studio)(nil)).Elem()
}
func (o StudioArrayOutput) ToStudioArrayOutput() StudioArrayOutput {
return o
}
func (o StudioArrayOutput) ToStudioArrayOutputWithContext(ctx context.Context) StudioArrayOutput {
return o
}
func (o StudioArrayOutput) Index(i pulumi.IntInput) StudioOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Studio {
return vs[0].([]*Studio)[vs[1].(int)]
}).(StudioOutput)
}
type StudioMapOutput struct{ *pulumi.OutputState }
func (StudioMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Studio)(nil)).Elem()
}
func (o StudioMapOutput) ToStudioMapOutput() StudioMapOutput {
return o
}
func (o StudioMapOutput) ToStudioMapOutputWithContext(ctx context.Context) StudioMapOutput {
return o
}
func (o StudioMapOutput) MapIndex(k pulumi.StringInput) StudioOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Studio {
return vs[0].(map[string]*Studio)[vs[1].(string)]
}).(StudioOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*StudioInput)(nil)).Elem(), &Studio{})
pulumi.RegisterInputType(reflect.TypeOf((*StudioArrayInput)(nil)).Elem(), StudioArray{})
pulumi.RegisterInputType(reflect.TypeOf((*StudioMapInput)(nil)).Elem(), StudioMap{})
pulumi.RegisterOutputType(StudioOutput{})
pulumi.RegisterOutputType(StudioArrayOutput{})
pulumi.RegisterOutputType(StudioMapOutput{})
}