generated from pulumi/pulumi-tf-provider-boilerplate
/
directory.go
305 lines (255 loc) · 12.2 KB
/
directory.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
// 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 cloudsso
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Cloud SSO Directory resource.
//
// For information about Cloud SSO Directory and how to use it, see [What is Directory](https://www.alibabacloud.com/help/doc-detail/263624.html).
//
// > **NOTE:** Available in v1.135.0+.
//
// > **NOTE:** Cloud SSO Only Support `cn-shanghai` And `us-west-1` Region
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/rhysmdnz/pulumi-alicloud/sdk/go/alicloud/cloudsso"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudsso.NewDirectory(ctx, "default", &cloudsso.DirectoryArgs{
// DirectoryName: pulumi.String("example-value"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Cloud SSO Directory can be imported using the id, e.g.
//
// ```sh
//
// $ pulumi import alicloud:cloudsso/directory:Directory example <id>
//
// ```
type Directory struct {
pulumi.CustomResourceState
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
DirectoryName pulumi.StringPtrOutput `pulumi:"directoryName"`
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
MfaAuthenticationStatus pulumi.StringOutput `pulumi:"mfaAuthenticationStatus"`
// The saml identity provider configuration.
SamlIdentityProviderConfiguration DirectorySamlIdentityProviderConfigurationOutput `pulumi:"samlIdentityProviderConfiguration"`
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
ScimSynchronizationStatus pulumi.StringOutput `pulumi:"scimSynchronizationStatus"`
}
// NewDirectory registers a new resource with the given unique name, arguments, and options.
func NewDirectory(ctx *pulumi.Context,
name string, args *DirectoryArgs, opts ...pulumi.ResourceOption) (*Directory, error) {
if args == nil {
args = &DirectoryArgs{}
}
opts = pkgResourceDefaultOpts(opts)
var resource Directory
err := ctx.RegisterResource("alicloud:cloudsso/directory:Directory", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDirectory gets an existing Directory 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 GetDirectory(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DirectoryState, opts ...pulumi.ResourceOption) (*Directory, error) {
var resource Directory
err := ctx.ReadResource("alicloud:cloudsso/directory:Directory", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Directory resources.
type directoryState struct {
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
DirectoryName *string `pulumi:"directoryName"`
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
MfaAuthenticationStatus *string `pulumi:"mfaAuthenticationStatus"`
// The saml identity provider configuration.
SamlIdentityProviderConfiguration *DirectorySamlIdentityProviderConfiguration `pulumi:"samlIdentityProviderConfiguration"`
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
ScimSynchronizationStatus *string `pulumi:"scimSynchronizationStatus"`
}
type DirectoryState struct {
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
DirectoryName pulumi.StringPtrInput
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
MfaAuthenticationStatus pulumi.StringPtrInput
// The saml identity provider configuration.
SamlIdentityProviderConfiguration DirectorySamlIdentityProviderConfigurationPtrInput
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
ScimSynchronizationStatus pulumi.StringPtrInput
}
func (DirectoryState) ElementType() reflect.Type {
return reflect.TypeOf((*directoryState)(nil)).Elem()
}
type directoryArgs struct {
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
DirectoryName *string `pulumi:"directoryName"`
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
MfaAuthenticationStatus *string `pulumi:"mfaAuthenticationStatus"`
// The saml identity provider configuration.
SamlIdentityProviderConfiguration *DirectorySamlIdentityProviderConfiguration `pulumi:"samlIdentityProviderConfiguration"`
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
ScimSynchronizationStatus *string `pulumi:"scimSynchronizationStatus"`
}
// The set of arguments for constructing a Directory resource.
type DirectoryArgs struct {
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
DirectoryName pulumi.StringPtrInput
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
MfaAuthenticationStatus pulumi.StringPtrInput
// The saml identity provider configuration.
SamlIdentityProviderConfiguration DirectorySamlIdentityProviderConfigurationPtrInput
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
ScimSynchronizationStatus pulumi.StringPtrInput
}
func (DirectoryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*directoryArgs)(nil)).Elem()
}
type DirectoryInput interface {
pulumi.Input
ToDirectoryOutput() DirectoryOutput
ToDirectoryOutputWithContext(ctx context.Context) DirectoryOutput
}
func (*Directory) ElementType() reflect.Type {
return reflect.TypeOf((**Directory)(nil)).Elem()
}
func (i *Directory) ToDirectoryOutput() DirectoryOutput {
return i.ToDirectoryOutputWithContext(context.Background())
}
func (i *Directory) ToDirectoryOutputWithContext(ctx context.Context) DirectoryOutput {
return pulumi.ToOutputWithContext(ctx, i).(DirectoryOutput)
}
// DirectoryArrayInput is an input type that accepts DirectoryArray and DirectoryArrayOutput values.
// You can construct a concrete instance of `DirectoryArrayInput` via:
//
// DirectoryArray{ DirectoryArgs{...} }
type DirectoryArrayInput interface {
pulumi.Input
ToDirectoryArrayOutput() DirectoryArrayOutput
ToDirectoryArrayOutputWithContext(context.Context) DirectoryArrayOutput
}
type DirectoryArray []DirectoryInput
func (DirectoryArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Directory)(nil)).Elem()
}
func (i DirectoryArray) ToDirectoryArrayOutput() DirectoryArrayOutput {
return i.ToDirectoryArrayOutputWithContext(context.Background())
}
func (i DirectoryArray) ToDirectoryArrayOutputWithContext(ctx context.Context) DirectoryArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DirectoryArrayOutput)
}
// DirectoryMapInput is an input type that accepts DirectoryMap and DirectoryMapOutput values.
// You can construct a concrete instance of `DirectoryMapInput` via:
//
// DirectoryMap{ "key": DirectoryArgs{...} }
type DirectoryMapInput interface {
pulumi.Input
ToDirectoryMapOutput() DirectoryMapOutput
ToDirectoryMapOutputWithContext(context.Context) DirectoryMapOutput
}
type DirectoryMap map[string]DirectoryInput
func (DirectoryMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Directory)(nil)).Elem()
}
func (i DirectoryMap) ToDirectoryMapOutput() DirectoryMapOutput {
return i.ToDirectoryMapOutputWithContext(context.Background())
}
func (i DirectoryMap) ToDirectoryMapOutputWithContext(ctx context.Context) DirectoryMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DirectoryMapOutput)
}
type DirectoryOutput struct{ *pulumi.OutputState }
func (DirectoryOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Directory)(nil)).Elem()
}
func (o DirectoryOutput) ToDirectoryOutput() DirectoryOutput {
return o
}
func (o DirectoryOutput) ToDirectoryOutputWithContext(ctx context.Context) DirectoryOutput {
return o
}
// The name of the CloudSSO directory. The length is 2-64 characters, and it can contain lowercase letters, numbers, and dashes (-). It cannot start or end with a dash and cannot have two consecutive dashes. Need to be globally unique, and capitalization is not supported. Cannot start with `d-`.
func (o DirectoryOutput) DirectoryName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Directory) pulumi.StringPtrOutput { return v.DirectoryName }).(pulumi.StringPtrOutput)
}
// The mfa authentication status. Valid values: `Enabled` or `Disabled`. Default to `Enabled`.
func (o DirectoryOutput) MfaAuthenticationStatus() pulumi.StringOutput {
return o.ApplyT(func(v *Directory) pulumi.StringOutput { return v.MfaAuthenticationStatus }).(pulumi.StringOutput)
}
// The saml identity provider configuration.
func (o DirectoryOutput) SamlIdentityProviderConfiguration() DirectorySamlIdentityProviderConfigurationOutput {
return o.ApplyT(func(v *Directory) DirectorySamlIdentityProviderConfigurationOutput {
return v.SamlIdentityProviderConfiguration
}).(DirectorySamlIdentityProviderConfigurationOutput)
}
// The scim synchronization status. Valid values: `Enabled` or `Disabled`. Default to `Disabled`.
func (o DirectoryOutput) ScimSynchronizationStatus() pulumi.StringOutput {
return o.ApplyT(func(v *Directory) pulumi.StringOutput { return v.ScimSynchronizationStatus }).(pulumi.StringOutput)
}
type DirectoryArrayOutput struct{ *pulumi.OutputState }
func (DirectoryArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Directory)(nil)).Elem()
}
func (o DirectoryArrayOutput) ToDirectoryArrayOutput() DirectoryArrayOutput {
return o
}
func (o DirectoryArrayOutput) ToDirectoryArrayOutputWithContext(ctx context.Context) DirectoryArrayOutput {
return o
}
func (o DirectoryArrayOutput) Index(i pulumi.IntInput) DirectoryOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Directory {
return vs[0].([]*Directory)[vs[1].(int)]
}).(DirectoryOutput)
}
type DirectoryMapOutput struct{ *pulumi.OutputState }
func (DirectoryMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Directory)(nil)).Elem()
}
func (o DirectoryMapOutput) ToDirectoryMapOutput() DirectoryMapOutput {
return o
}
func (o DirectoryMapOutput) ToDirectoryMapOutputWithContext(ctx context.Context) DirectoryMapOutput {
return o
}
func (o DirectoryMapOutput) MapIndex(k pulumi.StringInput) DirectoryOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Directory {
return vs[0].(map[string]*Directory)[vs[1].(string)]
}).(DirectoryOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DirectoryInput)(nil)).Elem(), &Directory{})
pulumi.RegisterInputType(reflect.TypeOf((*DirectoryArrayInput)(nil)).Elem(), DirectoryArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DirectoryMapInput)(nil)).Elem(), DirectoryMap{})
pulumi.RegisterOutputType(DirectoryOutput{})
pulumi.RegisterOutputType(DirectoryArrayOutput{})
pulumi.RegisterOutputType(DirectoryMapOutput{})
}