/
recoveryGroup.go
275 lines (229 loc) · 10.2 KB
/
recoveryGroup.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
// *** 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 route53recoveryreadiness
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AWS Route 53 Recovery Readiness Recovery Group.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53recoveryreadiness"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := route53recoveryreadiness.NewRecoveryGroup(ctx, "example", &route53recoveryreadiness.RecoveryGroupArgs{
// RecoveryGroupName: pulumi.String("my-high-availability-app"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Route53 Recovery Readiness recovery groups can be imported via the recovery group name, e.g.,
//
// ```sh
// $ pulumi import aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup my-high-availability-app my-high-availability-app
// ```
type RecoveryGroup struct {
pulumi.CustomResourceState
// ARN of the recovery group
Arn pulumi.StringOutput `pulumi:"arn"`
// List of cell arns to add as nested fault domains within this recovery group
Cells pulumi.StringArrayOutput `pulumi:"cells"`
// A unique name describing the recovery group.
RecoveryGroupName pulumi.StringOutput `pulumi:"recoveryGroupName"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
}
// NewRecoveryGroup registers a new resource with the given unique name, arguments, and options.
func NewRecoveryGroup(ctx *pulumi.Context,
name string, args *RecoveryGroupArgs, opts ...pulumi.ResourceOption) (*RecoveryGroup, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.RecoveryGroupName == nil {
return nil, errors.New("invalid value for required argument 'RecoveryGroupName'")
}
var resource RecoveryGroup
err := ctx.RegisterResource("aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRecoveryGroup gets an existing RecoveryGroup 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 GetRecoveryGroup(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RecoveryGroupState, opts ...pulumi.ResourceOption) (*RecoveryGroup, error) {
var resource RecoveryGroup
err := ctx.ReadResource("aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RecoveryGroup resources.
type recoveryGroupState struct {
// ARN of the recovery group
Arn *string `pulumi:"arn"`
// List of cell arns to add as nested fault domains within this recovery group
Cells []string `pulumi:"cells"`
// A unique name describing the recovery group.
RecoveryGroupName *string `pulumi:"recoveryGroupName"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll map[string]string `pulumi:"tagsAll"`
}
type RecoveryGroupState struct {
// ARN of the recovery group
Arn pulumi.StringPtrInput
// List of cell arns to add as nested fault domains within this recovery group
Cells pulumi.StringArrayInput
// A unique name describing the recovery group.
RecoveryGroupName pulumi.StringPtrInput
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
TagsAll pulumi.StringMapInput
}
func (RecoveryGroupState) ElementType() reflect.Type {
return reflect.TypeOf((*recoveryGroupState)(nil)).Elem()
}
type recoveryGroupArgs struct {
// List of cell arns to add as nested fault domains within this recovery group
Cells []string `pulumi:"cells"`
// A unique name describing the recovery group.
RecoveryGroupName string `pulumi:"recoveryGroupName"`
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a RecoveryGroup resource.
type RecoveryGroupArgs struct {
// List of cell arns to add as nested fault domains within this recovery group
Cells pulumi.StringArrayInput
// A unique name describing the recovery group.
RecoveryGroupName pulumi.StringInput
// Key-value mapping of resource tags. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
}
func (RecoveryGroupArgs) ElementType() reflect.Type {
return reflect.TypeOf((*recoveryGroupArgs)(nil)).Elem()
}
type RecoveryGroupInput interface {
pulumi.Input
ToRecoveryGroupOutput() RecoveryGroupOutput
ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput
}
func (*RecoveryGroup) ElementType() reflect.Type {
return reflect.TypeOf((**RecoveryGroup)(nil)).Elem()
}
func (i *RecoveryGroup) ToRecoveryGroupOutput() RecoveryGroupOutput {
return i.ToRecoveryGroupOutputWithContext(context.Background())
}
func (i *RecoveryGroup) ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput {
return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupOutput)
}
// RecoveryGroupArrayInput is an input type that accepts RecoveryGroupArray and RecoveryGroupArrayOutput values.
// You can construct a concrete instance of `RecoveryGroupArrayInput` via:
//
// RecoveryGroupArray{ RecoveryGroupArgs{...} }
type RecoveryGroupArrayInput interface {
pulumi.Input
ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput
ToRecoveryGroupArrayOutputWithContext(context.Context) RecoveryGroupArrayOutput
}
type RecoveryGroupArray []RecoveryGroupInput
func (RecoveryGroupArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RecoveryGroup)(nil)).Elem()
}
func (i RecoveryGroupArray) ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput {
return i.ToRecoveryGroupArrayOutputWithContext(context.Background())
}
func (i RecoveryGroupArray) ToRecoveryGroupArrayOutputWithContext(ctx context.Context) RecoveryGroupArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupArrayOutput)
}
// RecoveryGroupMapInput is an input type that accepts RecoveryGroupMap and RecoveryGroupMapOutput values.
// You can construct a concrete instance of `RecoveryGroupMapInput` via:
//
// RecoveryGroupMap{ "key": RecoveryGroupArgs{...} }
type RecoveryGroupMapInput interface {
pulumi.Input
ToRecoveryGroupMapOutput() RecoveryGroupMapOutput
ToRecoveryGroupMapOutputWithContext(context.Context) RecoveryGroupMapOutput
}
type RecoveryGroupMap map[string]RecoveryGroupInput
func (RecoveryGroupMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RecoveryGroup)(nil)).Elem()
}
func (i RecoveryGroupMap) ToRecoveryGroupMapOutput() RecoveryGroupMapOutput {
return i.ToRecoveryGroupMapOutputWithContext(context.Background())
}
func (i RecoveryGroupMap) ToRecoveryGroupMapOutputWithContext(ctx context.Context) RecoveryGroupMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupMapOutput)
}
type RecoveryGroupOutput struct{ *pulumi.OutputState }
func (RecoveryGroupOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RecoveryGroup)(nil)).Elem()
}
func (o RecoveryGroupOutput) ToRecoveryGroupOutput() RecoveryGroupOutput {
return o
}
func (o RecoveryGroupOutput) ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput {
return o
}
type RecoveryGroupArrayOutput struct{ *pulumi.OutputState }
func (RecoveryGroupArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RecoveryGroup)(nil)).Elem()
}
func (o RecoveryGroupArrayOutput) ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput {
return o
}
func (o RecoveryGroupArrayOutput) ToRecoveryGroupArrayOutputWithContext(ctx context.Context) RecoveryGroupArrayOutput {
return o
}
func (o RecoveryGroupArrayOutput) Index(i pulumi.IntInput) RecoveryGroupOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RecoveryGroup {
return vs[0].([]*RecoveryGroup)[vs[1].(int)]
}).(RecoveryGroupOutput)
}
type RecoveryGroupMapOutput struct{ *pulumi.OutputState }
func (RecoveryGroupMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RecoveryGroup)(nil)).Elem()
}
func (o RecoveryGroupMapOutput) ToRecoveryGroupMapOutput() RecoveryGroupMapOutput {
return o
}
func (o RecoveryGroupMapOutput) ToRecoveryGroupMapOutputWithContext(ctx context.Context) RecoveryGroupMapOutput {
return o
}
func (o RecoveryGroupMapOutput) MapIndex(k pulumi.StringInput) RecoveryGroupOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RecoveryGroup {
return vs[0].(map[string]*RecoveryGroup)[vs[1].(string)]
}).(RecoveryGroupOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupInput)(nil)).Elem(), &RecoveryGroup{})
pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupArrayInput)(nil)).Elem(), RecoveryGroupArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupMapInput)(nil)).Elem(), RecoveryGroupMap{})
pulumi.RegisterOutputType(RecoveryGroupOutput{})
pulumi.RegisterOutputType(RecoveryGroupArrayOutput{})
pulumi.RegisterOutputType(RecoveryGroupMapOutput{})
}