ECS - ServiceConnect : There is no way to reference ServiceConnect Discovery URL which is needed to build APIGatewayv2 Integration
- 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:

Which generates an integration with the below properties:
### 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:

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
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