Amazon API Gateway with a custom resource policy limiting responses to a date range

AWS IAM → Amazon API Gateway

Creates an API Gateway REST endpoint with a resource policy. The resource policy contains a custom policy that limits access to the endpoint to certain date ranges.

Using resource policies, this endpoint will only accept requests between certain dates. This is just an example of many conditions that can be applied to limit access to API Gateway endpoints with resource policies.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-custom-resource-policy

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Eric Johnson

Eric Johnson

Eric Johnson is a Principal Developer Advocate for Serverless Applications at Amazon Web Services and is based in Northern Colorado. Eric is a fanatic about serverless and enjoys helping developers understand how serverless technologies introduces a major paradigm shift in how they approach building and running applications at massive scale with minimal administration overhead. Prior to this, Eric has worked as a developer, solutions architect and AWS Evangelist for an AWS partner company.

Follow on LinkedIn