github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53recoverycontrol/cluster.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package route53recoverycontrol 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides an AWS Route 53 Recovery Control Config Cluster. 15 // 16 // ## Example Usage 17 // 18 // <!--Start PulumiCodeChooser --> 19 // ```go 20 // package main 21 // 22 // import ( 23 // 24 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53recoverycontrol" 25 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 26 // 27 // ) 28 // 29 // func main() { 30 // pulumi.Run(func(ctx *pulumi.Context) error { 31 // _, err := route53recoverycontrol.NewCluster(ctx, "example", &route53recoverycontrol.ClusterArgs{ 32 // Name: pulumi.String("georgefitzgerald"), 33 // }) 34 // if err != nil { 35 // return err 36 // } 37 // return nil 38 // }) 39 // } 40 // 41 // ``` 42 // <!--End PulumiCodeChooser --> 43 // 44 // ## Import 45 // 46 // Using `pulumi import`, import Route53 Recovery Control Config cluster using the cluster ARN. For example: 47 // 48 // ```sh 49 // $ pulumi import aws:route53recoverycontrol/cluster:Cluster mycluster arn:aws:route53-recovery-control::313517334327:cluster/f9ae13be-a11e-4ec7-8522-94a70468e6ea 50 // ``` 51 type Cluster struct { 52 pulumi.CustomResourceState 53 54 // ARN of the cluster 55 Arn pulumi.StringOutput `pulumi:"arn"` 56 // List of 5 endpoints in 5 regions that can be used to talk to the cluster. See below. 57 ClusterEndpoints ClusterClusterEndpointArrayOutput `pulumi:"clusterEndpoints"` 58 // Unique name describing the cluster. 59 Name pulumi.StringOutput `pulumi:"name"` 60 // Status of cluster. `PENDING` when it is being created, `PENDING_DELETION` when it is being deleted and `DEPLOYED` otherwise. 61 Status pulumi.StringOutput `pulumi:"status"` 62 } 63 64 // NewCluster registers a new resource with the given unique name, arguments, and options. 65 func NewCluster(ctx *pulumi.Context, 66 name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) { 67 if args == nil { 68 args = &ClusterArgs{} 69 } 70 71 opts = internal.PkgResourceDefaultOpts(opts) 72 var resource Cluster 73 err := ctx.RegisterResource("aws:route53recoverycontrol/cluster:Cluster", name, args, &resource, opts...) 74 if err != nil { 75 return nil, err 76 } 77 return &resource, nil 78 } 79 80 // GetCluster gets an existing Cluster resource's state with the given name, ID, and optional 81 // state properties that are used to uniquely qualify the lookup (nil if not required). 82 func GetCluster(ctx *pulumi.Context, 83 name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) { 84 var resource Cluster 85 err := ctx.ReadResource("aws:route53recoverycontrol/cluster:Cluster", name, id, state, &resource, opts...) 86 if err != nil { 87 return nil, err 88 } 89 return &resource, nil 90 } 91 92 // Input properties used for looking up and filtering Cluster resources. 93 type clusterState struct { 94 // ARN of the cluster 95 Arn *string `pulumi:"arn"` 96 // List of 5 endpoints in 5 regions that can be used to talk to the cluster. See below. 97 ClusterEndpoints []ClusterClusterEndpoint `pulumi:"clusterEndpoints"` 98 // Unique name describing the cluster. 99 Name *string `pulumi:"name"` 100 // Status of cluster. `PENDING` when it is being created, `PENDING_DELETION` when it is being deleted and `DEPLOYED` otherwise. 101 Status *string `pulumi:"status"` 102 } 103 104 type ClusterState struct { 105 // ARN of the cluster 106 Arn pulumi.StringPtrInput 107 // List of 5 endpoints in 5 regions that can be used to talk to the cluster. See below. 108 ClusterEndpoints ClusterClusterEndpointArrayInput 109 // Unique name describing the cluster. 110 Name pulumi.StringPtrInput 111 // Status of cluster. `PENDING` when it is being created, `PENDING_DELETION` when it is being deleted and `DEPLOYED` otherwise. 112 Status pulumi.StringPtrInput 113 } 114 115 func (ClusterState) ElementType() reflect.Type { 116 return reflect.TypeOf((*clusterState)(nil)).Elem() 117 } 118 119 type clusterArgs struct { 120 // Unique name describing the cluster. 121 Name *string `pulumi:"name"` 122 } 123 124 // The set of arguments for constructing a Cluster resource. 125 type ClusterArgs struct { 126 // Unique name describing the cluster. 127 Name pulumi.StringPtrInput 128 } 129 130 func (ClusterArgs) ElementType() reflect.Type { 131 return reflect.TypeOf((*clusterArgs)(nil)).Elem() 132 } 133 134 type ClusterInput interface { 135 pulumi.Input 136 137 ToClusterOutput() ClusterOutput 138 ToClusterOutputWithContext(ctx context.Context) ClusterOutput 139 } 140 141 func (*Cluster) ElementType() reflect.Type { 142 return reflect.TypeOf((**Cluster)(nil)).Elem() 143 } 144 145 func (i *Cluster) ToClusterOutput() ClusterOutput { 146 return i.ToClusterOutputWithContext(context.Background()) 147 } 148 149 func (i *Cluster) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 150 return pulumi.ToOutputWithContext(ctx, i).(ClusterOutput) 151 } 152 153 // ClusterArrayInput is an input type that accepts ClusterArray and ClusterArrayOutput values. 154 // You can construct a concrete instance of `ClusterArrayInput` via: 155 // 156 // ClusterArray{ ClusterArgs{...} } 157 type ClusterArrayInput interface { 158 pulumi.Input 159 160 ToClusterArrayOutput() ClusterArrayOutput 161 ToClusterArrayOutputWithContext(context.Context) ClusterArrayOutput 162 } 163 164 type ClusterArray []ClusterInput 165 166 func (ClusterArray) ElementType() reflect.Type { 167 return reflect.TypeOf((*[]*Cluster)(nil)).Elem() 168 } 169 170 func (i ClusterArray) ToClusterArrayOutput() ClusterArrayOutput { 171 return i.ToClusterArrayOutputWithContext(context.Background()) 172 } 173 174 func (i ClusterArray) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput { 175 return pulumi.ToOutputWithContext(ctx, i).(ClusterArrayOutput) 176 } 177 178 // ClusterMapInput is an input type that accepts ClusterMap and ClusterMapOutput values. 179 // You can construct a concrete instance of `ClusterMapInput` via: 180 // 181 // ClusterMap{ "key": ClusterArgs{...} } 182 type ClusterMapInput interface { 183 pulumi.Input 184 185 ToClusterMapOutput() ClusterMapOutput 186 ToClusterMapOutputWithContext(context.Context) ClusterMapOutput 187 } 188 189 type ClusterMap map[string]ClusterInput 190 191 func (ClusterMap) ElementType() reflect.Type { 192 return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem() 193 } 194 195 func (i ClusterMap) ToClusterMapOutput() ClusterMapOutput { 196 return i.ToClusterMapOutputWithContext(context.Background()) 197 } 198 199 func (i ClusterMap) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput { 200 return pulumi.ToOutputWithContext(ctx, i).(ClusterMapOutput) 201 } 202 203 type ClusterOutput struct{ *pulumi.OutputState } 204 205 func (ClusterOutput) ElementType() reflect.Type { 206 return reflect.TypeOf((**Cluster)(nil)).Elem() 207 } 208 209 func (o ClusterOutput) ToClusterOutput() ClusterOutput { 210 return o 211 } 212 213 func (o ClusterOutput) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 214 return o 215 } 216 217 // ARN of the cluster 218 func (o ClusterOutput) Arn() pulumi.StringOutput { 219 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 220 } 221 222 // List of 5 endpoints in 5 regions that can be used to talk to the cluster. See below. 223 func (o ClusterOutput) ClusterEndpoints() ClusterClusterEndpointArrayOutput { 224 return o.ApplyT(func(v *Cluster) ClusterClusterEndpointArrayOutput { return v.ClusterEndpoints }).(ClusterClusterEndpointArrayOutput) 225 } 226 227 // Unique name describing the cluster. 228 func (o ClusterOutput) Name() pulumi.StringOutput { 229 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput) 230 } 231 232 // Status of cluster. `PENDING` when it is being created, `PENDING_DELETION` when it is being deleted and `DEPLOYED` otherwise. 233 func (o ClusterOutput) Status() pulumi.StringOutput { 234 return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput) 235 } 236 237 type ClusterArrayOutput struct{ *pulumi.OutputState } 238 239 func (ClusterArrayOutput) ElementType() reflect.Type { 240 return reflect.TypeOf((*[]*Cluster)(nil)).Elem() 241 } 242 243 func (o ClusterArrayOutput) ToClusterArrayOutput() ClusterArrayOutput { 244 return o 245 } 246 247 func (o ClusterArrayOutput) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput { 248 return o 249 } 250 251 func (o ClusterArrayOutput) Index(i pulumi.IntInput) ClusterOutput { 252 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Cluster { 253 return vs[0].([]*Cluster)[vs[1].(int)] 254 }).(ClusterOutput) 255 } 256 257 type ClusterMapOutput struct{ *pulumi.OutputState } 258 259 func (ClusterMapOutput) ElementType() reflect.Type { 260 return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem() 261 } 262 263 func (o ClusterMapOutput) ToClusterMapOutput() ClusterMapOutput { 264 return o 265 } 266 267 func (o ClusterMapOutput) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput { 268 return o 269 } 270 271 func (o ClusterMapOutput) MapIndex(k pulumi.StringInput) ClusterOutput { 272 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Cluster { 273 return vs[0].(map[string]*Cluster)[vs[1].(string)] 274 }).(ClusterOutput) 275 } 276 277 func init() { 278 pulumi.RegisterInputType(reflect.TypeOf((*ClusterInput)(nil)).Elem(), &Cluster{}) 279 pulumi.RegisterInputType(reflect.TypeOf((*ClusterArrayInput)(nil)).Elem(), ClusterArray{}) 280 pulumi.RegisterInputType(reflect.TypeOf((*ClusterMapInput)(nil)).Elem(), ClusterMap{}) 281 pulumi.RegisterOutputType(ClusterOutput{}) 282 pulumi.RegisterOutputType(ClusterArrayOutput{}) 283 pulumi.RegisterOutputType(ClusterMapOutput{}) 284 }