/
routingControl.go
297 lines (251 loc) · 10.6 KB
/
routingControl.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
// *** 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 route53recoverycontrol
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides an AWS Route 53 Recovery Control Config Routing Control.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53recoverycontrol"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := route53recoverycontrol.NewRoutingControl(ctx, "example", &route53recoverycontrol.RoutingControlArgs{
// ClusterArn: pulumi.String("arn:aws:route53-recovery-control::881188118811:cluster/8d47920e-d789-437d-803a-2dcc4b204393"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-aws/sdk/v4/go/aws/route53recoverycontrol"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := route53recoverycontrol.NewRoutingControl(ctx, "example", &route53recoverycontrol.RoutingControlArgs{
// ClusterArn: pulumi.String("arn:aws:route53-recovery-control::881188118811:cluster/8d47920e-d789-437d-803a-2dcc4b204393"),
// ControlPanelArn: pulumi.String("arn:aws:route53-recovery-control::428113431245:controlpanel/abd5fbfc052d4844a082dbf400f61da8"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
//
// ## Import
//
// Route53 Recovery Control Config Routing Control can be imported via the routing control arn, e.g.,
//
// ```sh
// $ pulumi import aws:route53recoverycontrol/routingControl:RoutingControl mycontrol arn:aws:route53-recovery-control::313517334327:controlpanel/abd5fbfc052d4844a082dbf400f61da8/routingcontrol/d5d90e587870494b
// ```
type RoutingControl struct {
pulumi.CustomResourceState
// ARN of the routing control.
Arn pulumi.StringOutput `pulumi:"arn"`
// ARN of the cluster in which this routing control will reside.
ClusterArn pulumi.StringOutput `pulumi:"clusterArn"`
// ARN of the control panel in which this routing control will reside.
ControlPanelArn pulumi.StringOutput `pulumi:"controlPanelArn"`
// The name describing the routing control.
Name pulumi.StringOutput `pulumi:"name"`
// Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
Status pulumi.StringOutput `pulumi:"status"`
}
// NewRoutingControl registers a new resource with the given unique name, arguments, and options.
func NewRoutingControl(ctx *pulumi.Context,
name string, args *RoutingControlArgs, opts ...pulumi.ResourceOption) (*RoutingControl, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ClusterArn == nil {
return nil, errors.New("invalid value for required argument 'ClusterArn'")
}
var resource RoutingControl
err := ctx.RegisterResource("aws:route53recoverycontrol/routingControl:RoutingControl", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRoutingControl gets an existing RoutingControl 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 GetRoutingControl(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RoutingControlState, opts ...pulumi.ResourceOption) (*RoutingControl, error) {
var resource RoutingControl
err := ctx.ReadResource("aws:route53recoverycontrol/routingControl:RoutingControl", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering RoutingControl resources.
type routingControlState struct {
// ARN of the routing control.
Arn *string `pulumi:"arn"`
// ARN of the cluster in which this routing control will reside.
ClusterArn *string `pulumi:"clusterArn"`
// ARN of the control panel in which this routing control will reside.
ControlPanelArn *string `pulumi:"controlPanelArn"`
// The name describing the routing control.
Name *string `pulumi:"name"`
// Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
Status *string `pulumi:"status"`
}
type RoutingControlState struct {
// ARN of the routing control.
Arn pulumi.StringPtrInput
// ARN of the cluster in which this routing control will reside.
ClusterArn pulumi.StringPtrInput
// ARN of the control panel in which this routing control will reside.
ControlPanelArn pulumi.StringPtrInput
// The name describing the routing control.
Name pulumi.StringPtrInput
// Status of routing control. `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
Status pulumi.StringPtrInput
}
func (RoutingControlState) ElementType() reflect.Type {
return reflect.TypeOf((*routingControlState)(nil)).Elem()
}
type routingControlArgs struct {
// ARN of the cluster in which this routing control will reside.
ClusterArn string `pulumi:"clusterArn"`
// ARN of the control panel in which this routing control will reside.
ControlPanelArn *string `pulumi:"controlPanelArn"`
// The name describing the routing control.
Name *string `pulumi:"name"`
}
// The set of arguments for constructing a RoutingControl resource.
type RoutingControlArgs struct {
// ARN of the cluster in which this routing control will reside.
ClusterArn pulumi.StringInput
// ARN of the control panel in which this routing control will reside.
ControlPanelArn pulumi.StringPtrInput
// The name describing the routing control.
Name pulumi.StringPtrInput
}
func (RoutingControlArgs) ElementType() reflect.Type {
return reflect.TypeOf((*routingControlArgs)(nil)).Elem()
}
type RoutingControlInput interface {
pulumi.Input
ToRoutingControlOutput() RoutingControlOutput
ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput
}
func (*RoutingControl) ElementType() reflect.Type {
return reflect.TypeOf((**RoutingControl)(nil)).Elem()
}
func (i *RoutingControl) ToRoutingControlOutput() RoutingControlOutput {
return i.ToRoutingControlOutputWithContext(context.Background())
}
func (i *RoutingControl) ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput {
return pulumi.ToOutputWithContext(ctx, i).(RoutingControlOutput)
}
// RoutingControlArrayInput is an input type that accepts RoutingControlArray and RoutingControlArrayOutput values.
// You can construct a concrete instance of `RoutingControlArrayInput` via:
//
// RoutingControlArray{ RoutingControlArgs{...} }
type RoutingControlArrayInput interface {
pulumi.Input
ToRoutingControlArrayOutput() RoutingControlArrayOutput
ToRoutingControlArrayOutputWithContext(context.Context) RoutingControlArrayOutput
}
type RoutingControlArray []RoutingControlInput
func (RoutingControlArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RoutingControl)(nil)).Elem()
}
func (i RoutingControlArray) ToRoutingControlArrayOutput() RoutingControlArrayOutput {
return i.ToRoutingControlArrayOutputWithContext(context.Background())
}
func (i RoutingControlArray) ToRoutingControlArrayOutputWithContext(ctx context.Context) RoutingControlArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(RoutingControlArrayOutput)
}
// RoutingControlMapInput is an input type that accepts RoutingControlMap and RoutingControlMapOutput values.
// You can construct a concrete instance of `RoutingControlMapInput` via:
//
// RoutingControlMap{ "key": RoutingControlArgs{...} }
type RoutingControlMapInput interface {
pulumi.Input
ToRoutingControlMapOutput() RoutingControlMapOutput
ToRoutingControlMapOutputWithContext(context.Context) RoutingControlMapOutput
}
type RoutingControlMap map[string]RoutingControlInput
func (RoutingControlMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RoutingControl)(nil)).Elem()
}
func (i RoutingControlMap) ToRoutingControlMapOutput() RoutingControlMapOutput {
return i.ToRoutingControlMapOutputWithContext(context.Background())
}
func (i RoutingControlMap) ToRoutingControlMapOutputWithContext(ctx context.Context) RoutingControlMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(RoutingControlMapOutput)
}
type RoutingControlOutput struct{ *pulumi.OutputState }
func (RoutingControlOutput) ElementType() reflect.Type {
return reflect.TypeOf((**RoutingControl)(nil)).Elem()
}
func (o RoutingControlOutput) ToRoutingControlOutput() RoutingControlOutput {
return o
}
func (o RoutingControlOutput) ToRoutingControlOutputWithContext(ctx context.Context) RoutingControlOutput {
return o
}
type RoutingControlArrayOutput struct{ *pulumi.OutputState }
func (RoutingControlArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*RoutingControl)(nil)).Elem()
}
func (o RoutingControlArrayOutput) ToRoutingControlArrayOutput() RoutingControlArrayOutput {
return o
}
func (o RoutingControlArrayOutput) ToRoutingControlArrayOutputWithContext(ctx context.Context) RoutingControlArrayOutput {
return o
}
func (o RoutingControlArrayOutput) Index(i pulumi.IntInput) RoutingControlOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RoutingControl {
return vs[0].([]*RoutingControl)[vs[1].(int)]
}).(RoutingControlOutput)
}
type RoutingControlMapOutput struct{ *pulumi.OutputState }
func (RoutingControlMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*RoutingControl)(nil)).Elem()
}
func (o RoutingControlMapOutput) ToRoutingControlMapOutput() RoutingControlMapOutput {
return o
}
func (o RoutingControlMapOutput) ToRoutingControlMapOutputWithContext(ctx context.Context) RoutingControlMapOutput {
return o
}
func (o RoutingControlMapOutput) MapIndex(k pulumi.StringInput) RoutingControlOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RoutingControl {
return vs[0].(map[string]*RoutingControl)[vs[1].(string)]
}).(RoutingControlOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlInput)(nil)).Elem(), &RoutingControl{})
pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlArrayInput)(nil)).Elem(), RoutingControlArray{})
pulumi.RegisterInputType(reflect.TypeOf((*RoutingControlMapInput)(nil)).Elem(), RoutingControlMap{})
pulumi.RegisterOutputType(RoutingControlOutput{})
pulumi.RegisterOutputType(RoutingControlArrayOutput{})
pulumi.RegisterOutputType(RoutingControlMapOutput{})
}