generated from pulumi/pulumi-tf-provider-boilerplate
/
groupInstanceProfile.go
296 lines (248 loc) · 11.3 KB
/
groupInstanceProfile.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package databricks
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-databricks/sdk/go/databricks/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// > **Deprecated** Please migrate to databricks_group_role.
//
// This resource allows you to attach InstanceProfile (AWS) to databricks_group.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-databricks/sdk/go/databricks"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// instanceProfile, err := databricks.NewInstanceProfile(ctx, "instance_profile", &databricks.InstanceProfileArgs{
// InstanceProfileArn: pulumi.String("my_instance_profile_arn"),
// })
// if err != nil {
// return err
// }
// myGroup, err := databricks.NewGroup(ctx, "my_group", &databricks.GroupArgs{
// DisplayName: pulumi.String("my_group_name"),
// })
// if err != nil {
// return err
// }
// _, err = databricks.NewGroupInstanceProfile(ctx, "my_group_instance_profile", &databricks.GroupInstanceProfileArgs{
// GroupId: myGroup.ID(),
// InstanceProfileId: instanceProfile.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Related Resources
//
// The following resources are often used in the same context:
//
// * End to end workspace management guide.
// * getAwsBucketPolicy data to configure a simple access policy for AWS S3 buckets, so that Databricks can access data in it.
// * ClusterPolicy to create a Cluster policy, which limits the ability to create clusters based on a set of rules.
// * Group to manage [groups in Databricks Workspace](https://docs.databricks.com/administration-guide/users-groups/groups.html) or [Account Console](https://accounts.cloud.databricks.com/) (for AWS deployments).
// * Group data to retrieve information about Group members, entitlements and instance profiles.
// * GroupMember to attach users and groups as group members.
// * InstancePool to manage [instance pools](https://docs.databricks.com/clusters/instance-pools/index.html) to reduce cluster start and auto-scaling times by maintaining a set of idle, ready-to-use instances.
// * InstanceProfile to manage AWS EC2 instance profiles that users can launch Cluster and access data, like databricks_mount.
// * UserInstanceProfile to attach InstanceProfile (AWS) to databricks_user.
//
// ## Import
//
// -> **Note** Importing this resource is not currently supported.
type GroupInstanceProfile struct {
pulumi.CustomResourceState
// This is the id of the group resource.
GroupId pulumi.StringOutput `pulumi:"groupId"`
// This is the id of the instance profile resource.
InstanceProfileId pulumi.StringOutput `pulumi:"instanceProfileId"`
}
// NewGroupInstanceProfile registers a new resource with the given unique name, arguments, and options.
func NewGroupInstanceProfile(ctx *pulumi.Context,
name string, args *GroupInstanceProfileArgs, opts ...pulumi.ResourceOption) (*GroupInstanceProfile, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.GroupId == nil {
return nil, errors.New("invalid value for required argument 'GroupId'")
}
if args.InstanceProfileId == nil {
return nil, errors.New("invalid value for required argument 'InstanceProfileId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource GroupInstanceProfile
err := ctx.RegisterResource("databricks:index/groupInstanceProfile:GroupInstanceProfile", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetGroupInstanceProfile gets an existing GroupInstanceProfile 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 GetGroupInstanceProfile(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *GroupInstanceProfileState, opts ...pulumi.ResourceOption) (*GroupInstanceProfile, error) {
var resource GroupInstanceProfile
err := ctx.ReadResource("databricks:index/groupInstanceProfile:GroupInstanceProfile", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering GroupInstanceProfile resources.
type groupInstanceProfileState struct {
// This is the id of the group resource.
GroupId *string `pulumi:"groupId"`
// This is the id of the instance profile resource.
InstanceProfileId *string `pulumi:"instanceProfileId"`
}
type GroupInstanceProfileState struct {
// This is the id of the group resource.
GroupId pulumi.StringPtrInput
// This is the id of the instance profile resource.
InstanceProfileId pulumi.StringPtrInput
}
func (GroupInstanceProfileState) ElementType() reflect.Type {
return reflect.TypeOf((*groupInstanceProfileState)(nil)).Elem()
}
type groupInstanceProfileArgs struct {
// This is the id of the group resource.
GroupId string `pulumi:"groupId"`
// This is the id of the instance profile resource.
InstanceProfileId string `pulumi:"instanceProfileId"`
}
// The set of arguments for constructing a GroupInstanceProfile resource.
type GroupInstanceProfileArgs struct {
// This is the id of the group resource.
GroupId pulumi.StringInput
// This is the id of the instance profile resource.
InstanceProfileId pulumi.StringInput
}
func (GroupInstanceProfileArgs) ElementType() reflect.Type {
return reflect.TypeOf((*groupInstanceProfileArgs)(nil)).Elem()
}
type GroupInstanceProfileInput interface {
pulumi.Input
ToGroupInstanceProfileOutput() GroupInstanceProfileOutput
ToGroupInstanceProfileOutputWithContext(ctx context.Context) GroupInstanceProfileOutput
}
func (*GroupInstanceProfile) ElementType() reflect.Type {
return reflect.TypeOf((**GroupInstanceProfile)(nil)).Elem()
}
func (i *GroupInstanceProfile) ToGroupInstanceProfileOutput() GroupInstanceProfileOutput {
return i.ToGroupInstanceProfileOutputWithContext(context.Background())
}
func (i *GroupInstanceProfile) ToGroupInstanceProfileOutputWithContext(ctx context.Context) GroupInstanceProfileOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupInstanceProfileOutput)
}
// GroupInstanceProfileArrayInput is an input type that accepts GroupInstanceProfileArray and GroupInstanceProfileArrayOutput values.
// You can construct a concrete instance of `GroupInstanceProfileArrayInput` via:
//
// GroupInstanceProfileArray{ GroupInstanceProfileArgs{...} }
type GroupInstanceProfileArrayInput interface {
pulumi.Input
ToGroupInstanceProfileArrayOutput() GroupInstanceProfileArrayOutput
ToGroupInstanceProfileArrayOutputWithContext(context.Context) GroupInstanceProfileArrayOutput
}
type GroupInstanceProfileArray []GroupInstanceProfileInput
func (GroupInstanceProfileArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupInstanceProfile)(nil)).Elem()
}
func (i GroupInstanceProfileArray) ToGroupInstanceProfileArrayOutput() GroupInstanceProfileArrayOutput {
return i.ToGroupInstanceProfileArrayOutputWithContext(context.Background())
}
func (i GroupInstanceProfileArray) ToGroupInstanceProfileArrayOutputWithContext(ctx context.Context) GroupInstanceProfileArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupInstanceProfileArrayOutput)
}
// GroupInstanceProfileMapInput is an input type that accepts GroupInstanceProfileMap and GroupInstanceProfileMapOutput values.
// You can construct a concrete instance of `GroupInstanceProfileMapInput` via:
//
// GroupInstanceProfileMap{ "key": GroupInstanceProfileArgs{...} }
type GroupInstanceProfileMapInput interface {
pulumi.Input
ToGroupInstanceProfileMapOutput() GroupInstanceProfileMapOutput
ToGroupInstanceProfileMapOutputWithContext(context.Context) GroupInstanceProfileMapOutput
}
type GroupInstanceProfileMap map[string]GroupInstanceProfileInput
func (GroupInstanceProfileMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupInstanceProfile)(nil)).Elem()
}
func (i GroupInstanceProfileMap) ToGroupInstanceProfileMapOutput() GroupInstanceProfileMapOutput {
return i.ToGroupInstanceProfileMapOutputWithContext(context.Background())
}
func (i GroupInstanceProfileMap) ToGroupInstanceProfileMapOutputWithContext(ctx context.Context) GroupInstanceProfileMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(GroupInstanceProfileMapOutput)
}
type GroupInstanceProfileOutput struct{ *pulumi.OutputState }
func (GroupInstanceProfileOutput) ElementType() reflect.Type {
return reflect.TypeOf((**GroupInstanceProfile)(nil)).Elem()
}
func (o GroupInstanceProfileOutput) ToGroupInstanceProfileOutput() GroupInstanceProfileOutput {
return o
}
func (o GroupInstanceProfileOutput) ToGroupInstanceProfileOutputWithContext(ctx context.Context) GroupInstanceProfileOutput {
return o
}
// This is the id of the group resource.
func (o GroupInstanceProfileOutput) GroupId() pulumi.StringOutput {
return o.ApplyT(func(v *GroupInstanceProfile) pulumi.StringOutput { return v.GroupId }).(pulumi.StringOutput)
}
// This is the id of the instance profile resource.
func (o GroupInstanceProfileOutput) InstanceProfileId() pulumi.StringOutput {
return o.ApplyT(func(v *GroupInstanceProfile) pulumi.StringOutput { return v.InstanceProfileId }).(pulumi.StringOutput)
}
type GroupInstanceProfileArrayOutput struct{ *pulumi.OutputState }
func (GroupInstanceProfileArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*GroupInstanceProfile)(nil)).Elem()
}
func (o GroupInstanceProfileArrayOutput) ToGroupInstanceProfileArrayOutput() GroupInstanceProfileArrayOutput {
return o
}
func (o GroupInstanceProfileArrayOutput) ToGroupInstanceProfileArrayOutputWithContext(ctx context.Context) GroupInstanceProfileArrayOutput {
return o
}
func (o GroupInstanceProfileArrayOutput) Index(i pulumi.IntInput) GroupInstanceProfileOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *GroupInstanceProfile {
return vs[0].([]*GroupInstanceProfile)[vs[1].(int)]
}).(GroupInstanceProfileOutput)
}
type GroupInstanceProfileMapOutput struct{ *pulumi.OutputState }
func (GroupInstanceProfileMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*GroupInstanceProfile)(nil)).Elem()
}
func (o GroupInstanceProfileMapOutput) ToGroupInstanceProfileMapOutput() GroupInstanceProfileMapOutput {
return o
}
func (o GroupInstanceProfileMapOutput) ToGroupInstanceProfileMapOutputWithContext(ctx context.Context) GroupInstanceProfileMapOutput {
return o
}
func (o GroupInstanceProfileMapOutput) MapIndex(k pulumi.StringInput) GroupInstanceProfileOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *GroupInstanceProfile {
return vs[0].(map[string]*GroupInstanceProfile)[vs[1].(string)]
}).(GroupInstanceProfileOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*GroupInstanceProfileInput)(nil)).Elem(), &GroupInstanceProfile{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupInstanceProfileArrayInput)(nil)).Elem(), GroupInstanceProfileArray{})
pulumi.RegisterInputType(reflect.TypeOf((*GroupInstanceProfileMapInput)(nil)).Elem(), GroupInstanceProfileMap{})
pulumi.RegisterOutputType(GroupInstanceProfileOutput{})
pulumi.RegisterOutputType(GroupInstanceProfileArrayOutput{})
pulumi.RegisterOutputType(GroupInstanceProfileMapOutput{})
}