github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53recoveryreadiness/readinessCheck.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 Readiness Check.
    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.NewReadinessCheck(ctx, "example", &route53recoveryreadiness.ReadinessCheckArgs{
    33  //				ReadinessCheckName: pulumi.Any(my_cw_alarm_check),
    34  //				ResourceSetName:    pulumi.Any(my_cw_alarm_set),
    35  //			})
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  //
    46  // ## Import
    47  //
    48  // Using `pulumi import`, import Route53 Recovery Readiness readiness checks using the readiness check name. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:route53recoveryreadiness/readinessCheck:ReadinessCheck my-cw-alarm-check example
    52  // ```
    53  type ReadinessCheck struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// ARN of the readiness_check
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// Unique name describing the readiness check.
    59  	ReadinessCheckName pulumi.StringOutput `pulumi:"readinessCheckName"`
    60  	// Name describing the resource set that will be monitored for readiness.
    61  	//
    62  	// The following arguments are optional:
    63  	ResourceSetName pulumi.StringOutput `pulumi:"resourceSetName"`
    64  	// 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
    65  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    66  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    67  	//
    68  	// Deprecated: Please use `tags` instead.
    69  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    70  }
    71  
    72  // NewReadinessCheck registers a new resource with the given unique name, arguments, and options.
    73  func NewReadinessCheck(ctx *pulumi.Context,
    74  	name string, args *ReadinessCheckArgs, opts ...pulumi.ResourceOption) (*ReadinessCheck, error) {
    75  	if args == nil {
    76  		return nil, errors.New("missing one or more required arguments")
    77  	}
    78  
    79  	if args.ReadinessCheckName == nil {
    80  		return nil, errors.New("invalid value for required argument 'ReadinessCheckName'")
    81  	}
    82  	if args.ResourceSetName == nil {
    83  		return nil, errors.New("invalid value for required argument 'ResourceSetName'")
    84  	}
    85  	opts = internal.PkgResourceDefaultOpts(opts)
    86  	var resource ReadinessCheck
    87  	err := ctx.RegisterResource("aws:route53recoveryreadiness/readinessCheck:ReadinessCheck", name, args, &resource, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return &resource, nil
    92  }
    93  
    94  // GetReadinessCheck gets an existing ReadinessCheck resource's state with the given name, ID, and optional
    95  // state properties that are used to uniquely qualify the lookup (nil if not required).
    96  func GetReadinessCheck(ctx *pulumi.Context,
    97  	name string, id pulumi.IDInput, state *ReadinessCheckState, opts ...pulumi.ResourceOption) (*ReadinessCheck, error) {
    98  	var resource ReadinessCheck
    99  	err := ctx.ReadResource("aws:route53recoveryreadiness/readinessCheck:ReadinessCheck", name, id, state, &resource, opts...)
   100  	if err != nil {
   101  		return nil, err
   102  	}
   103  	return &resource, nil
   104  }
   105  
   106  // Input properties used for looking up and filtering ReadinessCheck resources.
   107  type readinessCheckState struct {
   108  	// ARN of the readiness_check
   109  	Arn *string `pulumi:"arn"`
   110  	// Unique name describing the readiness check.
   111  	ReadinessCheckName *string `pulumi:"readinessCheckName"`
   112  	// Name describing the resource set that will be monitored for readiness.
   113  	//
   114  	// The following arguments are optional:
   115  	ResourceSetName *string `pulumi:"resourceSetName"`
   116  	// 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
   117  	Tags map[string]string `pulumi:"tags"`
   118  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   119  	//
   120  	// Deprecated: Please use `tags` instead.
   121  	TagsAll map[string]string `pulumi:"tagsAll"`
   122  }
   123  
   124  type ReadinessCheckState struct {
   125  	// ARN of the readiness_check
   126  	Arn pulumi.StringPtrInput
   127  	// Unique name describing the readiness check.
   128  	ReadinessCheckName pulumi.StringPtrInput
   129  	// Name describing the resource set that will be monitored for readiness.
   130  	//
   131  	// The following arguments are optional:
   132  	ResourceSetName pulumi.StringPtrInput
   133  	// 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
   134  	Tags pulumi.StringMapInput
   135  	// Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   136  	//
   137  	// Deprecated: Please use `tags` instead.
   138  	TagsAll pulumi.StringMapInput
   139  }
   140  
   141  func (ReadinessCheckState) ElementType() reflect.Type {
   142  	return reflect.TypeOf((*readinessCheckState)(nil)).Elem()
   143  }
   144  
   145  type readinessCheckArgs struct {
   146  	// Unique name describing the readiness check.
   147  	ReadinessCheckName string `pulumi:"readinessCheckName"`
   148  	// Name describing the resource set that will be monitored for readiness.
   149  	//
   150  	// The following arguments are optional:
   151  	ResourceSetName string `pulumi:"resourceSetName"`
   152  	// 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
   153  	Tags map[string]string `pulumi:"tags"`
   154  }
   155  
   156  // The set of arguments for constructing a ReadinessCheck resource.
   157  type ReadinessCheckArgs struct {
   158  	// Unique name describing the readiness check.
   159  	ReadinessCheckName pulumi.StringInput
   160  	// Name describing the resource set that will be monitored for readiness.
   161  	//
   162  	// The following arguments are optional:
   163  	ResourceSetName pulumi.StringInput
   164  	// 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
   165  	Tags pulumi.StringMapInput
   166  }
   167  
   168  func (ReadinessCheckArgs) ElementType() reflect.Type {
   169  	return reflect.TypeOf((*readinessCheckArgs)(nil)).Elem()
   170  }
   171  
   172  type ReadinessCheckInput interface {
   173  	pulumi.Input
   174  
   175  	ToReadinessCheckOutput() ReadinessCheckOutput
   176  	ToReadinessCheckOutputWithContext(ctx context.Context) ReadinessCheckOutput
   177  }
   178  
   179  func (*ReadinessCheck) ElementType() reflect.Type {
   180  	return reflect.TypeOf((**ReadinessCheck)(nil)).Elem()
   181  }
   182  
   183  func (i *ReadinessCheck) ToReadinessCheckOutput() ReadinessCheckOutput {
   184  	return i.ToReadinessCheckOutputWithContext(context.Background())
   185  }
   186  
   187  func (i *ReadinessCheck) ToReadinessCheckOutputWithContext(ctx context.Context) ReadinessCheckOutput {
   188  	return pulumi.ToOutputWithContext(ctx, i).(ReadinessCheckOutput)
   189  }
   190  
   191  // ReadinessCheckArrayInput is an input type that accepts ReadinessCheckArray and ReadinessCheckArrayOutput values.
   192  // You can construct a concrete instance of `ReadinessCheckArrayInput` via:
   193  //
   194  //	ReadinessCheckArray{ ReadinessCheckArgs{...} }
   195  type ReadinessCheckArrayInput interface {
   196  	pulumi.Input
   197  
   198  	ToReadinessCheckArrayOutput() ReadinessCheckArrayOutput
   199  	ToReadinessCheckArrayOutputWithContext(context.Context) ReadinessCheckArrayOutput
   200  }
   201  
   202  type ReadinessCheckArray []ReadinessCheckInput
   203  
   204  func (ReadinessCheckArray) ElementType() reflect.Type {
   205  	return reflect.TypeOf((*[]*ReadinessCheck)(nil)).Elem()
   206  }
   207  
   208  func (i ReadinessCheckArray) ToReadinessCheckArrayOutput() ReadinessCheckArrayOutput {
   209  	return i.ToReadinessCheckArrayOutputWithContext(context.Background())
   210  }
   211  
   212  func (i ReadinessCheckArray) ToReadinessCheckArrayOutputWithContext(ctx context.Context) ReadinessCheckArrayOutput {
   213  	return pulumi.ToOutputWithContext(ctx, i).(ReadinessCheckArrayOutput)
   214  }
   215  
   216  // ReadinessCheckMapInput is an input type that accepts ReadinessCheckMap and ReadinessCheckMapOutput values.
   217  // You can construct a concrete instance of `ReadinessCheckMapInput` via:
   218  //
   219  //	ReadinessCheckMap{ "key": ReadinessCheckArgs{...} }
   220  type ReadinessCheckMapInput interface {
   221  	pulumi.Input
   222  
   223  	ToReadinessCheckMapOutput() ReadinessCheckMapOutput
   224  	ToReadinessCheckMapOutputWithContext(context.Context) ReadinessCheckMapOutput
   225  }
   226  
   227  type ReadinessCheckMap map[string]ReadinessCheckInput
   228  
   229  func (ReadinessCheckMap) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*map[string]*ReadinessCheck)(nil)).Elem()
   231  }
   232  
   233  func (i ReadinessCheckMap) ToReadinessCheckMapOutput() ReadinessCheckMapOutput {
   234  	return i.ToReadinessCheckMapOutputWithContext(context.Background())
   235  }
   236  
   237  func (i ReadinessCheckMap) ToReadinessCheckMapOutputWithContext(ctx context.Context) ReadinessCheckMapOutput {
   238  	return pulumi.ToOutputWithContext(ctx, i).(ReadinessCheckMapOutput)
   239  }
   240  
   241  type ReadinessCheckOutput struct{ *pulumi.OutputState }
   242  
   243  func (ReadinessCheckOutput) ElementType() reflect.Type {
   244  	return reflect.TypeOf((**ReadinessCheck)(nil)).Elem()
   245  }
   246  
   247  func (o ReadinessCheckOutput) ToReadinessCheckOutput() ReadinessCheckOutput {
   248  	return o
   249  }
   250  
   251  func (o ReadinessCheckOutput) ToReadinessCheckOutputWithContext(ctx context.Context) ReadinessCheckOutput {
   252  	return o
   253  }
   254  
   255  // ARN of the readiness_check
   256  func (o ReadinessCheckOutput) Arn() pulumi.StringOutput {
   257  	return o.ApplyT(func(v *ReadinessCheck) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   258  }
   259  
   260  // Unique name describing the readiness check.
   261  func (o ReadinessCheckOutput) ReadinessCheckName() pulumi.StringOutput {
   262  	return o.ApplyT(func(v *ReadinessCheck) pulumi.StringOutput { return v.ReadinessCheckName }).(pulumi.StringOutput)
   263  }
   264  
   265  // Name describing the resource set that will be monitored for readiness.
   266  //
   267  // The following arguments are optional:
   268  func (o ReadinessCheckOutput) ResourceSetName() pulumi.StringOutput {
   269  	return o.ApplyT(func(v *ReadinessCheck) pulumi.StringOutput { return v.ResourceSetName }).(pulumi.StringOutput)
   270  }
   271  
   272  // 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
   273  func (o ReadinessCheckOutput) Tags() pulumi.StringMapOutput {
   274  	return o.ApplyT(func(v *ReadinessCheck) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   275  }
   276  
   277  // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   278  //
   279  // Deprecated: Please use `tags` instead.
   280  func (o ReadinessCheckOutput) TagsAll() pulumi.StringMapOutput {
   281  	return o.ApplyT(func(v *ReadinessCheck) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   282  }
   283  
   284  type ReadinessCheckArrayOutput struct{ *pulumi.OutputState }
   285  
   286  func (ReadinessCheckArrayOutput) ElementType() reflect.Type {
   287  	return reflect.TypeOf((*[]*ReadinessCheck)(nil)).Elem()
   288  }
   289  
   290  func (o ReadinessCheckArrayOutput) ToReadinessCheckArrayOutput() ReadinessCheckArrayOutput {
   291  	return o
   292  }
   293  
   294  func (o ReadinessCheckArrayOutput) ToReadinessCheckArrayOutputWithContext(ctx context.Context) ReadinessCheckArrayOutput {
   295  	return o
   296  }
   297  
   298  func (o ReadinessCheckArrayOutput) Index(i pulumi.IntInput) ReadinessCheckOutput {
   299  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ReadinessCheck {
   300  		return vs[0].([]*ReadinessCheck)[vs[1].(int)]
   301  	}).(ReadinessCheckOutput)
   302  }
   303  
   304  type ReadinessCheckMapOutput struct{ *pulumi.OutputState }
   305  
   306  func (ReadinessCheckMapOutput) ElementType() reflect.Type {
   307  	return reflect.TypeOf((*map[string]*ReadinessCheck)(nil)).Elem()
   308  }
   309  
   310  func (o ReadinessCheckMapOutput) ToReadinessCheckMapOutput() ReadinessCheckMapOutput {
   311  	return o
   312  }
   313  
   314  func (o ReadinessCheckMapOutput) ToReadinessCheckMapOutputWithContext(ctx context.Context) ReadinessCheckMapOutput {
   315  	return o
   316  }
   317  
   318  func (o ReadinessCheckMapOutput) MapIndex(k pulumi.StringInput) ReadinessCheckOutput {
   319  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ReadinessCheck {
   320  		return vs[0].(map[string]*ReadinessCheck)[vs[1].(string)]
   321  	}).(ReadinessCheckOutput)
   322  }
   323  
   324  func init() {
   325  	pulumi.RegisterInputType(reflect.TypeOf((*ReadinessCheckInput)(nil)).Elem(), &ReadinessCheck{})
   326  	pulumi.RegisterInputType(reflect.TypeOf((*ReadinessCheckArrayInput)(nil)).Elem(), ReadinessCheckArray{})
   327  	pulumi.RegisterInputType(reflect.TypeOf((*ReadinessCheckMapInput)(nil)).Elem(), ReadinessCheckMap{})
   328  	pulumi.RegisterOutputType(ReadinessCheckOutput{})
   329  	pulumi.RegisterOutputType(ReadinessCheckArrayOutput{})
   330  	pulumi.RegisterOutputType(ReadinessCheckMapOutput{})
   331  }