github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53recoveryreadiness/recoveryGroup.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 route53recoveryreadiness
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides an AWS Route 53 Recovery Readiness Recovery Group.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/route53recoveryreadiness"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := route53recoveryreadiness.NewRecoveryGroup(ctx, "example", &route53recoveryreadiness.RecoveryGroupArgs{
    33  //				RecoveryGroupName: pulumi.String("my-high-availability-app"),
    34  //			})
    35  //			if err != nil {
    36  //				return err
    37  //			}
    38  //			return nil
    39  //		})
    40  //	}
    41  //
    42  // ```
    43  // <!--End PulumiCodeChooser -->
    44  //
    45  // ## Import
    46  //
    47  // Using `pulumi import`, import Route53 Recovery Readiness recovery groups using the recovery group name. For example:
    48  //
    49  // ```sh
    50  // $ pulumi import aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup my-high-availability-app my-high-availability-app
    51  // ```
    52  type RecoveryGroup struct {
    53  	pulumi.CustomResourceState
    54  
    55  	// ARN of the recovery group
    56  	Arn pulumi.StringOutput `pulumi:"arn"`
    57  	// List of cell arns to add as nested fault domains within this recovery group
    58  	Cells pulumi.StringArrayOutput `pulumi:"cells"`
    59  	// A unique name describing the recovery group.
    60  	//
    61  	// The following argument are optional:
    62  	RecoveryGroupName pulumi.StringOutput `pulumi:"recoveryGroupName"`
    63  	// 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
    64  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    65  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    66  	//
    67  	// Deprecated: Please use `tags` instead.
    68  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    69  }
    70  
    71  // NewRecoveryGroup registers a new resource with the given unique name, arguments, and options.
    72  func NewRecoveryGroup(ctx *pulumi.Context,
    73  	name string, args *RecoveryGroupArgs, opts ...pulumi.ResourceOption) (*RecoveryGroup, error) {
    74  	if args == nil {
    75  		return nil, errors.New("missing one or more required arguments")
    76  	}
    77  
    78  	if args.RecoveryGroupName == nil {
    79  		return nil, errors.New("invalid value for required argument 'RecoveryGroupName'")
    80  	}
    81  	opts = internal.PkgResourceDefaultOpts(opts)
    82  	var resource RecoveryGroup
    83  	err := ctx.RegisterResource("aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup", name, args, &resource, opts...)
    84  	if err != nil {
    85  		return nil, err
    86  	}
    87  	return &resource, nil
    88  }
    89  
    90  // GetRecoveryGroup gets an existing RecoveryGroup resource's state with the given name, ID, and optional
    91  // state properties that are used to uniquely qualify the lookup (nil if not required).
    92  func GetRecoveryGroup(ctx *pulumi.Context,
    93  	name string, id pulumi.IDInput, state *RecoveryGroupState, opts ...pulumi.ResourceOption) (*RecoveryGroup, error) {
    94  	var resource RecoveryGroup
    95  	err := ctx.ReadResource("aws:route53recoveryreadiness/recoveryGroup:RecoveryGroup", name, id, state, &resource, opts...)
    96  	if err != nil {
    97  		return nil, err
    98  	}
    99  	return &resource, nil
   100  }
   101  
   102  // Input properties used for looking up and filtering RecoveryGroup resources.
   103  type recoveryGroupState struct {
   104  	// ARN of the recovery group
   105  	Arn *string `pulumi:"arn"`
   106  	// List of cell arns to add as nested fault domains within this recovery group
   107  	Cells []string `pulumi:"cells"`
   108  	// A unique name describing the recovery group.
   109  	//
   110  	// The following argument are optional:
   111  	RecoveryGroupName *string `pulumi:"recoveryGroupName"`
   112  	// 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
   113  	Tags map[string]string `pulumi:"tags"`
   114  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   115  	//
   116  	// Deprecated: Please use `tags` instead.
   117  	TagsAll map[string]string `pulumi:"tagsAll"`
   118  }
   119  
   120  type RecoveryGroupState struct {
   121  	// ARN of the recovery group
   122  	Arn pulumi.StringPtrInput
   123  	// List of cell arns to add as nested fault domains within this recovery group
   124  	Cells pulumi.StringArrayInput
   125  	// A unique name describing the recovery group.
   126  	//
   127  	// The following argument are optional:
   128  	RecoveryGroupName pulumi.StringPtrInput
   129  	// 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
   130  	Tags pulumi.StringMapInput
   131  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   132  	//
   133  	// Deprecated: Please use `tags` instead.
   134  	TagsAll pulumi.StringMapInput
   135  }
   136  
   137  func (RecoveryGroupState) ElementType() reflect.Type {
   138  	return reflect.TypeOf((*recoveryGroupState)(nil)).Elem()
   139  }
   140  
   141  type recoveryGroupArgs struct {
   142  	// List of cell arns to add as nested fault domains within this recovery group
   143  	Cells []string `pulumi:"cells"`
   144  	// A unique name describing the recovery group.
   145  	//
   146  	// The following argument are optional:
   147  	RecoveryGroupName string `pulumi:"recoveryGroupName"`
   148  	// 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
   149  	Tags map[string]string `pulumi:"tags"`
   150  }
   151  
   152  // The set of arguments for constructing a RecoveryGroup resource.
   153  type RecoveryGroupArgs struct {
   154  	// List of cell arns to add as nested fault domains within this recovery group
   155  	Cells pulumi.StringArrayInput
   156  	// A unique name describing the recovery group.
   157  	//
   158  	// The following argument are optional:
   159  	RecoveryGroupName pulumi.StringInput
   160  	// 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
   161  	Tags pulumi.StringMapInput
   162  }
   163  
   164  func (RecoveryGroupArgs) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*recoveryGroupArgs)(nil)).Elem()
   166  }
   167  
   168  type RecoveryGroupInput interface {
   169  	pulumi.Input
   170  
   171  	ToRecoveryGroupOutput() RecoveryGroupOutput
   172  	ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput
   173  }
   174  
   175  func (*RecoveryGroup) ElementType() reflect.Type {
   176  	return reflect.TypeOf((**RecoveryGroup)(nil)).Elem()
   177  }
   178  
   179  func (i *RecoveryGroup) ToRecoveryGroupOutput() RecoveryGroupOutput {
   180  	return i.ToRecoveryGroupOutputWithContext(context.Background())
   181  }
   182  
   183  func (i *RecoveryGroup) ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput {
   184  	return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupOutput)
   185  }
   186  
   187  // RecoveryGroupArrayInput is an input type that accepts RecoveryGroupArray and RecoveryGroupArrayOutput values.
   188  // You can construct a concrete instance of `RecoveryGroupArrayInput` via:
   189  //
   190  //	RecoveryGroupArray{ RecoveryGroupArgs{...} }
   191  type RecoveryGroupArrayInput interface {
   192  	pulumi.Input
   193  
   194  	ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput
   195  	ToRecoveryGroupArrayOutputWithContext(context.Context) RecoveryGroupArrayOutput
   196  }
   197  
   198  type RecoveryGroupArray []RecoveryGroupInput
   199  
   200  func (RecoveryGroupArray) ElementType() reflect.Type {
   201  	return reflect.TypeOf((*[]*RecoveryGroup)(nil)).Elem()
   202  }
   203  
   204  func (i RecoveryGroupArray) ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput {
   205  	return i.ToRecoveryGroupArrayOutputWithContext(context.Background())
   206  }
   207  
   208  func (i RecoveryGroupArray) ToRecoveryGroupArrayOutputWithContext(ctx context.Context) RecoveryGroupArrayOutput {
   209  	return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupArrayOutput)
   210  }
   211  
   212  // RecoveryGroupMapInput is an input type that accepts RecoveryGroupMap and RecoveryGroupMapOutput values.
   213  // You can construct a concrete instance of `RecoveryGroupMapInput` via:
   214  //
   215  //	RecoveryGroupMap{ "key": RecoveryGroupArgs{...} }
   216  type RecoveryGroupMapInput interface {
   217  	pulumi.Input
   218  
   219  	ToRecoveryGroupMapOutput() RecoveryGroupMapOutput
   220  	ToRecoveryGroupMapOutputWithContext(context.Context) RecoveryGroupMapOutput
   221  }
   222  
   223  type RecoveryGroupMap map[string]RecoveryGroupInput
   224  
   225  func (RecoveryGroupMap) ElementType() reflect.Type {
   226  	return reflect.TypeOf((*map[string]*RecoveryGroup)(nil)).Elem()
   227  }
   228  
   229  func (i RecoveryGroupMap) ToRecoveryGroupMapOutput() RecoveryGroupMapOutput {
   230  	return i.ToRecoveryGroupMapOutputWithContext(context.Background())
   231  }
   232  
   233  func (i RecoveryGroupMap) ToRecoveryGroupMapOutputWithContext(ctx context.Context) RecoveryGroupMapOutput {
   234  	return pulumi.ToOutputWithContext(ctx, i).(RecoveryGroupMapOutput)
   235  }
   236  
   237  type RecoveryGroupOutput struct{ *pulumi.OutputState }
   238  
   239  func (RecoveryGroupOutput) ElementType() reflect.Type {
   240  	return reflect.TypeOf((**RecoveryGroup)(nil)).Elem()
   241  }
   242  
   243  func (o RecoveryGroupOutput) ToRecoveryGroupOutput() RecoveryGroupOutput {
   244  	return o
   245  }
   246  
   247  func (o RecoveryGroupOutput) ToRecoveryGroupOutputWithContext(ctx context.Context) RecoveryGroupOutput {
   248  	return o
   249  }
   250  
   251  // ARN of the recovery group
   252  func (o RecoveryGroupOutput) Arn() pulumi.StringOutput {
   253  	return o.ApplyT(func(v *RecoveryGroup) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   254  }
   255  
   256  // List of cell arns to add as nested fault domains within this recovery group
   257  func (o RecoveryGroupOutput) Cells() pulumi.StringArrayOutput {
   258  	return o.ApplyT(func(v *RecoveryGroup) pulumi.StringArrayOutput { return v.Cells }).(pulumi.StringArrayOutput)
   259  }
   260  
   261  // A unique name describing the recovery group.
   262  //
   263  // The following argument are optional:
   264  func (o RecoveryGroupOutput) RecoveryGroupName() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *RecoveryGroup) pulumi.StringOutput { return v.RecoveryGroupName }).(pulumi.StringOutput)
   266  }
   267  
   268  // 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
   269  func (o RecoveryGroupOutput) Tags() pulumi.StringMapOutput {
   270  	return o.ApplyT(func(v *RecoveryGroup) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   271  }
   272  
   273  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   274  //
   275  // Deprecated: Please use `tags` instead.
   276  func (o RecoveryGroupOutput) TagsAll() pulumi.StringMapOutput {
   277  	return o.ApplyT(func(v *RecoveryGroup) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   278  }
   279  
   280  type RecoveryGroupArrayOutput struct{ *pulumi.OutputState }
   281  
   282  func (RecoveryGroupArrayOutput) ElementType() reflect.Type {
   283  	return reflect.TypeOf((*[]*RecoveryGroup)(nil)).Elem()
   284  }
   285  
   286  func (o RecoveryGroupArrayOutput) ToRecoveryGroupArrayOutput() RecoveryGroupArrayOutput {
   287  	return o
   288  }
   289  
   290  func (o RecoveryGroupArrayOutput) ToRecoveryGroupArrayOutputWithContext(ctx context.Context) RecoveryGroupArrayOutput {
   291  	return o
   292  }
   293  
   294  func (o RecoveryGroupArrayOutput) Index(i pulumi.IntInput) RecoveryGroupOutput {
   295  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *RecoveryGroup {
   296  		return vs[0].([]*RecoveryGroup)[vs[1].(int)]
   297  	}).(RecoveryGroupOutput)
   298  }
   299  
   300  type RecoveryGroupMapOutput struct{ *pulumi.OutputState }
   301  
   302  func (RecoveryGroupMapOutput) ElementType() reflect.Type {
   303  	return reflect.TypeOf((*map[string]*RecoveryGroup)(nil)).Elem()
   304  }
   305  
   306  func (o RecoveryGroupMapOutput) ToRecoveryGroupMapOutput() RecoveryGroupMapOutput {
   307  	return o
   308  }
   309  
   310  func (o RecoveryGroupMapOutput) ToRecoveryGroupMapOutputWithContext(ctx context.Context) RecoveryGroupMapOutput {
   311  	return o
   312  }
   313  
   314  func (o RecoveryGroupMapOutput) MapIndex(k pulumi.StringInput) RecoveryGroupOutput {
   315  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *RecoveryGroup {
   316  		return vs[0].(map[string]*RecoveryGroup)[vs[1].(string)]
   317  	}).(RecoveryGroupOutput)
   318  }
   319  
   320  func init() {
   321  	pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupInput)(nil)).Elem(), &RecoveryGroup{})
   322  	pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupArrayInput)(nil)).Elem(), RecoveryGroupArray{})
   323  	pulumi.RegisterInputType(reflect.TypeOf((*RecoveryGroupMapInput)(nil)).Elem(), RecoveryGroupMap{})
   324  	pulumi.RegisterOutputType(RecoveryGroupOutput{})
   325  	pulumi.RegisterOutputType(RecoveryGroupArrayOutput{})
   326  	pulumi.RegisterOutputType(RecoveryGroupMapOutput{})
   327  }