aws / aws/aws-cdk

(servicediscovery): CloudMapOptions support for both A and SRV records

Open
#18,894 3 comments 1 reaction 0 assignees View on GitHub
@aws-cdk/aws-ecs @aws-cdk/aws-servicediscovery effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### General Issue

Cdk doesn't allow ECS service with both A and SRV dns records

### The Question

According to [AWS official documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html), under certain conditions `you can create any combination of A or SRV records for each service task`. I successfully tested this through the **old aws console**, creating a service that automatically registers both A and SRV records on the associated CloudMap private hosted zone. I also talked with AWS support and they suggested to open this issue.

This feature however seems to be completely forbidden by CDK: [according to the documentation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ecs.CloudMapOptions.html#dnsrecordtype) the only available option is either using A or SRV records, not both.

My question is: there's some special reason for this restriction? It seems useful for various reasons having both kind of records, so it seems strange to disallow that. Do you know if some workaround is available?

### CDK CLI Version

1.102.0

### Framework Version

_No response_

### Node.js Version

_No response_

### OS

_No response_

### Language

Typescript

### Language Version

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the aws_ecs CloudMapOptions entry point and its dnsrecordtype option, then compare the requested behavior with the linked AWS service-discovery documentation. Done means CDK can support an ECS service using both A and SRV records, with the resulting option and behavior documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.