I want to integrate AWS ECS with API Gateway (REST API) without using NLB, lambda, or any other service.

1

I want to integrate my ECS cluster services with the API gateway, but I don't want to use NLB or any other service in between, like lambda, etc.

3개 답변
1

If your ECS cluster is private, i.e., you can't access it from the internet, then you need to use VPC Link from API Gateway to get into the VPC. If you are using REST API, it only supports NLB. If you are using an HTTP API, you can use an NLB, ALB or CloudMap (which may be what you want).

If your cluster is exposed to the internet, you can connect API Gateway directly to it, but, API Gateway is not a load balancer, so you will only be able to connect it to a single instance. Also, if your service is exposed to the internet, users can bypass it and access the service directly, so it is not recommended.

profile pictureAWS
전문가
Uri
답변함 8달 전
0
profile pictureAWS
전문가
답변함 8달 전
0

Here's how to integrate AWS ECS with API Gateway (REST API) using a private integration, without NLB, Lambda, or other services:

►Prerequisites:

  • An ECS cluster with a running service.

  • An API Gateway with a REST API defined.

  • VPC Setup: Both your ECS cluster and API Gateway must be within the same VPC (Virtual Private Cloud).

►Steps:

• Create a VPC Link:

  1. In the API Gateway console, navigate to VPN Links.
  2. Click Create.
  3. Provide a name for the link and choose your VPC from the dropdown menu.
  4. Click Create

• Configure Private Integration:

  1. Go to your REST API in API Gateway.
  2. Select Resources and choose the resource you want to integrate with your ECS service.
  3. Click Actions and select Create Method.
  4. Choose your desired HTTP method (e.g., GET, POST).
  5. Under Integration Type, select Private integration.
  6. For Integration HTTP Method, choose the method your ECS service expects (likely POST).
  7. Under Endpoint Type, select VPC Link.
  8. Choose the VPC Link you created in step 1.
  9. For Target, use the following format: arn:aws:ecs:${region}:${account-id}:cluster/${cluster-name}/service/${service-name}:${revision}. Replace the placeholders with your specific information.
  10. Click Save.

►Explanation:

This approach directly connects your API Gateway to your ECS service within the same VPC. API Gateway requests are routed through the VPC Link to your ECS service, bypassing the need for an NLB or Lambda function.

If you want to know about more information then you can check this-: https://www.nimbleappgenie.com/blogs/aws-marketplace-integration/

profile picture
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠