aws / aws/aws-cdk

ECS - ServiceConnect : There is no way to reference ServiceConnect Discovery URL which is needed to build APIGatewayv2 Integration

Open
#31,215 4 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/aws-ecs effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the feature

Extend the CDK ability to build API Gateway Integration that references Service Connect, similar to the capability offered for Service Discovery, see the link: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2_integrations-readme.html#cloud-map-service-discovery.

This is currently possible from the console, using the Private integration target that references the ServiceConnect CloudMap entry:

![Screenshot 2024-08-26 114553](https://github.com/user-attachments/assets/1ebe76e3-ccdd-47f6-b227-a4ccaf0259bd)

Which generates an integration with the below properties:
image (16)

### Use Case

Use CDK natively to build an integration between an ECS service that has service connect enabled and an API Gateway using private integration.

### Proposed Solution

There are a number of options, but I was trying to get a reference for the ServiceConnect Discovery URI and pass that as a parameter the HttpIntegration method, but I wasn't able to do that.
The ServiceConnect discovery URL can be viewed as shown below:
![Screenshot 2024-08-26 120330](https://github.com/user-attachments/assets/d999f1a7-b080-4037-b2b4-07f45875a009)

The URL can be constructed using the pattern `serviceArn:'arn:aws:servicediscovery::service/` which requires a reference to the CloudMap service ID.

```
const httpIntegration = new apigatewayv2.HttpIntegration(this, 'MyHttpIntegration', {
httpApi: httpEndpoint,
integrationType: apigatewayv2.HttpIntegrationType.HTTP_PROXY,
connectionId: 'connectionId',
connectionType: apigatewayv2.HttpConnectionType.VPC_LINK,
integrationUri: **______**
method: apigatewayv2.HttpMethod.ANY,
timeout: cdk.Duration.minutes(30),
});
```

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.148.0 (build e5740c0)

### Environment details (OS name and version, etc.)

Microsoft Windows 11 Enterprise - 23H2

Contributor guide

Open the contributing guide

Research direction

Start with the aws-apigatewayv2 integrations documentation and the HttpIntegration entry point mentioned in the issue, then compare the existing Cloud Map service-discovery integration with the ServiceConnect discovery URL and Cloud Map service ID requirements. Done means CDK can create the requested private API Gateway integration for an ECS service with Service Connect enabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.