github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/route53recoverycontrol/controlPanel.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  	"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 Control Config Control Panel.
    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/route53recoverycontrol"
    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 := route53recoverycontrol.NewControlPanel(ctx, "example", &route53recoverycontrol.ControlPanelArgs{
    33  //				Name:       pulumi.String("balmorhea"),
    34  //				ClusterArn: pulumi.String("arn:aws:route53-recovery-control::123456789012:cluster/8d47920e-d789-437d-803a-2dcc4b204393"),
    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 Control Config Control Panel using the control panel arn. For example:
    49  //
    50  // ```sh
    51  // $ pulumi import aws:route53recoverycontrol/controlPanel:ControlPanel mypanel arn:aws:route53-recovery-control::313517334327:controlpanel/1bfba17df8684f5dab0467b71424f7e8
    52  // ```
    53  type ControlPanel struct {
    54  	pulumi.CustomResourceState
    55  
    56  	// ARN of the control panel.
    57  	Arn pulumi.StringOutput `pulumi:"arn"`
    58  	// ARN of the cluster in which this control panel will reside.
    59  	ClusterArn pulumi.StringOutput `pulumi:"clusterArn"`
    60  	// Whether a control panel is default.
    61  	DefaultControlPanel pulumi.BoolOutput `pulumi:"defaultControlPanel"`
    62  	// Name describing the control panel.
    63  	Name pulumi.StringOutput `pulumi:"name"`
    64  	// Number routing controls in a control panel.
    65  	RoutingControlCount pulumi.IntOutput `pulumi:"routingControlCount"`
    66  	// Status of control panel: `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
    67  	Status pulumi.StringOutput `pulumi:"status"`
    68  }
    69  
    70  // NewControlPanel registers a new resource with the given unique name, arguments, and options.
    71  func NewControlPanel(ctx *pulumi.Context,
    72  	name string, args *ControlPanelArgs, opts ...pulumi.ResourceOption) (*ControlPanel, error) {
    73  	if args == nil {
    74  		return nil, errors.New("missing one or more required arguments")
    75  	}
    76  
    77  	if args.ClusterArn == nil {
    78  		return nil, errors.New("invalid value for required argument 'ClusterArn'")
    79  	}
    80  	opts = internal.PkgResourceDefaultOpts(opts)
    81  	var resource ControlPanel
    82  	err := ctx.RegisterResource("aws:route53recoverycontrol/controlPanel:ControlPanel", name, args, &resource, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return &resource, nil
    87  }
    88  
    89  // GetControlPanel gets an existing ControlPanel resource's state with the given name, ID, and optional
    90  // state properties that are used to uniquely qualify the lookup (nil if not required).
    91  func GetControlPanel(ctx *pulumi.Context,
    92  	name string, id pulumi.IDInput, state *ControlPanelState, opts ...pulumi.ResourceOption) (*ControlPanel, error) {
    93  	var resource ControlPanel
    94  	err := ctx.ReadResource("aws:route53recoverycontrol/controlPanel:ControlPanel", name, id, state, &resource, opts...)
    95  	if err != nil {
    96  		return nil, err
    97  	}
    98  	return &resource, nil
    99  }
   100  
   101  // Input properties used for looking up and filtering ControlPanel resources.
   102  type controlPanelState struct {
   103  	// ARN of the control panel.
   104  	Arn *string `pulumi:"arn"`
   105  	// ARN of the cluster in which this control panel will reside.
   106  	ClusterArn *string `pulumi:"clusterArn"`
   107  	// Whether a control panel is default.
   108  	DefaultControlPanel *bool `pulumi:"defaultControlPanel"`
   109  	// Name describing the control panel.
   110  	Name *string `pulumi:"name"`
   111  	// Number routing controls in a control panel.
   112  	RoutingControlCount *int `pulumi:"routingControlCount"`
   113  	// Status of control panel: `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
   114  	Status *string `pulumi:"status"`
   115  }
   116  
   117  type ControlPanelState struct {
   118  	// ARN of the control panel.
   119  	Arn pulumi.StringPtrInput
   120  	// ARN of the cluster in which this control panel will reside.
   121  	ClusterArn pulumi.StringPtrInput
   122  	// Whether a control panel is default.
   123  	DefaultControlPanel pulumi.BoolPtrInput
   124  	// Name describing the control panel.
   125  	Name pulumi.StringPtrInput
   126  	// Number routing controls in a control panel.
   127  	RoutingControlCount pulumi.IntPtrInput
   128  	// Status of control panel: `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
   129  	Status pulumi.StringPtrInput
   130  }
   131  
   132  func (ControlPanelState) ElementType() reflect.Type {
   133  	return reflect.TypeOf((*controlPanelState)(nil)).Elem()
   134  }
   135  
   136  type controlPanelArgs struct {
   137  	// ARN of the cluster in which this control panel will reside.
   138  	ClusterArn string `pulumi:"clusterArn"`
   139  	// Name describing the control panel.
   140  	Name *string `pulumi:"name"`
   141  }
   142  
   143  // The set of arguments for constructing a ControlPanel resource.
   144  type ControlPanelArgs struct {
   145  	// ARN of the cluster in which this control panel will reside.
   146  	ClusterArn pulumi.StringInput
   147  	// Name describing the control panel.
   148  	Name pulumi.StringPtrInput
   149  }
   150  
   151  func (ControlPanelArgs) ElementType() reflect.Type {
   152  	return reflect.TypeOf((*controlPanelArgs)(nil)).Elem()
   153  }
   154  
   155  type ControlPanelInput interface {
   156  	pulumi.Input
   157  
   158  	ToControlPanelOutput() ControlPanelOutput
   159  	ToControlPanelOutputWithContext(ctx context.Context) ControlPanelOutput
   160  }
   161  
   162  func (*ControlPanel) ElementType() reflect.Type {
   163  	return reflect.TypeOf((**ControlPanel)(nil)).Elem()
   164  }
   165  
   166  func (i *ControlPanel) ToControlPanelOutput() ControlPanelOutput {
   167  	return i.ToControlPanelOutputWithContext(context.Background())
   168  }
   169  
   170  func (i *ControlPanel) ToControlPanelOutputWithContext(ctx context.Context) ControlPanelOutput {
   171  	return pulumi.ToOutputWithContext(ctx, i).(ControlPanelOutput)
   172  }
   173  
   174  // ControlPanelArrayInput is an input type that accepts ControlPanelArray and ControlPanelArrayOutput values.
   175  // You can construct a concrete instance of `ControlPanelArrayInput` via:
   176  //
   177  //	ControlPanelArray{ ControlPanelArgs{...} }
   178  type ControlPanelArrayInput interface {
   179  	pulumi.Input
   180  
   181  	ToControlPanelArrayOutput() ControlPanelArrayOutput
   182  	ToControlPanelArrayOutputWithContext(context.Context) ControlPanelArrayOutput
   183  }
   184  
   185  type ControlPanelArray []ControlPanelInput
   186  
   187  func (ControlPanelArray) ElementType() reflect.Type {
   188  	return reflect.TypeOf((*[]*ControlPanel)(nil)).Elem()
   189  }
   190  
   191  func (i ControlPanelArray) ToControlPanelArrayOutput() ControlPanelArrayOutput {
   192  	return i.ToControlPanelArrayOutputWithContext(context.Background())
   193  }
   194  
   195  func (i ControlPanelArray) ToControlPanelArrayOutputWithContext(ctx context.Context) ControlPanelArrayOutput {
   196  	return pulumi.ToOutputWithContext(ctx, i).(ControlPanelArrayOutput)
   197  }
   198  
   199  // ControlPanelMapInput is an input type that accepts ControlPanelMap and ControlPanelMapOutput values.
   200  // You can construct a concrete instance of `ControlPanelMapInput` via:
   201  //
   202  //	ControlPanelMap{ "key": ControlPanelArgs{...} }
   203  type ControlPanelMapInput interface {
   204  	pulumi.Input
   205  
   206  	ToControlPanelMapOutput() ControlPanelMapOutput
   207  	ToControlPanelMapOutputWithContext(context.Context) ControlPanelMapOutput
   208  }
   209  
   210  type ControlPanelMap map[string]ControlPanelInput
   211  
   212  func (ControlPanelMap) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*map[string]*ControlPanel)(nil)).Elem()
   214  }
   215  
   216  func (i ControlPanelMap) ToControlPanelMapOutput() ControlPanelMapOutput {
   217  	return i.ToControlPanelMapOutputWithContext(context.Background())
   218  }
   219  
   220  func (i ControlPanelMap) ToControlPanelMapOutputWithContext(ctx context.Context) ControlPanelMapOutput {
   221  	return pulumi.ToOutputWithContext(ctx, i).(ControlPanelMapOutput)
   222  }
   223  
   224  type ControlPanelOutput struct{ *pulumi.OutputState }
   225  
   226  func (ControlPanelOutput) ElementType() reflect.Type {
   227  	return reflect.TypeOf((**ControlPanel)(nil)).Elem()
   228  }
   229  
   230  func (o ControlPanelOutput) ToControlPanelOutput() ControlPanelOutput {
   231  	return o
   232  }
   233  
   234  func (o ControlPanelOutput) ToControlPanelOutputWithContext(ctx context.Context) ControlPanelOutput {
   235  	return o
   236  }
   237  
   238  // ARN of the control panel.
   239  func (o ControlPanelOutput) Arn() pulumi.StringOutput {
   240  	return o.ApplyT(func(v *ControlPanel) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   241  }
   242  
   243  // ARN of the cluster in which this control panel will reside.
   244  func (o ControlPanelOutput) ClusterArn() pulumi.StringOutput {
   245  	return o.ApplyT(func(v *ControlPanel) pulumi.StringOutput { return v.ClusterArn }).(pulumi.StringOutput)
   246  }
   247  
   248  // Whether a control panel is default.
   249  func (o ControlPanelOutput) DefaultControlPanel() pulumi.BoolOutput {
   250  	return o.ApplyT(func(v *ControlPanel) pulumi.BoolOutput { return v.DefaultControlPanel }).(pulumi.BoolOutput)
   251  }
   252  
   253  // Name describing the control panel.
   254  func (o ControlPanelOutput) Name() pulumi.StringOutput {
   255  	return o.ApplyT(func(v *ControlPanel) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
   256  }
   257  
   258  // Number routing controls in a control panel.
   259  func (o ControlPanelOutput) RoutingControlCount() pulumi.IntOutput {
   260  	return o.ApplyT(func(v *ControlPanel) pulumi.IntOutput { return v.RoutingControlCount }).(pulumi.IntOutput)
   261  }
   262  
   263  // Status of control panel: `PENDING` when it is being created/updated, `PENDING_DELETION` when it is being deleted, and `DEPLOYED` otherwise.
   264  func (o ControlPanelOutput) Status() pulumi.StringOutput {
   265  	return o.ApplyT(func(v *ControlPanel) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
   266  }
   267  
   268  type ControlPanelArrayOutput struct{ *pulumi.OutputState }
   269  
   270  func (ControlPanelArrayOutput) ElementType() reflect.Type {
   271  	return reflect.TypeOf((*[]*ControlPanel)(nil)).Elem()
   272  }
   273  
   274  func (o ControlPanelArrayOutput) ToControlPanelArrayOutput() ControlPanelArrayOutput {
   275  	return o
   276  }
   277  
   278  func (o ControlPanelArrayOutput) ToControlPanelArrayOutputWithContext(ctx context.Context) ControlPanelArrayOutput {
   279  	return o
   280  }
   281  
   282  func (o ControlPanelArrayOutput) Index(i pulumi.IntInput) ControlPanelOutput {
   283  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ControlPanel {
   284  		return vs[0].([]*ControlPanel)[vs[1].(int)]
   285  	}).(ControlPanelOutput)
   286  }
   287  
   288  type ControlPanelMapOutput struct{ *pulumi.OutputState }
   289  
   290  func (ControlPanelMapOutput) ElementType() reflect.Type {
   291  	return reflect.TypeOf((*map[string]*ControlPanel)(nil)).Elem()
   292  }
   293  
   294  func (o ControlPanelMapOutput) ToControlPanelMapOutput() ControlPanelMapOutput {
   295  	return o
   296  }
   297  
   298  func (o ControlPanelMapOutput) ToControlPanelMapOutputWithContext(ctx context.Context) ControlPanelMapOutput {
   299  	return o
   300  }
   301  
   302  func (o ControlPanelMapOutput) MapIndex(k pulumi.StringInput) ControlPanelOutput {
   303  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ControlPanel {
   304  		return vs[0].(map[string]*ControlPanel)[vs[1].(string)]
   305  	}).(ControlPanelOutput)
   306  }
   307  
   308  func init() {
   309  	pulumi.RegisterInputType(reflect.TypeOf((*ControlPanelInput)(nil)).Elem(), &ControlPanel{})
   310  	pulumi.RegisterInputType(reflect.TypeOf((*ControlPanelArrayInput)(nil)).Elem(), ControlPanelArray{})
   311  	pulumi.RegisterInputType(reflect.TypeOf((*ControlPanelMapInput)(nil)).Elem(), ControlPanelMap{})
   312  	pulumi.RegisterOutputType(ControlPanelOutput{})
   313  	pulumi.RegisterOutputType(ControlPanelArrayOutput{})
   314  	pulumi.RegisterOutputType(ControlPanelMapOutput{})
   315  }