https://pulumi.com logo
#dotnet
Title
# dotnet
w

worried-city-86458

06/24/2020, 10:27 AM
I'm finally back in Pulumi land and trying to port some ts code to c#...
Copy code
const cluster = new eks.Cluster(
    name,
    {
        deployDashboard: false,
        publicSubnetIds: publicSubnetIds,
        privateSubnetIds: privateSubnetIds,
        instanceRole: instanceRole,
        roleMappings: iam.getRoleMappings(),
        userMappings: iam.getUserMappings(),
        skipDefaultNodeGroup: true,
        tags: {
            Environment: environment,
            EnvironmentType: environmentType,
            CostCenter: costCenter
        },
        version: k8sVersion,
        vpcId: vpc.outputs.Vpc
    },
    {
        customTimeouts: {
            create: "30m",
            update: "30m"
        }
    }
);
... but I can't find the equivalent of a lot of the above args on
ClusterArgs
e.g. how am I supposed to pass role and user mappings? 😕
This is what I have so far in c#...
Copy code
var cluster = new Cluster(name,
    new ClusterArgs
    {
        RoleArn = instanceRole.Arn,
        Tags = new Dictionary<string, string>
        {
            ["Environment"] = environment,
            ["EnvironmentType"] = environmentType,
            ["CostCenter"] = costCenter
        },
        Version = k8sVersion,
        VpcConfig = new ClusterVpcConfigArgs
        {
            SubnetIds = publicSubnetIds.Concat(privateSubnetIds).ToArray(),
            VpcId = vpc.Outputs["Vpc"]
        }
    },
    new CustomResourceOptions
    {
        CustomTimeouts = new CustomTimeouts
        {
            Create = TimeSpan.FromMinutes(30),
            Update = TimeSpan.FromMinutes(30)
        }
    }
);
t

tall-librarian-49374

06/24/2020, 1:41 PM
Is the original example using the
pulumi-eks
package?
w

worried-city-86458

06/24/2020, 6:53 PM
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as eks from "@pulumi/eks";
Yes
t

tall-librarian-49374

06/24/2020, 7:45 PM
The
pulumi-eks
package is currently in Node.js only. We are working to bring it to other languages, but it’s not there yet. FWIW, it’s a convenience wrapper around raw provider API, so you can do everything in C# too, but you’ll have to use lower-level APIs.
😞 1
w

worried-city-86458

06/29/2020, 11:43 PM
@tall-librarian-49374 okay, will a port to C# etc happen any time soon? There's a lot going on in this package so it would be quite a lot of work for me to switch to the lower-level APIs and then I might find other holes in the C# API anyway.
Just trying to weigh up my options and not waste any effort
t

tall-librarian-49374

06/30/2020, 7:15 AM
There’s still some non-trivial work to be done there, which is planned for Q3