Skip to content

(ELB): Unable to disable cookie stickiness by removing enableCookieStickiness #16620

@luchees

Description

@luchees

Targetgroup does not get updated after removing cookiestickiness

Reproduction Steps

We enabled CookieStickiness for our targetgroup. This worked fine.

 fargateService.targetGroup.enableCookieStickiness(cdk.Duration.days(1))

When we tried to disable by removing above line in CDK the changes did not get applied in our targetgroup. As seen below:
image

This is the applied cloudformation changeset after deploying the code without the line : fargateService.targetGroup.enableCookieStickiness(cdk.Duration.days(1))

[
  {
    "resourceChange": {
      "logicalResourceId": "LoadBalancerPublicListenerECSGroup253F49BD",
      "action": "Modify",
      "physicalResourceId": "arn:aws:elasticloadbalancing:xxxxxxx:xxxxxx:targetgroup/serve-LoadB-146FJVGD6WPDF/04904465ae97ccf4",
      "resourceType": "AWS::ElasticLoadBalancingV2::TargetGroup",
      "replacement": "False",
      "moduleInfo": null,
      "details": [
        {
          "target": {
            "name": "TargetGroupAttributes",
            "requiresRecreation": "Never",
            "attribute": "Properties"
          },
          "causingEntity": null,
          "evaluation": "Static",
          "changeSource": "DirectModification"
        }
      ],
      "changeSetId": null,
      "scope": [
        "Properties"
      ]
    },
    "hookInvocationCount": null,
    "type": "Resource"
  }
]

What did you expect to happen?

I expected after removing enableCookieStickiness stickiness would have been disabled

Environment

  • **CDK CLI Version :**1.124.0
  • **Framework Version:**1.124.0
  • Node.js Version: v14.16.0
  • **OS :**Mac
  • Language (Version): TypeScript (3.8.3)

Other

It might make sense when no cookieStickiness attributes are set to disable it by default.

"TargetGroupAttributes": Array [
          Object {
            "Key": "stickiness.enabled",
            "Value": "false",
          },
        ],

This is 🐛 Bug Report

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-elasticloadbalancingRelated to Amazon Elastic Load BalancingbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions