0.0.4 • Published 2 years ago

@wheatstalk/cdk-apigatewayv2-ecs v0.0.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

ECS Service Discovery Integration

This project provides an AWS HTTP API Gateway integration to your ECS service by VPC Link.

See: Cheap serverless containers using API Gateway

Usage

declare const cluster: aws_ecs.Cluster;
declare const taskDefinition: aws_ecs.FargateTaskDefinition;

// Create your ECS service
const service = new aws_ecs.FargateService(stack, 'Service', {
  cluster,
  taskDefinition,
  // Enable CloudMap service discovery
  cloudMapOptions: {
    name: 'some-service',
    // Ensure that you use SRV-based records
    dnsRecordType: aws_servicediscovery.DnsRecordType.SRV,
  },
})

new aws_apigatewayv2.HttpApi(stack, 'HttpApi', {
  // Connect the HTTP API to your ECS service
  defaultIntegration: new EcsServiceDiscoveryIntegration('Nginx', {
    service,
  }),
});
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago