Skip to content

Commit f4f8abc

Browse files
authored
feat(ecs-patterns): support NLB with TLS listener and target group (#30611)
### Issue # (if applicable) Closes #8517 ### Reason for this change NLB support TLS protocol in listener and target group. This changes provide a feature parity in ECS patterns, allowing customer to enhance security with encrypted traffic between NLB and services ### Description of changes - Add `listenerCertificate` to `NetworkLoadBalancedServiceBaseProps`, default value is `none` - Change the default value of `listenerPort` and `taskImageOptions.containerPort` to 443, if `listenerCertificate` is provided. ### Description of how you validated changes - Added both unit test and integration test ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 0f4175b commit f4f8abc

27 files changed

+7260
-8
lines changed

packages/@aws-cdk-testing/framework-integ/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ See `integ-runner` package or `yarn integ --help` for detailed instructions.
66

77
## Common Errors
88

9-
### Error: For this test you must provide your own HostedZoneId/HostedZoneName/DomainName
9+
### Error: For this test you must provide your own HostedZoneId/HostedZoneName/DomainName/Certificate
1010

1111
Some test cases require a publicly available domain name attached to a Amazon Route 53 Hosted Zone to work.
1212
These test cases need to add DNS records that are then retrieved via the public internet infrastructure. This can be a subdomain to an existing domain, but it must have a Hosted Zone configured and nameservers delegated to it.
1313

1414
If you haven't got one ready, see the [Route 53 guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html) to manually create a hosted zone.
1515

16+
Some test cases require an ACM public certificate on a publicly available domain name to work.
17+
These test cases need a public certificate which uses DNS for domain ownership validation.
18+
19+
See the [AWS Certificate Manager guide](https://docs.aws.amazon.com/acm/latest/userguide/acm-public-certificates.html) to request an Amazon-Issued certificate.
20+
1621
AWS CDK core team members, please check our team internal docs for guidance on how to configure domains for testing.
1722

1823
#### How to correctly run these tests
@@ -25,12 +30,15 @@ The checked-in snapshot uses dummy values that will not deploy.
2530

2631
- Go to your Hosted Zone and write down the values for `HostedZoneId`, `HostedZoneName` and `DomainName`.
2732
All values must related to the **same** Hosted Zone.
33+
- Go to your AWS Certificate Manager and write down the ARN for the `Certificate`
34+
The certificate should be attached to a domain name in the **same** Hosted Zone.
2835
- In your terminal run the following commands:
2936

3037
```console
3138
export HOSTED_ZONE_ID=your_hosted_zone_id
3239
export HOSTED_ZONE_NAME=your_hosted_zone_name
3340
export DOMAIN_NAME=your_domain_name
41+
export CERT_ARN=your_certificate_arn
3442
```
3543

3644
- Finally, in the same terminal run your specific test case with the **update workflow disabled**. For example:

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/__entrypoint__.js

+155
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.js.snapshot/asset.bde7b5c89cb43285f884c94f0b9e17cdb0f5eb5345005114dd60342e0b8a85a1/index.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.tls-network-load-balanced-ecs-service.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)