Reputation: 127
I wanted to know if it possible that API GateWay sends data to a specific EC2 instance (my server)?
And how my server (that run codes in java) should get the data from the gateway?
Thank you, Nofar.
Upvotes: 1
Views: 2986
Reputation: 8571
As the name indicates API gateway is just a gateway to your actual business logic. API gateway cannot run business logic code on it's on. You have to integrate API gateway with an integration point. This integration point can be another HTTP endpoint (REST service), another AWS service or a Lambda function.
So to achieve your requirement what you can do is to host a REST service with the logic you want to execute in your EC2 instance. You can integrate the service you hosted in EC2 via API gateway. API gateway will generate an HTTP endpoint for you, which in turn call the service you hosted in EC2. The API endpoint you should share to the outside world would be the end point generated by API gateway only. Please note you should add enough security to the service you hosted in EC2 instance for not get called directly. Please see below the different integration API gateway has,
Upvotes: 5