Serverless Image Handler
Serverless Image Handler

Implementation Considerations

Cross-Origin Resource Sharing (CORS)

The solutions template contains two parameters: CorsEnabled and CorsOrigin that allow you to enable CORS for your image handler API. CORS defines how client web applications that are loaded in one domain can interact with resources in a different domain. With CORS support, you may make requests to your image handler API from outside the domain space of the API.

For example, if you have a public web application hosted on either a custom domain or a cloud domain outside of AWS, you can enable CORS to fetch original or modified images from the image handler API.

If you would like to change your CORS configuration after deployment, you can enable or disable CORS by editing the CorsEnabled (Yes/No) and CorsOrigin environment variables of the AWS Lambda image handler function.

On this page: