/
rdsDbInstance.go
307 lines (257 loc) · 10.4 KB
/
rdsDbInstance.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
// 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 opsworks
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an OpsWorks RDS DB Instance resource.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v5/go/aws/opsworks"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := opsworks.NewRdsDbInstance(ctx, "myInstance", &opsworks.RdsDbInstanceArgs{
// StackId: pulumi.Any(aws_opsworks_stack.My_stack.Id),
// RdsDbInstanceArn: pulumi.Any(aws_db_instance.My_instance.Arn),
// DbUser: pulumi.String("someUser"),
// DbPassword: pulumi.String("somePass"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
type RdsDbInstance struct {
pulumi.CustomResourceState
// A db password
DbPassword pulumi.StringOutput `pulumi:"dbPassword"`
// A db username
DbUser pulumi.StringOutput `pulumi:"dbUser"`
// The db instance to register for this stack. Changing this will force a new resource.
RdsDbInstanceArn pulumi.StringOutput `pulumi:"rdsDbInstanceArn"`
// The stack to register a db instance for. Changing this will force a new resource.
StackId pulumi.StringOutput `pulumi:"stackId"`
}
// NewRdsDbInstance registers a new resource with the given unique name, arguments, and options.
func NewRdsDbInstance(ctx *pulumi.Context,
name string, args *RdsDbInstanceArgs, opts ...pulumi.ResourceOption) (*RdsDbInstance, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DbPassword == nil {
return nil, errors.New("invalid value for required argument 'DbPassword'")
}
if args.DbUser == nil {
return nil, errors.New("invalid value for required argument 'DbUser'")
}
if args.RdsDbInstanceArn == nil {
return nil, errors.New("invalid value for required argument 'RdsDbInstanceArn'")
}
if args.StackId == nil {
return nil, errors.New("invalid value for required argument 'StackId'")
}
if args.DbPassword != nil {
args.DbPassword = pulumi.ToSecret(args.DbPassword).(pulumi.StringInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"dbPassword",
})
opts = append(opts, secrets)
var resource RdsDbInstance
err := ctx.RegisterResource("aws:opsworks/rdsDbInstance:RdsDbInstance", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRdsDbInstance gets an existing RdsDbInstance 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 GetRdsDbInstance(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RdsDbInstanceState, opts ...pulumi.ResourceOption) (*RdsDbInstance, error) {
var resource RdsDbInstance
err := ctx.ReadResource("aws:opsworks/rdsDbInstance:RdsDbInstance", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RdsDbInstance resources.
type rdsDbInstanceState struct {
// A db password
DbPassword *string `pulumi:"dbPassword"`
// A db username
DbUser *string `pulumi:"dbUser"`
// The db instance to register for this stack. Changing this will force a new resource.
RdsDbInstanceArn *string `pulumi:"rdsDbInstanceArn"`
// The stack to register a db instance for. Changing this will force a new resource.
StackId *string `pulumi:"stackId"`
}
type RdsDbInstanceState struct {
// A db password
DbPassword pulumi.StringPtrInput
// A db username
DbUser pulumi.StringPtrInput
// The db instance to register for this stack. Changing this will force a new resource.
RdsDbInstanceArn pulumi.StringPtrInput
// The stack to register a db instance for. Changing this will force a new resource.
StackId pulumi.StringPtrInput
}
func (RdsDbInstanceState) ElementType() reflect.Type {
return reflect.TypeOf((*rdsDbInstanceState)(nil)).Elem()
}
type rdsDbInstanceArgs struct {
// A db password
DbPassword string `pulumi:"dbPassword"`
// A db username
DbUser string `pulumi:"dbUser"`
// The db instance to register for this stack. Changing this will force a new resource.
RdsDbInstanceArn string `pulumi:"rdsDbInstanceArn"`
// The stack to register a db instance for. Changing this will force a new resource.
StackId string `pulumi:"stackId"`
}
// The set of arguments for constructing a RdsDbInstance resource.
type RdsDbInstanceArgs struct {
// A db password
DbPassword pulumi.StringInput
// A db username
DbUser pulumi.StringInput
// The db instance to register for this stack. Changing this will force a new resource.
RdsDbInstanceArn pulumi.StringInput
// The stack to register a db instance for. Changing this will force a new resource.
StackId pulumi.StringInput
}
func (RdsDbInstanceArgs) ElementType() reflect.Type {
return reflect.TypeOf((*rdsDbInstanceArgs)(nil)).Elem()
}
type RdsDbInstanceInput interface {
pulumi.Input
ToRdsDbInstanceOutput() RdsDbInstanceOutput
ToRdsDbInstanceOutputWithContext(ctx context.Context) RdsDbInstanceOutput
}
func (*RdsDbInstance) ElementType() reflect.Type {
return reflect.TypeOf((**RdsDbInstance)(nil)).Elem()
}
func (i *RdsDbInstance) ToRdsDbInstanceOutput() RdsDbInstanceOutput {
return i.ToRdsDbInstanceOutputWithContext(context.Background())
}
func (i *RdsDbInstance) ToRdsDbInstanceOutputWithContext(ctx context.Context) RdsDbInstanceOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsDbInstanceOutput)
}
// RdsDbInstanceArrayInput is an input type that accepts RdsDbInstanceArray and RdsDbInstanceArrayOutput values.
// You can construct a concrete instance of `RdsDbInstanceArrayInput` via:
//
// RdsDbInstanceArray{ RdsDbInstanceArgs{...} }
type RdsDbInstanceArrayInput interface {
pulumi.Input
ToRdsDbInstanceArrayOutput() RdsDbInstanceArrayOutput
ToRdsDbInstanceArrayOutputWithContext(context.Context) RdsDbInstanceArrayOutput
}
type RdsDbInstanceArray []RdsDbInstanceInput
func (RdsDbInstanceArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RdsDbInstance)(nil)).Elem()
}
func (i RdsDbInstanceArray) ToRdsDbInstanceArrayOutput() RdsDbInstanceArrayOutput {
return i.ToRdsDbInstanceArrayOutputWithContext(context.Background())
}
func (i RdsDbInstanceArray) ToRdsDbInstanceArrayOutputWithContext(ctx context.Context) RdsDbInstanceArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsDbInstanceArrayOutput)
}
// RdsDbInstanceMapInput is an input type that accepts RdsDbInstanceMap and RdsDbInstanceMapOutput values.
// You can construct a concrete instance of `RdsDbInstanceMapInput` via:
//
// RdsDbInstanceMap{ "key": RdsDbInstanceArgs{...} }
type RdsDbInstanceMapInput interface {
pulumi.Input
ToRdsDbInstanceMapOutput() RdsDbInstanceMapOutput
ToRdsDbInstanceMapOutputWithContext(context.Context) RdsDbInstanceMapOutput
}
type RdsDbInstanceMap map[string]RdsDbInstanceInput
func (RdsDbInstanceMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RdsDbInstance)(nil)).Elem()
}
func (i RdsDbInstanceMap) ToRdsDbInstanceMapOutput() RdsDbInstanceMapOutput {
return i.ToRdsDbInstanceMapOutputWithContext(context.Background())
}
func (i RdsDbInstanceMap) ToRdsDbInstanceMapOutputWithContext(ctx context.Context) RdsDbInstanceMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RdsDbInstanceMapOutput)
}
type RdsDbInstanceOutput struct{ *pulumi.OutputState }
func (RdsDbInstanceOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RdsDbInstance)(nil)).Elem()
}
func (o RdsDbInstanceOutput) ToRdsDbInstanceOutput() RdsDbInstanceOutput {
return o
}
func (o RdsDbInstanceOutput) ToRdsDbInstanceOutputWithContext(ctx context.Context) RdsDbInstanceOutput {
return o
}
// A db password
func (o RdsDbInstanceOutput) DbPassword() pulumi.StringOutput {
return o.ApplyT(func(v *RdsDbInstance) pulumi.StringOutput { return v.DbPassword }).(pulumi.StringOutput)
}
// A db username
func (o RdsDbInstanceOutput) DbUser() pulumi.StringOutput {
return o.ApplyT(func(v *RdsDbInstance) pulumi.StringOutput { return v.DbUser }).(pulumi.StringOutput)
}
// The db instance to register for this stack. Changing this will force a new resource.
func (o RdsDbInstanceOutput) RdsDbInstanceArn() pulumi.StringOutput {
return o.ApplyT(func(v *RdsDbInstance) pulumi.StringOutput { return v.RdsDbInstanceArn }).(pulumi.StringOutput)
}
// The stack to register a db instance for. Changing this will force a new resource.
func (o RdsDbInstanceOutput) StackId() pulumi.StringOutput {
return o.ApplyT(func(v *RdsDbInstance) pulumi.StringOutput { return v.StackId }).(pulumi.StringOutput)
}
type RdsDbInstanceArrayOutput struct{ *pulumi.OutputState }
func (RdsDbInstanceArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RdsDbInstance)(nil)).Elem()
}
func (o RdsDbInstanceArrayOutput) ToRdsDbInstanceArrayOutput() RdsDbInstanceArrayOutput {
return o
}
func (o RdsDbInstanceArrayOutput) ToRdsDbInstanceArrayOutputWithContext(ctx context.Context) RdsDbInstanceArrayOutput {
return o
}
func (o RdsDbInstanceArrayOutput) Index(i pulumi.IntInput) RdsDbInstanceOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RdsDbInstance {
return vs[0].([]*RdsDbInstance)[vs[1].(int)]
}).(RdsDbInstanceOutput)
}
type RdsDbInstanceMapOutput struct{ *pulumi.OutputState }
func (RdsDbInstanceMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RdsDbInstance)(nil)).Elem()
}
func (o RdsDbInstanceMapOutput) ToRdsDbInstanceMapOutput() RdsDbInstanceMapOutput {
return o
}
func (o RdsDbInstanceMapOutput) ToRdsDbInstanceMapOutputWithContext(ctx context.Context) RdsDbInstanceMapOutput {
return o
}
func (o RdsDbInstanceMapOutput) MapIndex(k pulumi.StringInput) RdsDbInstanceOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RdsDbInstance {
return vs[0].(map[string]*RdsDbInstance)[vs[1].(string)]
}).(RdsDbInstanceOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RdsDbInstanceInput)(nil)).Elem(), &RdsDbInstance{})
pulumi.RegisterInputType(reflect.TypeOf((*RdsDbInstanceArrayInput)(nil)).Elem(), RdsDbInstanceArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RdsDbInstanceMapInput)(nil)).Elem(), RdsDbInstanceMap{})
pulumi.RegisterOutputType(RdsDbInstanceOutput{})
pulumi.RegisterOutputType(RdsDbInstanceArrayOutput{})
pulumi.RegisterOutputType(RdsDbInstanceMapOutput{})
}