/
encryptionAtRest.go
253 lines (203 loc) · 10 KB
/
encryptionAtRest.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
// 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"
"errors"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Import
//
// Encryption at Rest Settings can be imported using project ID, in the format `project_id`, e.g.
//
// ```sh
// $ pulumi import mongodbatlas:index/encryptionAtRest:EncryptionAtRest example 1112222b3bf99403840e8934
// ```
// For more information see: [MongoDB Atlas API Reference for Encryption at Rest using Customer Key Management.](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Encryption-at-Rest-using-Customer-Key-Management)
type EncryptionAtRest struct {
pulumi.CustomResourceState
AwsKmsConfig EncryptionAtRestAwsKmsConfigPtrOutput `pulumi:"awsKmsConfig"`
AzureKeyVaultConfig EncryptionAtRestAzureKeyVaultConfigPtrOutput `pulumi:"azureKeyVaultConfig"`
GoogleCloudKmsConfig EncryptionAtRestGoogleCloudKmsConfigPtrOutput `pulumi:"googleCloudKmsConfig"`
// The unique identifier for the project.
ProjectId pulumi.StringOutput `pulumi:"projectId"`
}
// NewEncryptionAtRest registers a new resource with the given unique name, arguments, and options.
func NewEncryptionAtRest(ctx *pulumi.Context,
name string, args *EncryptionAtRestArgs, opts ...pulumi.ResourceOption) (*EncryptionAtRest, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ProjectId == nil {
return nil, errors.New("invalid value for required argument 'ProjectId'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource EncryptionAtRest
err := ctx.RegisterResource("mongodbatlas:index/encryptionAtRest:EncryptionAtRest", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEncryptionAtRest gets an existing EncryptionAtRest 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 GetEncryptionAtRest(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EncryptionAtRestState, opts ...pulumi.ResourceOption) (*EncryptionAtRest, error) {
var resource EncryptionAtRest
err := ctx.ReadResource("mongodbatlas:index/encryptionAtRest:EncryptionAtRest", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EncryptionAtRest resources.
type encryptionAtRestState struct {
AwsKmsConfig *EncryptionAtRestAwsKmsConfig `pulumi:"awsKmsConfig"`
AzureKeyVaultConfig *EncryptionAtRestAzureKeyVaultConfig `pulumi:"azureKeyVaultConfig"`
GoogleCloudKmsConfig *EncryptionAtRestGoogleCloudKmsConfig `pulumi:"googleCloudKmsConfig"`
// The unique identifier for the project.
ProjectId *string `pulumi:"projectId"`
}
type EncryptionAtRestState struct {
AwsKmsConfig EncryptionAtRestAwsKmsConfigPtrInput
AzureKeyVaultConfig EncryptionAtRestAzureKeyVaultConfigPtrInput
GoogleCloudKmsConfig EncryptionAtRestGoogleCloudKmsConfigPtrInput
// The unique identifier for the project.
ProjectId pulumi.StringPtrInput
}
func (EncryptionAtRestState) ElementType() reflect.Type {
return reflect.TypeOf((*encryptionAtRestState)(nil)).Elem()
}
type encryptionAtRestArgs struct {
AwsKmsConfig *EncryptionAtRestAwsKmsConfig `pulumi:"awsKmsConfig"`
AzureKeyVaultConfig *EncryptionAtRestAzureKeyVaultConfig `pulumi:"azureKeyVaultConfig"`
GoogleCloudKmsConfig *EncryptionAtRestGoogleCloudKmsConfig `pulumi:"googleCloudKmsConfig"`
// The unique identifier for the project.
ProjectId string `pulumi:"projectId"`
}
// The set of arguments for constructing a EncryptionAtRest resource.
type EncryptionAtRestArgs struct {
AwsKmsConfig EncryptionAtRestAwsKmsConfigPtrInput
AzureKeyVaultConfig EncryptionAtRestAzureKeyVaultConfigPtrInput
GoogleCloudKmsConfig EncryptionAtRestGoogleCloudKmsConfigPtrInput
// The unique identifier for the project.
ProjectId pulumi.StringInput
}
func (EncryptionAtRestArgs) ElementType() reflect.Type {
return reflect.TypeOf((*encryptionAtRestArgs)(nil)).Elem()
}
type EncryptionAtRestInput interface {
pulumi.Input
ToEncryptionAtRestOutput() EncryptionAtRestOutput
ToEncryptionAtRestOutputWithContext(ctx context.Context) EncryptionAtRestOutput
}
func (*EncryptionAtRest) ElementType() reflect.Type {
return reflect.TypeOf((**EncryptionAtRest)(nil)).Elem()
}
func (i *EncryptionAtRest) ToEncryptionAtRestOutput() EncryptionAtRestOutput {
return i.ToEncryptionAtRestOutputWithContext(context.Background())
}
func (i *EncryptionAtRest) ToEncryptionAtRestOutputWithContext(ctx context.Context) EncryptionAtRestOutput {
return pulumi.ToOutputWithContext(ctx, i).(EncryptionAtRestOutput)
}
// EncryptionAtRestArrayInput is an input type that accepts EncryptionAtRestArray and EncryptionAtRestArrayOutput values.
// You can construct a concrete instance of `EncryptionAtRestArrayInput` via:
//
// EncryptionAtRestArray{ EncryptionAtRestArgs{...} }
type EncryptionAtRestArrayInput interface {
pulumi.Input
ToEncryptionAtRestArrayOutput() EncryptionAtRestArrayOutput
ToEncryptionAtRestArrayOutputWithContext(context.Context) EncryptionAtRestArrayOutput
}
type EncryptionAtRestArray []EncryptionAtRestInput
func (EncryptionAtRestArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EncryptionAtRest)(nil)).Elem()
}
func (i EncryptionAtRestArray) ToEncryptionAtRestArrayOutput() EncryptionAtRestArrayOutput {
return i.ToEncryptionAtRestArrayOutputWithContext(context.Background())
}
func (i EncryptionAtRestArray) ToEncryptionAtRestArrayOutputWithContext(ctx context.Context) EncryptionAtRestArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(EncryptionAtRestArrayOutput)
}
// EncryptionAtRestMapInput is an input type that accepts EncryptionAtRestMap and EncryptionAtRestMapOutput values.
// You can construct a concrete instance of `EncryptionAtRestMapInput` via:
//
// EncryptionAtRestMap{ "key": EncryptionAtRestArgs{...} }
type EncryptionAtRestMapInput interface {
pulumi.Input
ToEncryptionAtRestMapOutput() EncryptionAtRestMapOutput
ToEncryptionAtRestMapOutputWithContext(context.Context) EncryptionAtRestMapOutput
}
type EncryptionAtRestMap map[string]EncryptionAtRestInput
func (EncryptionAtRestMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EncryptionAtRest)(nil)).Elem()
}
func (i EncryptionAtRestMap) ToEncryptionAtRestMapOutput() EncryptionAtRestMapOutput {
return i.ToEncryptionAtRestMapOutputWithContext(context.Background())
}
func (i EncryptionAtRestMap) ToEncryptionAtRestMapOutputWithContext(ctx context.Context) EncryptionAtRestMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(EncryptionAtRestMapOutput)
}
type EncryptionAtRestOutput struct{ *pulumi.OutputState }
func (EncryptionAtRestOutput) ElementType() reflect.Type {
return reflect.TypeOf((**EncryptionAtRest)(nil)).Elem()
}
func (o EncryptionAtRestOutput) ToEncryptionAtRestOutput() EncryptionAtRestOutput {
return o
}
func (o EncryptionAtRestOutput) ToEncryptionAtRestOutputWithContext(ctx context.Context) EncryptionAtRestOutput {
return o
}
func (o EncryptionAtRestOutput) AwsKmsConfig() EncryptionAtRestAwsKmsConfigPtrOutput {
return o.ApplyT(func(v *EncryptionAtRest) EncryptionAtRestAwsKmsConfigPtrOutput { return v.AwsKmsConfig }).(EncryptionAtRestAwsKmsConfigPtrOutput)
}
func (o EncryptionAtRestOutput) AzureKeyVaultConfig() EncryptionAtRestAzureKeyVaultConfigPtrOutput {
return o.ApplyT(func(v *EncryptionAtRest) EncryptionAtRestAzureKeyVaultConfigPtrOutput { return v.AzureKeyVaultConfig }).(EncryptionAtRestAzureKeyVaultConfigPtrOutput)
}
func (o EncryptionAtRestOutput) GoogleCloudKmsConfig() EncryptionAtRestGoogleCloudKmsConfigPtrOutput {
return o.ApplyT(func(v *EncryptionAtRest) EncryptionAtRestGoogleCloudKmsConfigPtrOutput { return v.GoogleCloudKmsConfig }).(EncryptionAtRestGoogleCloudKmsConfigPtrOutput)
}
// The unique identifier for the project.
func (o EncryptionAtRestOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v *EncryptionAtRest) pulumi.StringOutput { return v.ProjectId }).(pulumi.StringOutput)
}
type EncryptionAtRestArrayOutput struct{ *pulumi.OutputState }
func (EncryptionAtRestArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*EncryptionAtRest)(nil)).Elem()
}
func (o EncryptionAtRestArrayOutput) ToEncryptionAtRestArrayOutput() EncryptionAtRestArrayOutput {
return o
}
func (o EncryptionAtRestArrayOutput) ToEncryptionAtRestArrayOutputWithContext(ctx context.Context) EncryptionAtRestArrayOutput {
return o
}
func (o EncryptionAtRestArrayOutput) Index(i pulumi.IntInput) EncryptionAtRestOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EncryptionAtRest {
return vs[0].([]*EncryptionAtRest)[vs[1].(int)]
}).(EncryptionAtRestOutput)
}
type EncryptionAtRestMapOutput struct{ *pulumi.OutputState }
func (EncryptionAtRestMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*EncryptionAtRest)(nil)).Elem()
}
func (o EncryptionAtRestMapOutput) ToEncryptionAtRestMapOutput() EncryptionAtRestMapOutput {
return o
}
func (o EncryptionAtRestMapOutput) ToEncryptionAtRestMapOutputWithContext(ctx context.Context) EncryptionAtRestMapOutput {
return o
}
func (o EncryptionAtRestMapOutput) MapIndex(k pulumi.StringInput) EncryptionAtRestOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EncryptionAtRest {
return vs[0].(map[string]*EncryptionAtRest)[vs[1].(string)]
}).(EncryptionAtRestOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*EncryptionAtRestInput)(nil)).Elem(), &EncryptionAtRest{})
pulumi.RegisterInputType(reflect.TypeOf((*EncryptionAtRestArrayInput)(nil)).Elem(), EncryptionAtRestArray{})
pulumi.RegisterInputType(reflect.TypeOf((*EncryptionAtRestMapInput)(nil)).Elem(), EncryptionAtRestMap{})
pulumi.RegisterOutputType(EncryptionAtRestOutput{})
pulumi.RegisterOutputType(EncryptionAtRestArrayOutput{})
pulumi.RegisterOutputType(EncryptionAtRestMapOutput{})
}