/
getEnrollmentCert.go
247 lines (210 loc) · 9.41 KB
/
getEnrollmentCert.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
// 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 zpa
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/zscaler/pulumi-zpa/sdk/go/zpa/internal"
)
// * [Official documentation](https://help.zscaler.com/zpa/about-enrollment-ca-certificates)
// * [API documentation](https://help.zscaler.com/zpa/obtaining-enrollment-certificate-details-using-api)
//
// Use the **zpa_enrollment_cert** data source to get information about all configured enrollment certificate details created in the Zscaler Private Access cloud. This data source is required when creating provisioning key resources.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/zscaler/pulumi-zpa/sdk/go/zpa"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := zpa.GetEnrollmentCert(ctx, &zpa.GetEnrollmentCertArgs{
// Name: pulumi.StringRef("Root"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = zpa.GetEnrollmentCert(ctx, &zpa.GetEnrollmentCertArgs{
// Name: pulumi.StringRef("Client"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = zpa.GetEnrollmentCert(ctx, &zpa.GetEnrollmentCertArgs{
// Name: pulumi.StringRef("Connector"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = zpa.GetEnrollmentCert(ctx, &zpa.GetEnrollmentCertArgs{
// Name: pulumi.StringRef("Service Edge"),
// }, nil)
// if err != nil {
// return err
// }
// _, err = zpa.GetEnrollmentCert(ctx, &zpa.GetEnrollmentCertArgs{
// Name: pulumi.StringRef("Isolation Client"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func GetEnrollmentCert(ctx *pulumi.Context, args *GetEnrollmentCertArgs, opts ...pulumi.InvokeOption) (*GetEnrollmentCertResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetEnrollmentCertResult
err := ctx.Invoke("zpa:index/getEnrollmentCert:getEnrollmentCert", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getEnrollmentCert.
type GetEnrollmentCertArgs struct {
Id *string `pulumi:"id"`
MicrotenantId *string `pulumi:"microtenantId"`
Name *string `pulumi:"name"`
}
// A collection of values returned by getEnrollmentCert.
type GetEnrollmentCertResult struct {
AllowSigning bool `pulumi:"allowSigning"`
Certificate string `pulumi:"certificate"`
ClientCertType string `pulumi:"clientCertType"`
Cname string `pulumi:"cname"`
CreationTime string `pulumi:"creationTime"`
Csr string `pulumi:"csr"`
Description string `pulumi:"description"`
Id *string `pulumi:"id"`
IssuedBy string `pulumi:"issuedBy"`
IssuedTo string `pulumi:"issuedTo"`
MicrotenantId *string `pulumi:"microtenantId"`
ModifiedBy string `pulumi:"modifiedBy"`
ModifiedTime string `pulumi:"modifiedTime"`
Name *string `pulumi:"name"`
ParentCertId string `pulumi:"parentCertId"`
ParentCertName string `pulumi:"parentCertName"`
PrivateKey string `pulumi:"privateKey"`
PrivateKeyPresent bool `pulumi:"privateKeyPresent"`
SerialNo string `pulumi:"serialNo"`
ValidFromInEpochSec string `pulumi:"validFromInEpochSec"`
ValidToInEpochSec string `pulumi:"validToInEpochSec"`
ZrsaEncryptedPrivateKey string `pulumi:"zrsaEncryptedPrivateKey"`
ZrsaEncryptedSessionKey string `pulumi:"zrsaEncryptedSessionKey"`
}
func GetEnrollmentCertOutput(ctx *pulumi.Context, args GetEnrollmentCertOutputArgs, opts ...pulumi.InvokeOption) GetEnrollmentCertResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetEnrollmentCertResult, error) {
args := v.(GetEnrollmentCertArgs)
r, err := GetEnrollmentCert(ctx, &args, opts...)
var s GetEnrollmentCertResult
if r != nil {
s = *r
}
return s, err
}).(GetEnrollmentCertResultOutput)
}
// A collection of arguments for invoking getEnrollmentCert.
type GetEnrollmentCertOutputArgs struct {
Id pulumi.StringPtrInput `pulumi:"id"`
MicrotenantId pulumi.StringPtrInput `pulumi:"microtenantId"`
Name pulumi.StringPtrInput `pulumi:"name"`
}
func (GetEnrollmentCertOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetEnrollmentCertArgs)(nil)).Elem()
}
// A collection of values returned by getEnrollmentCert.
type GetEnrollmentCertResultOutput struct{ *pulumi.OutputState }
func (GetEnrollmentCertResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetEnrollmentCertResult)(nil)).Elem()
}
func (o GetEnrollmentCertResultOutput) ToGetEnrollmentCertResultOutput() GetEnrollmentCertResultOutput {
return o
}
func (o GetEnrollmentCertResultOutput) ToGetEnrollmentCertResultOutputWithContext(ctx context.Context) GetEnrollmentCertResultOutput {
return o
}
func (o GetEnrollmentCertResultOutput) AllowSigning() pulumi.BoolOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) bool { return v.AllowSigning }).(pulumi.BoolOutput)
}
func (o GetEnrollmentCertResultOutput) Certificate() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.Certificate }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ClientCertType() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ClientCertType }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) Cname() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.Cname }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) CreationTime() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.CreationTime }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) Csr() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.Csr }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.Description }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) Id() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) *string { return v.Id }).(pulumi.StringPtrOutput)
}
func (o GetEnrollmentCertResultOutput) IssuedBy() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.IssuedBy }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) IssuedTo() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.IssuedTo }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) MicrotenantId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) *string { return v.MicrotenantId }).(pulumi.StringPtrOutput)
}
func (o GetEnrollmentCertResultOutput) ModifiedBy() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ModifiedBy }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ModifiedTime() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ModifiedTime }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
func (o GetEnrollmentCertResultOutput) ParentCertId() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ParentCertId }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ParentCertName() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ParentCertName }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) PrivateKey() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.PrivateKey }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) PrivateKeyPresent() pulumi.BoolOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) bool { return v.PrivateKeyPresent }).(pulumi.BoolOutput)
}
func (o GetEnrollmentCertResultOutput) SerialNo() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.SerialNo }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ValidFromInEpochSec() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ValidFromInEpochSec }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ValidToInEpochSec() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ValidToInEpochSec }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ZrsaEncryptedPrivateKey() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ZrsaEncryptedPrivateKey }).(pulumi.StringOutput)
}
func (o GetEnrollmentCertResultOutput) ZrsaEncryptedSessionKey() pulumi.StringOutput {
return o.ApplyT(func(v GetEnrollmentCertResult) string { return v.ZrsaEncryptedSessionKey }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetEnrollmentCertResultOutput{})
}