Home > Blockchain >  The action deploy is not valid for this web service while calling api through api gateway
The action deploy is not valid for this web service while calling api through api gateway

Time:04-01

I am using API gateway to call the API in ec2 instance. When i tested the api i am getting the output below with status:200. But it should show "Success" message.why is it happening?. Do i need to change anything to get the proper output while doing get request.

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Errors><Error>
<Code>InvalidAction</Code>
<Message>The action deploy is not valid for this web service.</Message>
</Error></Errors>
<RequestID>4c2aeb89-1dfe-4a95-a9fd-7af28b49c708</RequestID>
</Response>

Steps I followed to create the API

  1. created a restapi in api gateway as shown in figure enter image description here

  2. After that i have added the api end points using resources and methods and connected to aws ec2 instance as shown in the figure enter image description here

  3. I have created the execution role arn by going into IAM roles and added all the roles shown in the figure. enter image description here enter image description here

  4. later if i test the api endpoint by providing the query parameters i am getting this error enter image description here

CodePudding user response:

You use API as proxy to your EC2 docker app. Its not "AWS Service". You must choose and setup HTTP integration type. "AWS Service" would be used if your were creating API proxy to the actual EC2 service (e.g. launch an instance, stop an instance, ...).

Depending on the nature of you EC2 docker app, if you just setup plain HTTP (http://<defulat-ec2-url) this will be going over unencrypted (not HTTPS) connection. So be mindful of that. If your API contains sensitive info, this is a security issue.

  • Related