github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/redshift/getOrderableCluster.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 redshift
     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  // Information about Redshift Orderable Clusters and valid parameter combinations.
    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/redshift"
    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 := redshift.GetOrderableCluster(ctx, &redshift.GetOrderableClusterArgs{
    32  //				ClusterType: pulumi.StringRef("multi-node"),
    33  //				PreferredNodeTypes: []string{
    34  //					"dc2.large",
    35  //					"ds2.xlarge",
    36  //				},
    37  //			}, nil)
    38  //			if err != nil {
    39  //				return err
    40  //			}
    41  //			return nil
    42  //		})
    43  //	}
    44  //
    45  // ```
    46  // <!--End PulumiCodeChooser -->
    47  func GetOrderableCluster(ctx *pulumi.Context, args *GetOrderableClusterArgs, opts ...pulumi.InvokeOption) (*GetOrderableClusterResult, error) {
    48  	opts = internal.PkgInvokeDefaultOpts(opts)
    49  	var rv GetOrderableClusterResult
    50  	err := ctx.Invoke("aws:redshift/getOrderableCluster:getOrderableCluster", args, &rv, opts...)
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	return &rv, nil
    55  }
    56  
    57  // A collection of arguments for invoking getOrderableCluster.
    58  type GetOrderableClusterArgs struct {
    59  	// Reshift Cluster typeE.g., `multi-node` or `single-node`
    60  	ClusterType *string `pulumi:"clusterType"`
    61  	// Redshift Cluster versionE.g., `1.0`
    62  	ClusterVersion *string `pulumi:"clusterVersion"`
    63  	// Redshift Cluster node typeE.g., `dc2.8xlarge`
    64  	NodeType *string `pulumi:"nodeType"`
    65  	// Ordered list of preferred Redshift Cluster node types. The first match in this list will be returned. If no preferred matches are found and the original search returned more than one result, an error is returned.
    66  	PreferredNodeTypes []string `pulumi:"preferredNodeTypes"`
    67  }
    68  
    69  // A collection of values returned by getOrderableCluster.
    70  type GetOrderableClusterResult struct {
    71  	// List of Availability Zone names where the Redshift Cluster is available.
    72  	AvailabilityZones []string `pulumi:"availabilityZones"`
    73  	ClusterType       string   `pulumi:"clusterType"`
    74  	ClusterVersion    string   `pulumi:"clusterVersion"`
    75  	// The provider-assigned unique ID for this managed resource.
    76  	Id                 string   `pulumi:"id"`
    77  	NodeType           string   `pulumi:"nodeType"`
    78  	PreferredNodeTypes []string `pulumi:"preferredNodeTypes"`
    79  }
    80  
    81  func GetOrderableClusterOutput(ctx *pulumi.Context, args GetOrderableClusterOutputArgs, opts ...pulumi.InvokeOption) GetOrderableClusterResultOutput {
    82  	return pulumi.ToOutputWithContext(context.Background(), args).
    83  		ApplyT(func(v interface{}) (GetOrderableClusterResult, error) {
    84  			args := v.(GetOrderableClusterArgs)
    85  			r, err := GetOrderableCluster(ctx, &args, opts...)
    86  			var s GetOrderableClusterResult
    87  			if r != nil {
    88  				s = *r
    89  			}
    90  			return s, err
    91  		}).(GetOrderableClusterResultOutput)
    92  }
    93  
    94  // A collection of arguments for invoking getOrderableCluster.
    95  type GetOrderableClusterOutputArgs struct {
    96  	// Reshift Cluster typeE.g., `multi-node` or `single-node`
    97  	ClusterType pulumi.StringPtrInput `pulumi:"clusterType"`
    98  	// Redshift Cluster versionE.g., `1.0`
    99  	ClusterVersion pulumi.StringPtrInput `pulumi:"clusterVersion"`
   100  	// Redshift Cluster node typeE.g., `dc2.8xlarge`
   101  	NodeType pulumi.StringPtrInput `pulumi:"nodeType"`
   102  	// Ordered list of preferred Redshift Cluster node types. The first match in this list will be returned. If no preferred matches are found and the original search returned more than one result, an error is returned.
   103  	PreferredNodeTypes pulumi.StringArrayInput `pulumi:"preferredNodeTypes"`
   104  }
   105  
   106  func (GetOrderableClusterOutputArgs) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*GetOrderableClusterArgs)(nil)).Elem()
   108  }
   109  
   110  // A collection of values returned by getOrderableCluster.
   111  type GetOrderableClusterResultOutput struct{ *pulumi.OutputState }
   112  
   113  func (GetOrderableClusterResultOutput) ElementType() reflect.Type {
   114  	return reflect.TypeOf((*GetOrderableClusterResult)(nil)).Elem()
   115  }
   116  
   117  func (o GetOrderableClusterResultOutput) ToGetOrderableClusterResultOutput() GetOrderableClusterResultOutput {
   118  	return o
   119  }
   120  
   121  func (o GetOrderableClusterResultOutput) ToGetOrderableClusterResultOutputWithContext(ctx context.Context) GetOrderableClusterResultOutput {
   122  	return o
   123  }
   124  
   125  // List of Availability Zone names where the Redshift Cluster is available.
   126  func (o GetOrderableClusterResultOutput) AvailabilityZones() pulumi.StringArrayOutput {
   127  	return o.ApplyT(func(v GetOrderableClusterResult) []string { return v.AvailabilityZones }).(pulumi.StringArrayOutput)
   128  }
   129  
   130  func (o GetOrderableClusterResultOutput) ClusterType() pulumi.StringOutput {
   131  	return o.ApplyT(func(v GetOrderableClusterResult) string { return v.ClusterType }).(pulumi.StringOutput)
   132  }
   133  
   134  func (o GetOrderableClusterResultOutput) ClusterVersion() pulumi.StringOutput {
   135  	return o.ApplyT(func(v GetOrderableClusterResult) string { return v.ClusterVersion }).(pulumi.StringOutput)
   136  }
   137  
   138  // The provider-assigned unique ID for this managed resource.
   139  func (o GetOrderableClusterResultOutput) Id() pulumi.StringOutput {
   140  	return o.ApplyT(func(v GetOrderableClusterResult) string { return v.Id }).(pulumi.StringOutput)
   141  }
   142  
   143  func (o GetOrderableClusterResultOutput) NodeType() pulumi.StringOutput {
   144  	return o.ApplyT(func(v GetOrderableClusterResult) string { return v.NodeType }).(pulumi.StringOutput)
   145  }
   146  
   147  func (o GetOrderableClusterResultOutput) PreferredNodeTypes() pulumi.StringArrayOutput {
   148  	return o.ApplyT(func(v GetOrderableClusterResult) []string { return v.PreferredNodeTypes }).(pulumi.StringArrayOutput)
   149  }
   150  
   151  func init() {
   152  	pulumi.RegisterOutputType(GetOrderableClusterResultOutput{})
   153  }