I have a list of custom tags needed by my org to t...
# general
e
I have a list of custom tags needed by my org to track things per department, cost center, etc
c
Do you mean resources created outside of pulumi?
p
Most AWS Pulumi resources have a tags attribute
b
What Ron said. You can see an example for aws ec2 instances: https://pulumi.io/reference/pkg/nodejs/@pulumi/aws/ec2/#Instance
Copy code
const web = new aws.ec2.Instance("web", {
    ami: ubuntu.apply(ubuntu => ubuntu.id),
    instanceType: "t2.micro",
    tags: {
        Name: "HelloWorld",
    },
});
e
ah, okay, I missed that earlier. Thanks!
Doesn't seem to work for `eks.Cluster`:
Copy code
39 /*
 40  * EKS cluster creation
 41  */
 42 export const cluster = new eks.Cluster(config.environment + "-eks-cluster", {
 43     version: config.kubernetesVersion,
 44     vpcId: config.vpcId,
 45     subnetIds: config.subnetIds,
 46     instanceType: config.instanceType,
 47     tags: {
 48       Project: "Mustang",
 49     },
 50     nodeAmiId: config.amiId,
 51     nodePublicKey: config.workerNodePublicKey,
 52     nodeRootVolumeSize: 200,
 53     desiredCapacity: config.desiredNodes,
 54     maxSize: config.maxNumberOfNodes,
 55     minSize: config.minNumberOfNodes,
 56     nodeUserData: userData,
 57     deployDashboard: false,
 58     vpcCniOptions: {



$ pulumi up
Previewing update (redacted):

     Type                 Name                                              Plan     Info
     pulumi:pulumi:Stack  eks-cluster-online-sandbox-vpc           1 error

Diagnostics:
  pulumi:pulumi:Stack (eks-cluster-online-sandbox-vpc):
    error: Running program '/home/tsi/eshamay/git/cs/infrastructure/pulumi/eks-cluster' failed with an unhandled exception:
    TSError: ⨯ Unable to compile TypeScript:
    cluster.ts(47,5): error TS2345: Argument of type '{ version: string; vpcId: string; subnetIds: Output<UnwrappedArray<string>>; instanceType: InstanceType; tags: { Project: string; }; nodeAmiId: string; nodePublicKey: string; nodeRootVolumeSize: number; ... 6 more ...; roleMappings: { ...; }[]; }' is not assignable to parameter of type 'ClusterOptions'.
      Object literal may only specify known properties, and 'tags' does not exist in type 'ClusterOptions'.
Can we add tags to EKS resources?