https://pulumi.com logo
#aws
Title
e

elegant-dress-88912

12/19/2019, 6:29 AM
I am thinking to use randomString from
@pulumi/random
as suffix, but not sure how can I make pulumi to regenerate it each time managednodegroup wants new resource
w

white-balloon-205

12/19/2019, 6:35 AM
Which resource exactly is it that is being replaced? This sounds like it could be a bug in the library where
deleteBeforeReplace
should have been used.
e

elegant-dress-88912

12/19/2019, 6:40 AM
it's
aws:eks:NodeGroup
deleteBeforeReplace
doesn't look right to me, because cluster will stay w/o nodes till new node group is created
code
Copy code
import * as eks from "@pulumi/eks";
...

commonName = '<env name here>'

const eksCluster = new eks.Cluster(commonName, {
  vpcId: vpc.id,
  fargate: false,
  skipDefaultNodeGroup: true,

...

const eksManagedNodeGroup = eks.createManagedNodeGroup(
  commonName,
  {
    cluster: eksCluster,
    nodeGroupName: commonName,
    nodeRoleArn: eksWorkerNodeGroupRole.arn,
...
  },
  eksCluster
);
I'd prefer eks lib to make nodeGroupName arg optional and generate it from resource name + suffix, using new suffix everytime new resource is created. The same approach which is usually used in other resources
w

white-balloon-205

12/19/2019, 7:49 PM
I think I know what the problem is here - I've opened https://github.com/pulumi/pulumi-eks/issues/294 to track.