Deployment failing after deleting API Gateway. How to recover? - amazon-web-services

After I removed the API gateway manually via the aws console because changing the configuration in my serverless.yml file didn’t seem to change the Gateway configuration anymore.
Now deployment fails with " An error saying: ApiGatewayMethodGet - Template error: API Gateway RestAPI dj1ivqgipb doesn't exist".
I understand that this is an error caused by me, but can anyone please hint me into the direction of how to recover from this?
https://i.stack.imgur.com/rzr8S.png

All I did was to go to API Gateway -> Custom domain names -> then I reconfigure API mapping from pointing to the old deleted API to then point to the existing API that I just created in the cli... Then now I can re-deploy my serverless application.
https://i.stack.imgur.com/N6Sjh.png

Related

AWS: "Custom Domain" is stuck in the "Updating" state for a whole day

I had set up a custom domain for API Gateway. I have tried to update its BasePath and SecurityPolicy using sam and now it is stuck in the "Updating" state on the UI. Trying to delete it from AWS CLI also causes the following error.
An error occurred (BadRequestException) when calling the DeleteDomainName operation:
There is already an update in progress for the domain reminders.thestarware.com.
Please wait until the current update finishes before making another request.
Even deleting the whole API Gateway does not resolve it. Do you have any idea about how I can force delete it?
From my experience, when you utilize a custom domain in API Gateway, API Gateway saves the custom domain independently of your APIs so that you can delete an API without deleting your domain, or so that you can change the API that the domain points to if you need to.
Have you tried deleting your custom domain from API Gateway via the AWS Management Console / web browser interface?
Log in to the AWS console
Navigate to the API Gateway management page for your region. An example URL for the us-west-2 region is:
https://us-west-2.console.aws.amazon.com/apigateway
Click on "Custom domain names" as shown in the image below. Then you should be able to click on your domain and try to delete it using the "Delete" button shown in the image below. API Gateway Custom domain names management page

API Gateway: Error during configuring API mapping

I created a wildcard certificate *.example.com on ACM in my region.
Then I add subdomain.example.com to my custom domain names on API Gateway. The subdomain was configured correctly (it did not give me an error).
When I try to configure mappings of API I get the error Unable to complete operation due to concurrent modification. Please try again later.
I have tried it multiple times. What am I doing wrong here?
This issue is probably with API gateway UI console(AWS Management Console).
When I tried creating the mapping from the AWS CLI, it worked.
I used the aws apigateway create-base-path-mapping command.
Details on the API are at https://docs.aws.amazon.com/cli/latest/reference/apigateway/create-base-path-mapping.html

AWS API-gateway manual deploy required?

The API tends to go down when I re-deploy a REST-API using AWS API-gateway and cloudformation (AWS::ApiGateway::RestApi). Then a manual "deploy of the API" through AWS-console is required to fix it. This creates downtime until I have done this. Which options do I have to prevent this?
Ref:
https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-deploy-api.html
In your CloudFormation template, be sure to include a AWS:ApiGateway:Deployment resource to trigger the actual deployment after a change.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-deployment.html
APIs are deployed without downtime. While the new configuration is propagated API Gateway responds to requests using the previous config. Once the new configuration is available and a new request comes in it will be handled using the updated configuration.

AWS API Gateway SDK generation error at least one operation

I am trying to generate an SDK for am API Gateway that is already deployed and has 2 stages created in API Gateway console.
However, when I try to create an SDK from it using the API Gateway Console, I encounter the following error.
Generation failed during SETUP stage: Must have at least one operation present in the API
Has anyone encountered this error? I do not see any thing else on the AWS Console.
Try to add a GET method under /, and link it to mock integration should solve this issue.

AWS Lambda http, where do I find the URL?

I am fairly new to AWS Lambda but sure can see the benefits of it and stumbled upon the superb framework Serverless to help me built solutions on Lambda.
I started out building solutions using AWS API Gateway but really need "internal" VPC API's and not public Internet facing API's like API GW creates.
I found that Servless indeed can expose a HTTP endpoint but I can't figure out how this is done and how the URL is created.
When I deploy the Lambda from Serverless it gives me the URL, e.g.:
https://uxezd6ry8z.execute-api.eu-west-1.amazonaws.com/dev/ping
I would like to be able to find (or create) this same http listener for already existing Lambdas so my question is how is the URL created and where is teh actual HTTP listener deployed?
You might be looking for the invoke url,
1. go to https://console.aws.amazon.com/apigateway
2. select api link (which you have deployed on aws lambda).
3. select stages in left side panel and
see the invoke url.
Adding a http listener can be done by going to your lambda function, selecting the 'triggers' tab and 'add trigger', finally selecting API Gateway - but as others mentioned this does create a public facing url.
Duh, I was in the wrong AWS logon previously so the API GW was not showing any matching Serverless API and that was why I couldn't understand how they did it...
Once I logged into the AWS account that hosts the Serverless structure I can see the API GW GET API's for the Serverless HTTP listener.