Webcal URL using Aws API Gateway and AWS lambda - amazon-web-services

For the calendar, I want to create a sync URL like this:
webcal://example.com/sync
Can this is possible using AWS API Gateway OR AWS Lambda.
AWS API Gateway allow to add domain then we can use that domain to call API. But can we call through webcal protocol?
I have searched a lot but not found any solution about it.

Related

Block a request in API gateway from cloudfront s3 origin or route 53 domain

I am hosting a static website in AWS cloudfront with S3 Bucket Origin. I want to send from the frontend an API request to the AWS service API Gateway, to activate a lambda function and send an email using the service SES.
I want to use the Serverless framework to build it.
I want to restrict the access for the API Gateway to be only accessed from Cloudfront, so I wonder how can I add a restriction in the API gateway to be only accessed by: https://mywebsite.
I have created a list of possible services where I think this rule can be added:
At the rule in the YML file in Serverless framework
adding this rule in the API gateway once is created
Using AWS WAF
add an API Key in the Cloudfront distribution to the send in the header
Using a lambda function as a custom validator
If there is more than one that is possible which one would be the best or simple way?

AWS API Gateway Serve S3 Content and Lambda

I have created an SSL certificate with ACM. I would like to use this certificate to serve both my static content from an S3 bucket and my lambdas. At this time, I want to avoid using CloudFront and proxy both S3 and Lambda with API Gateway so that everything is served from a single SSL domain (no CORS issues).
Ideally, I will call:
https://my.customdomain.com/ (lambda redirects to /web/index.html)
https://my.customdomain.com/api/* (lambdas)
https://my.customdomain.com/web/* (static content - s3)
Is the above architecture reasonable/possible?
Yes, the architecture is possible.
API Gateway has this objective. To serve as a Gateway for backend services that are not exposed to your customer. One of the options to integrate with API Gateway is with Amazon S3.
Basically you will foward the object key to S3 and request this object using S3 API Calls (executed by API Gateway). You'll just need to give API Gateway the correct permissions to make this call with the proper credentials.
You can find the information needed to make this work here.

Can I use client certificate generated in API Gateway to validate at Lambda?

I have created self client certificate within API Gateway. I would like my lambda to validate before processing the request from API Gateway (Configure Backend to Authenticate API).
API Gateway allows us to copy the certificate to clipboard. Which we can save as var or file to be read within Nodejs Lambda function, authenticate and proceed further.
Do we have examples?
API Gateway is invoking your AWS Lambda function via the the Lambda Invoke method in the AWS API. Your Lambda function isn't a web server, so it isn't receiving a direct HTTPS request from API Gateway, so it isn't going to receive the HTTPS client certificate.
I would question the need for this anyway. Your API Gateway should be using an IAM role to invoke the Lambda function. That's the mechanism you would use to make sure only API Gateway has access to invoke your Lambda function. The client-certificate is for web servers running behind API Gateway that don't use IAM for authentication.

Why would you use Amazon API Gateway to access S3 rather than the traditional S3 API?

I'm looking into the Amazon API Gateway. Is there a reason to use it as an S3 Proxy rather than making calls to the S3 API directly?

AWS Cloudsearch doc upload url

Is there anyway to use AWS Gateway API as a proxy for Cloudsearch with uploading documents? We have our project setup with our authorization through the API and do not want to reconfigure our security for this?
Yes, you can use API Gateway with the AWS Service Proxy integration to upload documents to your CloudSearch documents API. I've set this up before and gotten it to work. If you've made your document service API private, such that it requires sigV4 to access, then your CloudSearch domain and your API Gateway must be owned by the same account.