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