/
accessCaCertificate.go
340 lines (280 loc) · 12.8 KB
/
accessCaCertificate.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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package cloudflare
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Cloudflare Access can replace traditional SSH key models with short-lived
// certificates issued to your users based on the token generated by their Access
// login.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-cloudflare/sdk/v3/go/cloudflare"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := cloudflare.NewAccessCaCertificate(ctx, "example", &cloudflare.AccessCaCertificateArgs{
// AccountId: pulumi.String("1d5fdc9e88c8a8c4518b068cd94331fe"),
// ApplicationId: pulumi.String("6cd6cea3-3ef2-4542-9aea-85a0bbcd5414"),
// })
// if err != nil {
// return err
// }
// _, err = cloudflare.NewAccessCaCertificate(ctx, "anotherExample", &cloudflare.AccessCaCertificateArgs{
// ApplicationId: pulumi.String("fe2be0ff-7f13-4350-8c8e-a9b9795fe3c2"),
// ZoneId: pulumi.String("b6bc7eb6027c792a6bca3dc91fd2d7e0"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Access CA certificates can be imported using a composite ID formed of identifer ("account" or "zone"), identifier ID and the CA certificate ID.
//
// ```sh
// $ pulumi import cloudflare:index/accessCaCertificate:AccessCaCertificate example account/1d5fdc9e88c8a8c4518b068cd94331fe/edc1e4e24567217764b4322669c44df985dddffdf03ac781
// ```
type AccessCaCertificate struct {
pulumi.CustomResourceState
// The account to which the Access CA certificate should be added. Conflicts with `zoneId`.
AccountId pulumi.StringOutput `pulumi:"accountId"`
// The Access Application ID to associate with the CA certificate.
ApplicationId pulumi.StringOutput `pulumi:"applicationId"`
// Application Audience (AUD) Tag of the CA certificate
Aud pulumi.StringOutput `pulumi:"aud"`
// Cryptographic public key of the generated CA certificate
PublicKey pulumi.StringOutput `pulumi:"publicKey"`
// The DNS zone to which the Access CA certificate should be added. Conflicts with `accountId`.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewAccessCaCertificate registers a new resource with the given unique name, arguments, and options.
func NewAccessCaCertificate(ctx *pulumi.Context,
name string, args *AccessCaCertificateArgs, opts ...pulumi.ResourceOption) (*AccessCaCertificate, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ApplicationId == nil {
return nil, errors.New("invalid value for required argument 'ApplicationId'")
}
var resource AccessCaCertificate
err := ctx.RegisterResource("cloudflare:index/accessCaCertificate:AccessCaCertificate", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAccessCaCertificate gets an existing AccessCaCertificate 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 GetAccessCaCertificate(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AccessCaCertificateState, opts ...pulumi.ResourceOption) (*AccessCaCertificate, error) {
var resource AccessCaCertificate
err := ctx.ReadResource("cloudflare:index/accessCaCertificate:AccessCaCertificate", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AccessCaCertificate resources.
type accessCaCertificateState struct {
// The account to which the Access CA certificate should be added. Conflicts with `zoneId`.
AccountId *string `pulumi:"accountId"`
// The Access Application ID to associate with the CA certificate.
ApplicationId *string `pulumi:"applicationId"`
// Application Audience (AUD) Tag of the CA certificate
Aud *string `pulumi:"aud"`
// Cryptographic public key of the generated CA certificate
PublicKey *string `pulumi:"publicKey"`
// The DNS zone to which the Access CA certificate should be added. Conflicts with `accountId`.
ZoneId *string `pulumi:"zoneId"`
}
type AccessCaCertificateState struct {
// The account to which the Access CA certificate should be added. Conflicts with `zoneId`.
AccountId pulumi.StringPtrInput
// The Access Application ID to associate with the CA certificate.
ApplicationId pulumi.StringPtrInput
// Application Audience (AUD) Tag of the CA certificate
Aud pulumi.StringPtrInput
// Cryptographic public key of the generated CA certificate
PublicKey pulumi.StringPtrInput
// The DNS zone to which the Access CA certificate should be added. Conflicts with `accountId`.
ZoneId pulumi.StringPtrInput
}
func (AccessCaCertificateState) ElementType() reflect.Type {
return reflect.TypeOf((*accessCaCertificateState)(nil)).Elem()
}
type accessCaCertificateArgs struct {
// The account to which the Access CA certificate should be added. Conflicts with `zoneId`.
AccountId *string `pulumi:"accountId"`
// The Access Application ID to associate with the CA certificate.
ApplicationId string `pulumi:"applicationId"`
// The DNS zone to which the Access CA certificate should be added. Conflicts with `accountId`.
ZoneId *string `pulumi:"zoneId"`
}
// The set of arguments for constructing a AccessCaCertificate resource.
type AccessCaCertificateArgs struct {
// The account to which the Access CA certificate should be added. Conflicts with `zoneId`.
AccountId pulumi.StringPtrInput
// The Access Application ID to associate with the CA certificate.
ApplicationId pulumi.StringInput
// The DNS zone to which the Access CA certificate should be added. Conflicts with `accountId`.
ZoneId pulumi.StringPtrInput
}
func (AccessCaCertificateArgs) ElementType() reflect.Type {
return reflect.TypeOf((*accessCaCertificateArgs)(nil)).Elem()
}
type AccessCaCertificateInput interface {
pulumi.Input
ToAccessCaCertificateOutput() AccessCaCertificateOutput
ToAccessCaCertificateOutputWithContext(ctx context.Context) AccessCaCertificateOutput
}
func (*AccessCaCertificate) ElementType() reflect.Type {
return reflect.TypeOf((*AccessCaCertificate)(nil))
}
func (i *AccessCaCertificate) ToAccessCaCertificateOutput() AccessCaCertificateOutput {
return i.ToAccessCaCertificateOutputWithContext(context.Background())
}
func (i *AccessCaCertificate) ToAccessCaCertificateOutputWithContext(ctx context.Context) AccessCaCertificateOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessCaCertificateOutput)
}
func (i *AccessCaCertificate) ToAccessCaCertificatePtrOutput() AccessCaCertificatePtrOutput {
return i.ToAccessCaCertificatePtrOutputWithContext(context.Background())
}
func (i *AccessCaCertificate) ToAccessCaCertificatePtrOutputWithContext(ctx context.Context) AccessCaCertificatePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessCaCertificatePtrOutput)
}
type AccessCaCertificatePtrInput interface {
pulumi.Input
ToAccessCaCertificatePtrOutput() AccessCaCertificatePtrOutput
ToAccessCaCertificatePtrOutputWithContext(ctx context.Context) AccessCaCertificatePtrOutput
}
type accessCaCertificatePtrType AccessCaCertificateArgs
func (*accessCaCertificatePtrType) ElementType() reflect.Type {
return reflect.TypeOf((**AccessCaCertificate)(nil))
}
func (i *accessCaCertificatePtrType) ToAccessCaCertificatePtrOutput() AccessCaCertificatePtrOutput {
return i.ToAccessCaCertificatePtrOutputWithContext(context.Background())
}
func (i *accessCaCertificatePtrType) ToAccessCaCertificatePtrOutputWithContext(ctx context.Context) AccessCaCertificatePtrOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessCaCertificatePtrOutput)
}
// AccessCaCertificateArrayInput is an input type that accepts AccessCaCertificateArray and AccessCaCertificateArrayOutput values.
// You can construct a concrete instance of `AccessCaCertificateArrayInput` via:
//
// AccessCaCertificateArray{ AccessCaCertificateArgs{...} }
type AccessCaCertificateArrayInput interface {
pulumi.Input
ToAccessCaCertificateArrayOutput() AccessCaCertificateArrayOutput
ToAccessCaCertificateArrayOutputWithContext(context.Context) AccessCaCertificateArrayOutput
}
type AccessCaCertificateArray []AccessCaCertificateInput
func (AccessCaCertificateArray) ElementType() reflect.Type {
return reflect.TypeOf(([]*AccessCaCertificate)(nil))
}
func (i AccessCaCertificateArray) ToAccessCaCertificateArrayOutput() AccessCaCertificateArrayOutput {
return i.ToAccessCaCertificateArrayOutputWithContext(context.Background())
}
func (i AccessCaCertificateArray) ToAccessCaCertificateArrayOutputWithContext(ctx context.Context) AccessCaCertificateArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessCaCertificateArrayOutput)
}
// AccessCaCertificateMapInput is an input type that accepts AccessCaCertificateMap and AccessCaCertificateMapOutput values.
// You can construct a concrete instance of `AccessCaCertificateMapInput` via:
//
// AccessCaCertificateMap{ "key": AccessCaCertificateArgs{...} }
type AccessCaCertificateMapInput interface {
pulumi.Input
ToAccessCaCertificateMapOutput() AccessCaCertificateMapOutput
ToAccessCaCertificateMapOutputWithContext(context.Context) AccessCaCertificateMapOutput
}
type AccessCaCertificateMap map[string]AccessCaCertificateInput
func (AccessCaCertificateMap) ElementType() reflect.Type {
return reflect.TypeOf((map[string]*AccessCaCertificate)(nil))
}
func (i AccessCaCertificateMap) ToAccessCaCertificateMapOutput() AccessCaCertificateMapOutput {
return i.ToAccessCaCertificateMapOutputWithContext(context.Background())
}
func (i AccessCaCertificateMap) ToAccessCaCertificateMapOutputWithContext(ctx context.Context) AccessCaCertificateMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AccessCaCertificateMapOutput)
}
type AccessCaCertificateOutput struct {
*pulumi.OutputState
}
func (AccessCaCertificateOutput) ElementType() reflect.Type {
return reflect.TypeOf((*AccessCaCertificate)(nil))
}
func (o AccessCaCertificateOutput) ToAccessCaCertificateOutput() AccessCaCertificateOutput {
return o
}
func (o AccessCaCertificateOutput) ToAccessCaCertificateOutputWithContext(ctx context.Context) AccessCaCertificateOutput {
return o
}
func (o AccessCaCertificateOutput) ToAccessCaCertificatePtrOutput() AccessCaCertificatePtrOutput {
return o.ToAccessCaCertificatePtrOutputWithContext(context.Background())
}
func (o AccessCaCertificateOutput) ToAccessCaCertificatePtrOutputWithContext(ctx context.Context) AccessCaCertificatePtrOutput {
return o.ApplyT(func(v AccessCaCertificate) *AccessCaCertificate {
return &v
}).(AccessCaCertificatePtrOutput)
}
type AccessCaCertificatePtrOutput struct {
*pulumi.OutputState
}
func (AccessCaCertificatePtrOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AccessCaCertificate)(nil))
}
func (o AccessCaCertificatePtrOutput) ToAccessCaCertificatePtrOutput() AccessCaCertificatePtrOutput {
return o
}
func (o AccessCaCertificatePtrOutput) ToAccessCaCertificatePtrOutputWithContext(ctx context.Context) AccessCaCertificatePtrOutput {
return o
}
type AccessCaCertificateArrayOutput struct{ *pulumi.OutputState }
func (AccessCaCertificateArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]AccessCaCertificate)(nil))
}
func (o AccessCaCertificateArrayOutput) ToAccessCaCertificateArrayOutput() AccessCaCertificateArrayOutput {
return o
}
func (o AccessCaCertificateArrayOutput) ToAccessCaCertificateArrayOutputWithContext(ctx context.Context) AccessCaCertificateArrayOutput {
return o
}
func (o AccessCaCertificateArrayOutput) Index(i pulumi.IntInput) AccessCaCertificateOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) AccessCaCertificate {
return vs[0].([]AccessCaCertificate)[vs[1].(int)]
}).(AccessCaCertificateOutput)
}
type AccessCaCertificateMapOutput struct{ *pulumi.OutputState }
func (AccessCaCertificateMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]AccessCaCertificate)(nil))
}
func (o AccessCaCertificateMapOutput) ToAccessCaCertificateMapOutput() AccessCaCertificateMapOutput {
return o
}
func (o AccessCaCertificateMapOutput) ToAccessCaCertificateMapOutputWithContext(ctx context.Context) AccessCaCertificateMapOutput {
return o
}
func (o AccessCaCertificateMapOutput) MapIndex(k pulumi.StringInput) AccessCaCertificateOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) AccessCaCertificate {
return vs[0].(map[string]AccessCaCertificate)[vs[1].(string)]
}).(AccessCaCertificateOutput)
}
func init() {
pulumi.RegisterOutputType(AccessCaCertificateOutput{})
pulumi.RegisterOutputType(AccessCaCertificatePtrOutput{})
pulumi.RegisterOutputType(AccessCaCertificateArrayOutput{})
pulumi.RegisterOutputType(AccessCaCertificateMapOutput{})
}