I have an elasticsearch cluster running in ECS, wh...
# aws
p
I have an elasticsearch cluster running in ECS, which is load balanced by an NLB. I have an old stack which will be retired and a new stack. I've imported some of the ancillary infra like the NLB and the security group into the new stack and I'll rm it from the old stack before downing it so as not to replace it. I copied the code from the old stack into the new stack, so all the code is identical. When it comes to the listener the preview says it wants to change the defualtAction. Looking at the --diff it shows two red blocks (prefixed with a - ) which both remove the same defaultAction. I'm wondering if something is up with the preview and the second one should be green (i.e. with a +) and thus it will be a no-op, but I'm worried that it's not the preview and running up will really delete my NLBs default action. Can anyone help me work out what's going on? Code and diff out put to follow in the thread.
Copy code
~ defaultActions: [
          ~ [0]: {
                  - forward: {
                      - stickiness  : <null>
                      - targetGroups: [
                      -     [0]: {
                              - arn   : "arn:aws:elasticloadbalancing:us-east-2:####:targetgroup/esTargetGroup-9d9d98a/09d1c61224b76277"
                              - weight: 0
                            }
                        ]
                    }
                  - forward: {
                      - stickiness  : <null>
                      - targetGroups: [
                      -     [0]: {
                              - arn   : "arn:aws:elasticloadbalancing:us-east-2:###:targetgroup/esTargetGroup-9d9d98a/09d1c61224b76277"
                              - weight: 0
                            }
                        ]
                    }
                }
        ]
the diff
Copy code
const nlb = new aws.lb.LoadBalancer('esNLB', {
  internal: true,
  loadBalancerType: 'network',
  subnets: privateSubnets,
}, { provider: provider });

const targetGroup = new aws.lb.TargetGroup('esTargetGroup', {
  vpcId: vpcId,
  port: 9200,
  protocol: 'TCP',
}, { provider: provider });

const listener = new aws.lb.Listener('esListener', {
  loadBalancerArn: nlb.arn,
  port: 9200,
  protocol: 'TCP',
  defaultActions: [{
    type: 'forward',
    targetGroupArn: targetGroup.arn,
  }],
}, { provider: provider });
the code which is identical in both stacks
privateSubnets is a var pulled from the same upstream vpc stack, but even if that was different it shouldn't make any odds to the listener Likewise vpcId
Well I deployed it and it was an no-op, the LB didn't break and the defaultAction didn't change, Seems like a bug in the --diff maybe.