generated from pulumi/pulumi-tf-provider-boilerplate
/
cloudStackServiceAccount.go
291 lines (241 loc) · 11.4 KB
/
cloudStackServiceAccount.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
// 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 grafana
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// **Note:** This resource is available only with Grafana 9.1+.
//
// Manages service accounts of a Grafana Cloud stack using the Cloud API
// This can be used to bootstrap a management service account for a new stack
//
// * [Official documentation](https://grafana.com/docs/grafana/latest/administration/service-accounts/)
// * [HTTP API](https://grafana.com/docs/grafana/latest/developers/http_api/serviceaccount/#service-account-api)
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := grafana.NewCloudStackServiceAccount(ctx, "cloudSa", &grafana.CloudStackServiceAccountArgs{
// IsDisabled: pulumi.Bool(false),
// Role: pulumi.String("Admin"),
// StackSlug: pulumi.String("<your stack slug>"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type CloudStackServiceAccount struct {
pulumi.CustomResourceState
// The disabled status for the service account. Defaults to `false`.
IsDisabled pulumi.BoolPtrOutput `pulumi:"isDisabled"`
// The name of the service account.
Name pulumi.StringOutput `pulumi:"name"`
// The basic role of the service account in the organization.
Role pulumi.StringPtrOutput `pulumi:"role"`
StackSlug pulumi.StringOutput `pulumi:"stackSlug"`
}
// NewCloudStackServiceAccount registers a new resource with the given unique name, arguments, and options.
func NewCloudStackServiceAccount(ctx *pulumi.Context,
name string, args *CloudStackServiceAccountArgs, opts ...pulumi.ResourceOption) (*CloudStackServiceAccount, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.StackSlug == nil {
return nil, errors.New("invalid value for required argument 'StackSlug'")
}
opts = pkgResourceDefaultOpts(opts)
var resource CloudStackServiceAccount
err := ctx.RegisterResource("grafana:index/cloudStackServiceAccount:CloudStackServiceAccount", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCloudStackServiceAccount gets an existing CloudStackServiceAccount 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 GetCloudStackServiceAccount(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CloudStackServiceAccountState, opts ...pulumi.ResourceOption) (*CloudStackServiceAccount, error) {
var resource CloudStackServiceAccount
err := ctx.ReadResource("grafana:index/cloudStackServiceAccount:CloudStackServiceAccount", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CloudStackServiceAccount resources.
type cloudStackServiceAccountState struct {
// The disabled status for the service account. Defaults to `false`.
IsDisabled *bool `pulumi:"isDisabled"`
// The name of the service account.
Name *string `pulumi:"name"`
// The basic role of the service account in the organization.
Role *string `pulumi:"role"`
StackSlug *string `pulumi:"stackSlug"`
}
type CloudStackServiceAccountState struct {
// The disabled status for the service account. Defaults to `false`.
IsDisabled pulumi.BoolPtrInput
// The name of the service account.
Name pulumi.StringPtrInput
// The basic role of the service account in the organization.
Role pulumi.StringPtrInput
StackSlug pulumi.StringPtrInput
}
func (CloudStackServiceAccountState) ElementType() reflect.Type {
return reflect.TypeOf((*cloudStackServiceAccountState)(nil)).Elem()
}
type cloudStackServiceAccountArgs struct {
// The disabled status for the service account. Defaults to `false`.
IsDisabled *bool `pulumi:"isDisabled"`
// The name of the service account.
Name *string `pulumi:"name"`
// The basic role of the service account in the organization.
Role *string `pulumi:"role"`
StackSlug string `pulumi:"stackSlug"`
}
// The set of arguments for constructing a CloudStackServiceAccount resource.
type CloudStackServiceAccountArgs struct {
// The disabled status for the service account. Defaults to `false`.
IsDisabled pulumi.BoolPtrInput
// The name of the service account.
Name pulumi.StringPtrInput
// The basic role of the service account in the organization.
Role pulumi.StringPtrInput
StackSlug pulumi.StringInput
}
func (CloudStackServiceAccountArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cloudStackServiceAccountArgs)(nil)).Elem()
}
type CloudStackServiceAccountInput interface {
pulumi.Input
ToCloudStackServiceAccountOutput() CloudStackServiceAccountOutput
ToCloudStackServiceAccountOutputWithContext(ctx context.Context) CloudStackServiceAccountOutput
}
func (*CloudStackServiceAccount) ElementType() reflect.Type {
return reflect.TypeOf((**CloudStackServiceAccount)(nil)).Elem()
}
func (i *CloudStackServiceAccount) ToCloudStackServiceAccountOutput() CloudStackServiceAccountOutput {
return i.ToCloudStackServiceAccountOutputWithContext(context.Background())
}
func (i *CloudStackServiceAccount) ToCloudStackServiceAccountOutputWithContext(ctx context.Context) CloudStackServiceAccountOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudStackServiceAccountOutput)
}
// CloudStackServiceAccountArrayInput is an input type that accepts CloudStackServiceAccountArray and CloudStackServiceAccountArrayOutput values.
// You can construct a concrete instance of `CloudStackServiceAccountArrayInput` via:
//
// CloudStackServiceAccountArray{ CloudStackServiceAccountArgs{...} }
type CloudStackServiceAccountArrayInput interface {
pulumi.Input
ToCloudStackServiceAccountArrayOutput() CloudStackServiceAccountArrayOutput
ToCloudStackServiceAccountArrayOutputWithContext(context.Context) CloudStackServiceAccountArrayOutput
}
type CloudStackServiceAccountArray []CloudStackServiceAccountInput
func (CloudStackServiceAccountArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudStackServiceAccount)(nil)).Elem()
}
func (i CloudStackServiceAccountArray) ToCloudStackServiceAccountArrayOutput() CloudStackServiceAccountArrayOutput {
return i.ToCloudStackServiceAccountArrayOutputWithContext(context.Background())
}
func (i CloudStackServiceAccountArray) ToCloudStackServiceAccountArrayOutputWithContext(ctx context.Context) CloudStackServiceAccountArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudStackServiceAccountArrayOutput)
}
// CloudStackServiceAccountMapInput is an input type that accepts CloudStackServiceAccountMap and CloudStackServiceAccountMapOutput values.
// You can construct a concrete instance of `CloudStackServiceAccountMapInput` via:
//
// CloudStackServiceAccountMap{ "key": CloudStackServiceAccountArgs{...} }
type CloudStackServiceAccountMapInput interface {
pulumi.Input
ToCloudStackServiceAccountMapOutput() CloudStackServiceAccountMapOutput
ToCloudStackServiceAccountMapOutputWithContext(context.Context) CloudStackServiceAccountMapOutput
}
type CloudStackServiceAccountMap map[string]CloudStackServiceAccountInput
func (CloudStackServiceAccountMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudStackServiceAccount)(nil)).Elem()
}
func (i CloudStackServiceAccountMap) ToCloudStackServiceAccountMapOutput() CloudStackServiceAccountMapOutput {
return i.ToCloudStackServiceAccountMapOutputWithContext(context.Background())
}
func (i CloudStackServiceAccountMap) ToCloudStackServiceAccountMapOutputWithContext(ctx context.Context) CloudStackServiceAccountMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CloudStackServiceAccountMapOutput)
}
type CloudStackServiceAccountOutput struct{ *pulumi.OutputState }
func (CloudStackServiceAccountOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CloudStackServiceAccount)(nil)).Elem()
}
func (o CloudStackServiceAccountOutput) ToCloudStackServiceAccountOutput() CloudStackServiceAccountOutput {
return o
}
func (o CloudStackServiceAccountOutput) ToCloudStackServiceAccountOutputWithContext(ctx context.Context) CloudStackServiceAccountOutput {
return o
}
// The disabled status for the service account. Defaults to `false`.
func (o CloudStackServiceAccountOutput) IsDisabled() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CloudStackServiceAccount) pulumi.BoolPtrOutput { return v.IsDisabled }).(pulumi.BoolPtrOutput)
}
// The name of the service account.
func (o CloudStackServiceAccountOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CloudStackServiceAccount) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The basic role of the service account in the organization.
func (o CloudStackServiceAccountOutput) Role() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CloudStackServiceAccount) pulumi.StringPtrOutput { return v.Role }).(pulumi.StringPtrOutput)
}
func (o CloudStackServiceAccountOutput) StackSlug() pulumi.StringOutput {
return o.ApplyT(func(v *CloudStackServiceAccount) pulumi.StringOutput { return v.StackSlug }).(pulumi.StringOutput)
}
type CloudStackServiceAccountArrayOutput struct{ *pulumi.OutputState }
func (CloudStackServiceAccountArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CloudStackServiceAccount)(nil)).Elem()
}
func (o CloudStackServiceAccountArrayOutput) ToCloudStackServiceAccountArrayOutput() CloudStackServiceAccountArrayOutput {
return o
}
func (o CloudStackServiceAccountArrayOutput) ToCloudStackServiceAccountArrayOutputWithContext(ctx context.Context) CloudStackServiceAccountArrayOutput {
return o
}
func (o CloudStackServiceAccountArrayOutput) Index(i pulumi.IntInput) CloudStackServiceAccountOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CloudStackServiceAccount {
return vs[0].([]*CloudStackServiceAccount)[vs[1].(int)]
}).(CloudStackServiceAccountOutput)
}
type CloudStackServiceAccountMapOutput struct{ *pulumi.OutputState }
func (CloudStackServiceAccountMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CloudStackServiceAccount)(nil)).Elem()
}
func (o CloudStackServiceAccountMapOutput) ToCloudStackServiceAccountMapOutput() CloudStackServiceAccountMapOutput {
return o
}
func (o CloudStackServiceAccountMapOutput) ToCloudStackServiceAccountMapOutputWithContext(ctx context.Context) CloudStackServiceAccountMapOutput {
return o
}
func (o CloudStackServiceAccountMapOutput) MapIndex(k pulumi.StringInput) CloudStackServiceAccountOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CloudStackServiceAccount {
return vs[0].(map[string]*CloudStackServiceAccount)[vs[1].(string)]
}).(CloudStackServiceAccountOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CloudStackServiceAccountInput)(nil)).Elem(), &CloudStackServiceAccount{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudStackServiceAccountArrayInput)(nil)).Elem(), CloudStackServiceAccountArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CloudStackServiceAccountMapInput)(nil)).Elem(), CloudStackServiceAccountMap{})
pulumi.RegisterOutputType(CloudStackServiceAccountOutput{})
pulumi.RegisterOutputType(CloudStackServiceAccountArrayOutput{})
pulumi.RegisterOutputType(CloudStackServiceAccountMapOutput{})
}