/
keys.go
288 lines (238 loc) · 9.04 KB
/
keys.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
// 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 managed
import (
"context"
"reflect"
"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A resource that manages the lifecycle of all [Managed Keys](https://www.vaultproject.io/docs/enterprise/managed-keys) in Vault.
//
// **Note** this feature is available only with Vault Enterprise.
//
// ## Import
//
// Mounts can be imported using the `id` of `default`, e.g.
//
// ```sh
// $ pulumi import vault:managed/keys:Keys keys default
// ```
type Keys struct {
pulumi.CustomResourceState
// Configuration block for AWS Managed Keys
Aws KeysAwArrayOutput `pulumi:"aws"`
// Configuration block for Azure Managed Keys
Azures KeysAzureArrayOutput `pulumi:"azures"`
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
Namespace pulumi.StringPtrOutput `pulumi:"namespace"`
// Configuration block for PKCS Managed Keys
Pkcs KeysPkcArrayOutput `pulumi:"pkcs"`
}
// NewKeys registers a new resource with the given unique name, arguments, and options.
func NewKeys(ctx *pulumi.Context,
name string, args *KeysArgs, opts ...pulumi.ResourceOption) (*Keys, error) {
if args == nil {
args = &KeysArgs{}
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource Keys
err := ctx.RegisterResource("vault:managed/keys:Keys", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetKeys gets an existing Keys 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 GetKeys(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *KeysState, opts ...pulumi.ResourceOption) (*Keys, error) {
var resource Keys
err := ctx.ReadResource("vault:managed/keys:Keys", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Keys resources.
type keysState struct {
// Configuration block for AWS Managed Keys
Aws []KeysAw `pulumi:"aws"`
// Configuration block for Azure Managed Keys
Azures []KeysAzure `pulumi:"azures"`
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
Namespace *string `pulumi:"namespace"`
// Configuration block for PKCS Managed Keys
Pkcs []KeysPkc `pulumi:"pkcs"`
}
type KeysState struct {
// Configuration block for AWS Managed Keys
Aws KeysAwArrayInput
// Configuration block for Azure Managed Keys
Azures KeysAzureArrayInput
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
Namespace pulumi.StringPtrInput
// Configuration block for PKCS Managed Keys
Pkcs KeysPkcArrayInput
}
func (KeysState) ElementType() reflect.Type {
return reflect.TypeOf((*keysState)(nil)).Elem()
}
type keysArgs struct {
// Configuration block for AWS Managed Keys
Aws []KeysAw `pulumi:"aws"`
// Configuration block for Azure Managed Keys
Azures []KeysAzure `pulumi:"azures"`
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
Namespace *string `pulumi:"namespace"`
// Configuration block for PKCS Managed Keys
Pkcs []KeysPkc `pulumi:"pkcs"`
}
// The set of arguments for constructing a Keys resource.
type KeysArgs struct {
// Configuration block for AWS Managed Keys
Aws KeysAwArrayInput
// Configuration block for Azure Managed Keys
Azures KeysAzureArrayInput
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
Namespace pulumi.StringPtrInput
// Configuration block for PKCS Managed Keys
Pkcs KeysPkcArrayInput
}
func (KeysArgs) ElementType() reflect.Type {
return reflect.TypeOf((*keysArgs)(nil)).Elem()
}
type KeysInput interface {
pulumi.Input
ToKeysOutput() KeysOutput
ToKeysOutputWithContext(ctx context.Context) KeysOutput
}
func (*Keys) ElementType() reflect.Type {
return reflect.TypeOf((**Keys)(nil)).Elem()
}
func (i *Keys) ToKeysOutput() KeysOutput {
return i.ToKeysOutputWithContext(context.Background())
}
func (i *Keys) ToKeysOutputWithContext(ctx context.Context) KeysOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeysOutput)
}
// KeysArrayInput is an input type that accepts KeysArray and KeysArrayOutput values.
// You can construct a concrete instance of `KeysArrayInput` via:
//
// KeysArray{ KeysArgs{...} }
type KeysArrayInput interface {
pulumi.Input
ToKeysArrayOutput() KeysArrayOutput
ToKeysArrayOutputWithContext(context.Context) KeysArrayOutput
}
type KeysArray []KeysInput
func (KeysArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Keys)(nil)).Elem()
}
func (i KeysArray) ToKeysArrayOutput() KeysArrayOutput {
return i.ToKeysArrayOutputWithContext(context.Background())
}
func (i KeysArray) ToKeysArrayOutputWithContext(ctx context.Context) KeysArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeysArrayOutput)
}
// KeysMapInput is an input type that accepts KeysMap and KeysMapOutput values.
// You can construct a concrete instance of `KeysMapInput` via:
//
// KeysMap{ "key": KeysArgs{...} }
type KeysMapInput interface {
pulumi.Input
ToKeysMapOutput() KeysMapOutput
ToKeysMapOutputWithContext(context.Context) KeysMapOutput
}
type KeysMap map[string]KeysInput
func (KeysMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Keys)(nil)).Elem()
}
func (i KeysMap) ToKeysMapOutput() KeysMapOutput {
return i.ToKeysMapOutputWithContext(context.Background())
}
func (i KeysMap) ToKeysMapOutputWithContext(ctx context.Context) KeysMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(KeysMapOutput)
}
type KeysOutput struct{ *pulumi.OutputState }
func (KeysOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Keys)(nil)).Elem()
}
func (o KeysOutput) ToKeysOutput() KeysOutput {
return o
}
func (o KeysOutput) ToKeysOutputWithContext(ctx context.Context) KeysOutput {
return o
}
// Configuration block for AWS Managed Keys
func (o KeysOutput) Aws() KeysAwArrayOutput {
return o.ApplyT(func(v *Keys) KeysAwArrayOutput { return v.Aws }).(KeysAwArrayOutput)
}
// Configuration block for Azure Managed Keys
func (o KeysOutput) Azures() KeysAzureArrayOutput {
return o.ApplyT(func(v *Keys) KeysAzureArrayOutput { return v.Azures }).(KeysAzureArrayOutput)
}
// The namespace to provision the resource in.
// The value should not contain leading or trailing forward slashes.
// The `namespace` is always relative to the provider's configured namespace.
// *Available only for Vault Enterprise*.
func (o KeysOutput) Namespace() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Keys) pulumi.StringPtrOutput { return v.Namespace }).(pulumi.StringPtrOutput)
}
// Configuration block for PKCS Managed Keys
func (o KeysOutput) Pkcs() KeysPkcArrayOutput {
return o.ApplyT(func(v *Keys) KeysPkcArrayOutput { return v.Pkcs }).(KeysPkcArrayOutput)
}
type KeysArrayOutput struct{ *pulumi.OutputState }
func (KeysArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Keys)(nil)).Elem()
}
func (o KeysArrayOutput) ToKeysArrayOutput() KeysArrayOutput {
return o
}
func (o KeysArrayOutput) ToKeysArrayOutputWithContext(ctx context.Context) KeysArrayOutput {
return o
}
func (o KeysArrayOutput) Index(i pulumi.IntInput) KeysOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Keys {
return vs[0].([]*Keys)[vs[1].(int)]
}).(KeysOutput)
}
type KeysMapOutput struct{ *pulumi.OutputState }
func (KeysMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Keys)(nil)).Elem()
}
func (o KeysMapOutput) ToKeysMapOutput() KeysMapOutput {
return o
}
func (o KeysMapOutput) ToKeysMapOutputWithContext(ctx context.Context) KeysMapOutput {
return o
}
func (o KeysMapOutput) MapIndex(k pulumi.StringInput) KeysOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Keys {
return vs[0].(map[string]*Keys)[vs[1].(string)]
}).(KeysOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*KeysInput)(nil)).Elem(), &Keys{})
pulumi.RegisterInputType(reflect.TypeOf((*KeysArrayInput)(nil)).Elem(), KeysArray{})
pulumi.RegisterInputType(reflect.TypeOf((*KeysMapInput)(nil)).Elem(), KeysMap{})
pulumi.RegisterOutputType(KeysOutput{})
pulumi.RegisterOutputType(KeysArrayOutput{})
pulumi.RegisterOutputType(KeysMapOutput{})
}