/
getLdapConfiguration.go
158 lines (133 loc) · 7.83 KB
/
getLdapConfiguration.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
// 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 mongodbatlas
import (
"context"
"reflect"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `LdapConfiguration` describes a LDAP Configuration.
//
// > **NOTE:** Groups and projects are synonymous terms. You may find **group_id** in the official documentation.
func LookupLdapConfiguration(ctx *pulumi.Context, args *LookupLdapConfigurationArgs, opts ...pulumi.InvokeOption) (*LookupLdapConfigurationResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupLdapConfigurationResult
err := ctx.Invoke("mongodbatlas:index/getLdapConfiguration:getLdapConfiguration", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getLdapConfiguration.
type LookupLdapConfigurationArgs struct {
// Identifier for the Atlas project associated with the LDAP over TLS/SSL configuration.
ProjectId string `pulumi:"projectId"`
}
// A collection of values returned by getLdapConfiguration.
type LookupLdapConfigurationResult struct {
// Specifies whether user authentication with LDAP is enabled.
AuthenticationEnabled bool `pulumi:"authenticationEnabled"`
// Specifies whether user authorization with LDAP is enabled.
AuthorizationEnabled bool `pulumi:"authorizationEnabled"`
// An LDAP query template that Atlas executes to obtain the LDAP groups to which the authenticated user belongs.
AuthzQueryTemplate string `pulumi:"authzQueryTemplate"`
// The password used to authenticate the `bindUsername`.
BindPassword string `pulumi:"bindPassword"`
// The user DN that Atlas uses to connect to the LDAP server.
BindUsername string `pulumi:"bindUsername"`
// CA certificate used to verify the identify of the LDAP server.
CaCertificate string `pulumi:"caCertificate"`
// (Required) The hostname or IP address of the LDAP server.
Hostname string `pulumi:"hostname"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The port to which the LDAP server listens for client connections.
Port int `pulumi:"port"`
ProjectId string `pulumi:"projectId"`
// Maps an LDAP username for authentication to an LDAP Distinguished Name (DN).
// * `user_to_dn_mapping.0.match` - A regular expression to match against a provided LDAP username.
// * `user_to_dn_mapping.0.substitution` - An LDAP Distinguished Name (DN) formatting template that converts the LDAP name matched by the `match` regular expression into an LDAP Distinguished Name.
// * `user_to_dn_mapping.0.ldap_query` - An LDAP query formatting template that inserts the LDAP name matched by the `match` regular expression into an LDAP query URI as specified by RFC 4515 and RFC 4516.
UserToDnMappings []GetLdapConfigurationUserToDnMapping `pulumi:"userToDnMappings"`
}
func LookupLdapConfigurationOutput(ctx *pulumi.Context, args LookupLdapConfigurationOutputArgs, opts ...pulumi.InvokeOption) LookupLdapConfigurationResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupLdapConfigurationResult, error) {
args := v.(LookupLdapConfigurationArgs)
r, err := LookupLdapConfiguration(ctx, &args, opts...)
var s LookupLdapConfigurationResult
if r != nil {
s = *r
}
return s, err
}).(LookupLdapConfigurationResultOutput)
}
// A collection of arguments for invoking getLdapConfiguration.
type LookupLdapConfigurationOutputArgs struct {
// Identifier for the Atlas project associated with the LDAP over TLS/SSL configuration.
ProjectId pulumi.StringInput `pulumi:"projectId"`
}
func (LookupLdapConfigurationOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupLdapConfigurationArgs)(nil)).Elem()
}
// A collection of values returned by getLdapConfiguration.
type LookupLdapConfigurationResultOutput struct{ *pulumi.OutputState }
func (LookupLdapConfigurationResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupLdapConfigurationResult)(nil)).Elem()
}
func (o LookupLdapConfigurationResultOutput) ToLookupLdapConfigurationResultOutput() LookupLdapConfigurationResultOutput {
return o
}
func (o LookupLdapConfigurationResultOutput) ToLookupLdapConfigurationResultOutputWithContext(ctx context.Context) LookupLdapConfigurationResultOutput {
return o
}
// Specifies whether user authentication with LDAP is enabled.
func (o LookupLdapConfigurationResultOutput) AuthenticationEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) bool { return v.AuthenticationEnabled }).(pulumi.BoolOutput)
}
// Specifies whether user authorization with LDAP is enabled.
func (o LookupLdapConfigurationResultOutput) AuthorizationEnabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) bool { return v.AuthorizationEnabled }).(pulumi.BoolOutput)
}
// An LDAP query template that Atlas executes to obtain the LDAP groups to which the authenticated user belongs.
func (o LookupLdapConfigurationResultOutput) AuthzQueryTemplate() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.AuthzQueryTemplate }).(pulumi.StringOutput)
}
// The password used to authenticate the `bindUsername`.
func (o LookupLdapConfigurationResultOutput) BindPassword() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.BindPassword }).(pulumi.StringOutput)
}
// The user DN that Atlas uses to connect to the LDAP server.
func (o LookupLdapConfigurationResultOutput) BindUsername() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.BindUsername }).(pulumi.StringOutput)
}
// CA certificate used to verify the identify of the LDAP server.
func (o LookupLdapConfigurationResultOutput) CaCertificate() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.CaCertificate }).(pulumi.StringOutput)
}
// (Required) The hostname or IP address of the LDAP server.
func (o LookupLdapConfigurationResultOutput) Hostname() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.Hostname }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupLdapConfigurationResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.Id }).(pulumi.StringOutput)
}
// The port to which the LDAP server listens for client connections.
func (o LookupLdapConfigurationResultOutput) Port() pulumi.IntOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) int { return v.Port }).(pulumi.IntOutput)
}
func (o LookupLdapConfigurationResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) string { return v.ProjectId }).(pulumi.StringOutput)
}
// Maps an LDAP username for authentication to an LDAP Distinguished Name (DN).
// * `user_to_dn_mapping.0.match` - A regular expression to match against a provided LDAP username.
// * `user_to_dn_mapping.0.substitution` - An LDAP Distinguished Name (DN) formatting template that converts the LDAP name matched by the `match` regular expression into an LDAP Distinguished Name.
// * `user_to_dn_mapping.0.ldap_query` - An LDAP query formatting template that inserts the LDAP name matched by the `match` regular expression into an LDAP query URI as specified by RFC 4515 and RFC 4516.
func (o LookupLdapConfigurationResultOutput) UserToDnMappings() GetLdapConfigurationUserToDnMappingArrayOutput {
return o.ApplyT(func(v LookupLdapConfigurationResult) []GetLdapConfigurationUserToDnMapping { return v.UserToDnMappings }).(GetLdapConfigurationUserToDnMappingArrayOutput)
}
func init() {
pulumi.RegisterOutputType(LookupLdapConfigurationResultOutput{})
}