github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/eks/getNodeGroups.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 eks 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 the EKS Node Groups associated with a named EKS cluster. This will allow you to pass a list of Node Group names to other resources. 15 func GetNodeGroups(ctx *pulumi.Context, args *GetNodeGroupsArgs, opts ...pulumi.InvokeOption) (*GetNodeGroupsResult, error) { 16 opts = internal.PkgInvokeDefaultOpts(opts) 17 var rv GetNodeGroupsResult 18 err := ctx.Invoke("aws:eks/getNodeGroups:getNodeGroups", args, &rv, opts...) 19 if err != nil { 20 return nil, err 21 } 22 return &rv, nil 23 } 24 25 // A collection of arguments for invoking getNodeGroups. 26 type GetNodeGroupsArgs struct { 27 // Name of the cluster. 28 ClusterName string `pulumi:"clusterName"` 29 } 30 31 // A collection of values returned by getNodeGroups. 32 type GetNodeGroupsResult struct { 33 ClusterName string `pulumi:"clusterName"` 34 // The provider-assigned unique ID for this managed resource. 35 Id string `pulumi:"id"` 36 // Set of all node group names in an EKS Cluster. 37 Names []string `pulumi:"names"` 38 } 39 40 func GetNodeGroupsOutput(ctx *pulumi.Context, args GetNodeGroupsOutputArgs, opts ...pulumi.InvokeOption) GetNodeGroupsResultOutput { 41 return pulumi.ToOutputWithContext(context.Background(), args). 42 ApplyT(func(v interface{}) (GetNodeGroupsResult, error) { 43 args := v.(GetNodeGroupsArgs) 44 r, err := GetNodeGroups(ctx, &args, opts...) 45 var s GetNodeGroupsResult 46 if r != nil { 47 s = *r 48 } 49 return s, err 50 }).(GetNodeGroupsResultOutput) 51 } 52 53 // A collection of arguments for invoking getNodeGroups. 54 type GetNodeGroupsOutputArgs struct { 55 // Name of the cluster. 56 ClusterName pulumi.StringInput `pulumi:"clusterName"` 57 } 58 59 func (GetNodeGroupsOutputArgs) ElementType() reflect.Type { 60 return reflect.TypeOf((*GetNodeGroupsArgs)(nil)).Elem() 61 } 62 63 // A collection of values returned by getNodeGroups. 64 type GetNodeGroupsResultOutput struct{ *pulumi.OutputState } 65 66 func (GetNodeGroupsResultOutput) ElementType() reflect.Type { 67 return reflect.TypeOf((*GetNodeGroupsResult)(nil)).Elem() 68 } 69 70 func (o GetNodeGroupsResultOutput) ToGetNodeGroupsResultOutput() GetNodeGroupsResultOutput { 71 return o 72 } 73 74 func (o GetNodeGroupsResultOutput) ToGetNodeGroupsResultOutputWithContext(ctx context.Context) GetNodeGroupsResultOutput { 75 return o 76 } 77 78 func (o GetNodeGroupsResultOutput) ClusterName() pulumi.StringOutput { 79 return o.ApplyT(func(v GetNodeGroupsResult) string { return v.ClusterName }).(pulumi.StringOutput) 80 } 81 82 // The provider-assigned unique ID for this managed resource. 83 func (o GetNodeGroupsResultOutput) Id() pulumi.StringOutput { 84 return o.ApplyT(func(v GetNodeGroupsResult) string { return v.Id }).(pulumi.StringOutput) 85 } 86 87 // Set of all node group names in an EKS Cluster. 88 func (o GetNodeGroupsResultOutput) Names() pulumi.StringArrayOutput { 89 return o.ApplyT(func(v GetNodeGroupsResult) []string { return v.Names }).(pulumi.StringArrayOutput) 90 } 91 92 func init() { 93 pulumi.RegisterOutputType(GetNodeGroupsResultOutput{}) 94 }