Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS CloudMap - ServiceConnect : after update, ECS doesn't support having both CLoudMap and ServiceConnect #26524

Open
ETisREAL opened this issue Jul 26, 2023 · 2 comments
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@ETisREAL
Copy link

Describe the bug

Hi, hope to find you well :)

After one of the recent updates, I am not able anymore to apply this kind of configuration

const qmmRedisService = new ecs.FargateService(this, `${props.STAGE}qmmRedisService`, {
            serviceName: `${props.STAGE}qmmRedisService`,
            cluster: qlashMainCluster,
            desiredCount: 1,
            securityGroups: [qmmRedisServiceSecurityGroup],
            taskDefinition: qmmRedisTaskDefinition,
            enableExecuteCommand: true,
            vpcSubnets: { subnetGroupName: props.qmmRedisSubnetGroupName },
            cloudMapOptions: {
                container: qmmRedisContainer,
                name: `${props.STAGE.toLowerCase()}_qmm_redis`,
                containerPort: 6379
            },
            serviceConnectConfiguration: {
                services: [{ portMappingName: `${props.STAGE.toLowerCase()}_qmm_redis` }]
            }
        })

Expected Behavior

This used to allow me to make use of the service connect monitoring, as well as resolving the DNS in a Peered VPC

Current Behavior

Now I can choose either a cloudmap configuration or a service connect one. With the first I have to sacrifice DNS resolution outside of the cluster, with the second I give up on extra monitoring

Reproduction Steps

NA

Possible Solution

Restoring this old functionality?

Additional Information/Context

No response

CDK CLI Version

2.88

Framework Version

No response

Node.js Version

v18.16

OS

Linux - Ubuntu

Language

Typescript

Language Version

No response

Other information

No response

@ETisREAL ETisREAL added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@github-actions github-actions bot added the @aws-cdk/aws-ecs Related to Amazon Elastic Container label Jul 26, 2023
@pahud
Copy link
Contributor

pahud commented Jul 26, 2023

cloudMapOptions creates CDK-managed cloudmap service which was the default behavior before service connect was introduced.

public enableCloudMap(options: CloudMapOptions): cloudmap.Service {

I think we should create a check, if serviceConnectConfiguration is provided, cloudMapOptions should be undefined.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@ETisREAL
Copy link
Author

@pahud the issue of only having serviceConnect however is that it doesn't create the A record for the container, allowing other services to make use of cloudmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-ecs Related to Amazon Elastic Container bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants