AWS API Gateway + elastic beanstalk and microservices

I'm going to build an AWS microservice architecture and want to ask you to clarify my doubts.

My current overall concept

I would like to use the Gateway API, which provides APIs for microservices running in Elastic Beanstalk. I would like to host Elastic Beanstalk in a VPC without direct Internet access to its instances.

enter image description here

Questions and doubts:

  1. Elastic Beanstalk gets a subdomain when creating an application. This subdomain should be used by the API gateway with the integration type: AWS service, in the action configuration - am I right?
  2. What will one microservice represent? Is Elastic Beanstalk a specific scalable microservice?
  3. How should microservices communicate with each other? There will be some task where I am going to use SQS (Simple Queue Service). But in other cases, it is better when two microservices communicate with each other through an API gateway, and not directly - am I right?
  4. Test environment: what structure should I use in a test environment (or intermediate environment)? I am thinking of creating a separate VPC with another Elastic Beanstalk and other Amazon services.
  5. Test environment and API gateway. How to configure an API gateway? It should allow clients access to microservices in a test environment if the request has a specific subdomain, for example: test.mydomain.com/hello_world/say_hello. I'm not sure how to use the Gateway API in CI / CD to make it quick and easy without manually copying any configuration from the testing phase to the production phase. (I do not expect any complicated solution, only some tips about which components, details, concepts I could use for it. I will find more detailed information myself).
  6. Do you have experience deploying applications in Elastic Beanstalk using Codep Deploy and / or Jenkins? I'm wondering what could be better: Jenkins, AWS Code Deploy or Jenkins + CodeDeploy.
+8
source share
3 answers

I will answer those points that are not based on opinions:

  • An elastic beanstalk gets a subdomain when creating an application. This subdomain should be used by the Gateway API with the integration type: AWS service, in the action configuration - Am I right?

No, AWS integration is only applicable if you are actually invoking Elastic Beanstalk . You will call your own beanstalk instance to use HTTP integration.

  1. What will be one microservice? Is Elastic Beanstalk a specific scalable microservice service?

It is up to you, but as mentioned in the comments, many clients prefer to do this through Lambda functions rather than beanstalk applications. Using Lambda has the advantage that you do not need to control the scaling of your beanstalk application.

  1. Test conditions: what structure should be used in a test environment (or setting).? I am thinking of creating a separate VPC with another Elastic bobbin and other Amazon services.

Just note that the Gateway API currently cannot communicate with your VPC resources. Any beanstalk instance must be publicly available.

  1. Test environment and API gateway: how do I configure an API gateway? It should allow clients to access microservices in a test environment if the request has a specific subdomain, for example: test.mydomain.com/hello_world/say_hello. I am not sure how to use the Gateway API in CI / CD to make it quick and easy, without manually copying some configuration from the testing phase to the production phase. (I do not expect any complicated solution, only some tips about which components, parts and concepts I can use for it. I will find more details on my own).

You should take a look at the stage variables . This will allow you to use the basic configuration with the differences between dev / test / prod stored in these variables.

+9
source

Gateway API now supports integration with Private VPC, so I expect that you can deploy your ELB in a private VPC and connect it to the Gateway API using .ebextension

Source: https://aws.amazon.com/about-aws/whats-new/2017/11/amazon-api-gateway-supports-endpoint-integrations-with-private-vpcs/

+2
source

I don't think the above solution fooobar.com/questions/1012419 / ... works with ElasticBeanStalk apps.

As mentioned in the article, a link to the VPC must be created. Requires a network load balancer that is configured to work with specific ec2 instances.

Can this be pointed out by the elastic bean application itself?

0
source

Source: https://habr.com/ru/post/1012419/


All Articles