github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/emrcontainers/getVirtualCluster.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 emrcontainers
     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  // Retrieve information about an EMR Containers (EMR on EKS) Virtual Cluster.
    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/emrcontainers"
    25  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    26  //
    27  // )
    28  //
    29  //	func main() {
    30  //		pulumi.Run(func(ctx *pulumi.Context) error {
    31  //			example, err := emrcontainers.LookupVirtualCluster(ctx, &emrcontainers.LookupVirtualClusterArgs{
    32  //				VirtualClusterId: "example id",
    33  //			}, nil)
    34  //			if err != nil {
    35  //				return err
    36  //			}
    37  //			ctx.Export("name", example.Name)
    38  //			ctx.Export("arn", example.Arn)
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupVirtualCluster(ctx *pulumi.Context, args *LookupVirtualClusterArgs, opts ...pulumi.InvokeOption) (*LookupVirtualClusterResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupVirtualClusterResult
    48  	err := ctx.Invoke("aws:emrcontainers/getVirtualCluster:getVirtualCluster", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getVirtualCluster.
    56  type LookupVirtualClusterArgs struct {
    57  	// Key-value mapping of resource tags.
    58  	Tags map[string]string `pulumi:"tags"`
    59  	// ID of the cluster.
    60  	VirtualClusterId string `pulumi:"virtualClusterId"`
    61  }
    62  
    63  // A collection of values returned by getVirtualCluster.
    64  type LookupVirtualClusterResult struct {
    65  	// ARN of the cluster.
    66  	Arn string `pulumi:"arn"`
    67  	// Nested attribute containing information about the underlying container provider (EKS cluster) for your EMR Containers cluster.
    68  	ContainerProviders []GetVirtualClusterContainerProvider `pulumi:"containerProviders"`
    69  	// Unix epoch time stamp in seconds for when the cluster was created.
    70  	CreatedAt string `pulumi:"createdAt"`
    71  	// The provider-assigned unique ID for this managed resource.
    72  	Id string `pulumi:"id"`
    73  	// Name of the cluster.
    74  	Name string `pulumi:"name"`
    75  	// Status of the EKS cluster. One of `RUNNING`, `TERMINATING`, `TERMINATED`, `ARRESTED`.
    76  	State string `pulumi:"state"`
    77  	// Key-value mapping of resource tags.
    78  	Tags             map[string]string `pulumi:"tags"`
    79  	VirtualClusterId string            `pulumi:"virtualClusterId"`
    80  }
    81  
    82  func LookupVirtualClusterOutput(ctx *pulumi.Context, args LookupVirtualClusterOutputArgs, opts ...pulumi.InvokeOption) LookupVirtualClusterResultOutput {
    83  	return pulumi.ToOutputWithContext(context.Background(), args).
    84  		ApplyT(func(v interface{}) (LookupVirtualClusterResult, error) {
    85  			args := v.(LookupVirtualClusterArgs)
    86  			r, err := LookupVirtualCluster(ctx, &args, opts...)
    87  			var s LookupVirtualClusterResult
    88  			if r != nil {
    89  				s = *r
    90  			}
    91  			return s, err
    92  		}).(LookupVirtualClusterResultOutput)
    93  }
    94  
    95  // A collection of arguments for invoking getVirtualCluster.
    96  type LookupVirtualClusterOutputArgs struct {
    97  	// Key-value mapping of resource tags.
    98  	Tags pulumi.StringMapInput `pulumi:"tags"`
    99  	// ID of the cluster.
   100  	VirtualClusterId pulumi.StringInput `pulumi:"virtualClusterId"`
   101  }
   102  
   103  func (LookupVirtualClusterOutputArgs) ElementType() reflect.Type {
   104  	return reflect.TypeOf((*LookupVirtualClusterArgs)(nil)).Elem()
   105  }
   106  
   107  // A collection of values returned by getVirtualCluster.
   108  type LookupVirtualClusterResultOutput struct{ *pulumi.OutputState }
   109  
   110  func (LookupVirtualClusterResultOutput) ElementType() reflect.Type {
   111  	return reflect.TypeOf((*LookupVirtualClusterResult)(nil)).Elem()
   112  }
   113  
   114  func (o LookupVirtualClusterResultOutput) ToLookupVirtualClusterResultOutput() LookupVirtualClusterResultOutput {
   115  	return o
   116  }
   117  
   118  func (o LookupVirtualClusterResultOutput) ToLookupVirtualClusterResultOutputWithContext(ctx context.Context) LookupVirtualClusterResultOutput {
   119  	return o
   120  }
   121  
   122  // ARN of the cluster.
   123  func (o LookupVirtualClusterResultOutput) Arn() pulumi.StringOutput {
   124  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.Arn }).(pulumi.StringOutput)
   125  }
   126  
   127  // Nested attribute containing information about the underlying container provider (EKS cluster) for your EMR Containers cluster.
   128  func (o LookupVirtualClusterResultOutput) ContainerProviders() GetVirtualClusterContainerProviderArrayOutput {
   129  	return o.ApplyT(func(v LookupVirtualClusterResult) []GetVirtualClusterContainerProvider { return v.ContainerProviders }).(GetVirtualClusterContainerProviderArrayOutput)
   130  }
   131  
   132  // Unix epoch time stamp in seconds for when the cluster was created.
   133  func (o LookupVirtualClusterResultOutput) CreatedAt() pulumi.StringOutput {
   134  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.CreatedAt }).(pulumi.StringOutput)
   135  }
   136  
   137  // The provider-assigned unique ID for this managed resource.
   138  func (o LookupVirtualClusterResultOutput) Id() pulumi.StringOutput {
   139  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.Id }).(pulumi.StringOutput)
   140  }
   141  
   142  // Name of the cluster.
   143  func (o LookupVirtualClusterResultOutput) Name() pulumi.StringOutput {
   144  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.Name }).(pulumi.StringOutput)
   145  }
   146  
   147  // Status of the EKS cluster. One of `RUNNING`, `TERMINATING`, `TERMINATED`, `ARRESTED`.
   148  func (o LookupVirtualClusterResultOutput) State() pulumi.StringOutput {
   149  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.State }).(pulumi.StringOutput)
   150  }
   151  
   152  // Key-value mapping of resource tags.
   153  func (o LookupVirtualClusterResultOutput) Tags() pulumi.StringMapOutput {
   154  	return o.ApplyT(func(v LookupVirtualClusterResult) map[string]string { return v.Tags }).(pulumi.StringMapOutput)
   155  }
   156  
   157  func (o LookupVirtualClusterResultOutput) VirtualClusterId() pulumi.StringOutput {
   158  	return o.ApplyT(func(v LookupVirtualClusterResult) string { return v.VirtualClusterId }).(pulumi.StringOutput)
   159  }
   160  
   161  func init() {
   162  	pulumi.RegisterOutputType(LookupVirtualClusterResultOutput{})
   163  }