I tried to create an image resizer lambda function and for that I use S3 bucket for storage, but when I try to add Redirection rules under S3 properties it does not allow me to save it. It keep giving me error
(Unknown Error
An unexpected error occurred.
API response
Expected params.WebsiteConfiguration.RoutingRules to be an Array)
this is the redirect rule I'm trying to add
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals/>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<Protocol>https</Protocol>
<HostName>API-endpoint</HostName>
<ReplaceKeyPrefixWith>prod/resize?key=</ReplaceKeyPrefixWith>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to upload your folders or files to. Choose Upload.
In the Permissions tab of your IAM identity, expand each policy to view its JSON policy document. 5. In the JSON policy documents, search for policies related to Amazon S3 access. Then, confirm that you have permissions for the s3:GetBucketPolicy and s3:PutBucketPolicy actions on the bucket.
Unlike standard Windows file systems, the Amazon S3 storage is case-sensitive. To ensure consistent behavior, Kentico automatically converts all file and folder names to lower case when processing files on Amazon S3.
GOT IT WORKING
Following definition works:
[
{
"Condition": {
"HttpErrorCodeReturnedEquals": "404"
},
"Redirect": {
"Protocol": "https",
"HostName": "<host>",
"ReplaceKeyPrefixWith": "<prefix>",
"HttpRedirectCode": "307"
}
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With