getClusters function
Retrieve EKS Clusters list
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const example = aws.eks.getClusters({});
const exampleGetCluster = example.then(example => std.toset({
input: example.names,
})).then(invoke => .reduce((__obj, [__key, __value]) => ({ ...__obj, [String(__key)]: aws.eks.getCluster({
name: __value,
}) }), {}));
import pulumi
import pulumi_aws as aws
import pulumi_std as std
example = aws.eks.get_clusters()
example_get_cluster = {str(__key): aws.eks.get_cluster(name=__value) for __key, __value in enumerate(std.toset(input=example.names).result)}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = Aws.Eks.GetClusters.Invoke();
var exampleGetCluster = Std.Toset.Invoke(new()
{
Input = example.Apply(getClustersResult => getClustersResult.Names),
}).Apply(invoke => );
});
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
std = {
source = "pulumi/std"
}
}
}
data "aws_eks_getclusters" "example" {
}
data "aws_eks_getcluster" "invoke_1" {
for_each = toset(data.aws_eks_getclusters.example.names)
name = each.value
}
locals {
exampleGetCluster = {for __key, __value in toset(data.aws_eks_getclusters.example.names) : __key => data.aws_eks_getcluster.invoke_1[__key]}
}
args Arguments passed to this invoke. Arguments for getClusters.
options Invoke options controlling this call.
Implementation
Future<GetClustersResult> getClusters(
GetClustersArgs args, {
pulumi.InvokeOptions? options,
}) async {
final deployment = pulumi.Deployment.instance;
final result = await deployment.invoke<Map<String, dynamic>>(
'aws:eks/getClusters:getClusters',
args.toMap(),
options: pulumi.toDeploymentInvokeOptions(options),
);
return GetClustersResult.fromMap(result);
}