Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rambabusaravanan/6dace3ea32e5c5b5f25368c4ed2b6e6e to your computer and use it in GitHub Desktop.
Save rambabusaravanan/6dace3ea32e5c5b5f25368c4ed2b6e6e to your computer and use it in GitHub Desktop.
S3 Bucket image on-demand compression and conversion using AWS Lambda
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals/>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>xxx1x11xxx.execute-api.us-east-1.amazonaws.com</HostName>
<ReplaceKeyPrefixWith>prod/convert?key=</ReplaceKeyPrefixWith>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals/>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>xxx1x11xxx.execute-api.us-east-1.amazonaws.com</HostName>
<ReplaceKeyPrefixWith>prod/resize?key=</ReplaceKeyPrefixWith>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment