Skip to content

Commit

Permalink
fix(elasticloadbalancingv2): ALB listeners with multiple forwardi… (#…
Browse files Browse the repository at this point in the history
…25005)

…ng targets need weights specified

The [ELB docs](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#forward-actions) on this aren't explicit, but the examples do _not_ show a configuration with multiple targets, but no weighting. This change assigns a weight to the action, if one wasn't specified.

If specifying stickiness, but no weight, the template will change.

Fixes #24805.

Results in CFN like
  LBListener49E825B4:
    Type: AWS::ElasticLoadBalancingV2::Listener
    Properties:
      DefaultActions:
        - ForwardConfig: TargetGroups: - TargetGroupArn: Ref: TargetGroupOne7810CAFB Weight: 1 - TargetGroupArn: Ref: TargetGroupTwo593946E1 Weight: 1 Type: forward

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Styerp authored Apr 25, 2023
1 parent 0a82ed5 commit 512f64e
Show file tree
Hide file tree
Showing 12 changed files with 1,905 additions and 18 deletions.
11 changes: 6 additions & 5 deletions packages/@aws-cdk-testing/framework-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/aws-batch-alpha": "0.0.0",
"delay": "5.0.0",
"@aws-cdk/pkglint": "0.0.0"
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "^0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"delay": "5.0.0"
},
"dependencies": {
"@aws-cdk/integ-tests-alpha": "0.0.0",
"@aws-cdk/lambda-layer-kubectl-v24": "^2.0.100",
"aws-cdk-lib": "0.0.0",
"aws-sdk": "^2.1317.0",
"aws-sdk-mock": "5.6.0",
"cdk8s": "^2.7.15",
"cdk8s-plus-24": "2.4.40",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
"constructs": "^10.0.0"
},
"repository": {
"url": "https://github.com/aws/aws-cdk.git",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "31.0.0",
"files": {
"5c6a6a70d3025d3d783370635c0a869082ae70a4c11b4e7a0f459cfc4daffb3b": {
"source": {
"path": "Basic.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "5c6a6a70d3025d3d783370635c0a869082ae70a4c11b4e7a0f459cfc4daffb3b.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Loading

0 comments on commit 512f64e

Please sign in to comment.