AWS EventBridge schedule to invoke API Gateway endpoint - amazon-web-services

I'm trying to build a schedule in AWS EventBridge that is going to invoke an API Gateway endpoint on a specific rate. However, I'm not able to specify the API Gateway endpoint when creating the schedule. I couldn't find examples in the documentation about the JSON body that I need to provide to specify the API Gateway ARN, endpoint and headers.
Follow AWS EventBridge documentation: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-gateway-target.html

Related

AWS API Gateway + SQS with more than 256KB of data

I am integrating AWS API Gateway with AWS SQS.
What would happen if API Gateway receives a payload > 256KB? Can I divert it to S3 somehow?
In this use case, you probably want to use a lambda proxy integration with API gateway.
So, your API Gateway endpoint sends the payload to a lambda function.
The lambda function works out the size of the payload. If it is <256KB you may want to place his onto the queue in SQS via the lambda.
If it is >256kb then you could write this down to s3 via the lambda, and then place a message into your queue with the s3 details. Your worker can then use the message in the queue to grab the data in s3 and process it from there.
Note there is a 10MB payload limit for API Gateway.
AWS provide the following guide on Lambda Proxy Integration with API Gateway.
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html

Make AWS API Gateway accessible only as SNS subscription endpoint

On my current project we configured forwarding of Cloudwatch alarms to Slack channel. For that we use AWS SNS topic + API Gateway which is subscribed on that topic and forwarded alarms to Slack webhook.
The issue I'm trying to solve - currently the REST resource of the mentioned API Gateway is public (it don't require any auth and is available from Internet). How can I configure API Gateway that it could be available only as SNS subscription endpoint?
You need to create the API gateway with the Endpoint type : Private
And you need to create a VPC end point for SNS to access the end point internally.
More Info: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-vpc-endpoint-policies.html

Amazon SNS: Create AWS Lambda API gateway, how to confirm subscription

I had a AWS lambda my_lambda which is configure API gateway. E.g: https://xxx.execute-api.us-east-1.amazonaws.com/{your-environment}/my_lambda.
I also had a SNS my_sns_topic.
I create subscription API gateway to SNS topic successfully But it need to confirm subscription.
I don't know to how get token from Lambda API gateway. So I can use that token to confirm subscription.
p.s: The difficulty is my API gateway was created in Lambda function.
Thanks.

Log AWS API Gateway Deployments

I need a way to log API gateway deployments (date/time, user, swagger diff etc.). Is there an event thats fired that i can attach a lambda to, or alternatively is this information already available on the dashboard somewhere?
As Krishna mentioned, CloudTrail can capture API events (both from the AWS console as well as the AWS APIs) for API Gateway, including the deployment of APIs. Since CloudTrail stores the events in S3, you can take advantage of S3 bucket notifications as a means to trigger your Lambda function.

AWS- API Gateway creation and modify event

I want to trigger an AWS lambda function upon the creation/modification of an API in AWS API gateway. Any idea what are the right events to catch?
As noted, API Gateway does not generate events directly. Additionally, it does not appear that you can configure an event rule based on CloudTrail logs for API Gateway either. I'll make sure to forward your request to the CloudWatch Events team as a feature request.
Since there is no event rule of AWS APIGateway in AWS CloudWatch and it does not appear log in AWS CloudTrail, so we can not achieve it now.