Open m4tta opened 3 years ago
Hi @m4tta, we don't expose a flow to configure the AllowedMethods
. I've marked the issue as an enhancement. Could you tell us more about your use case?
Pretty simple use case. Just using container hosting to host a NextJS app with a custom domain. Need all http methods to be allowed so I can do basic things like submit a form on the page with a POST request.
Id love to be told I am doing something wrong or there is a better way to host a containerized NextJS app. As it seems odd to not allow all the basic HTTP methods out of the box.
I am also facing the same issue as @m4tta.
Same setup (nextjs on fargate containers), same use case (form submission using built-in nextjs API routes).
Any updates on how to set this up automatically?
I ended up abandoning amplify and just created my own infrastructure setup using AWS CDK . Much happier overall, and not as much work as I thought.
Which Category is your question related to? Container Hosting
Amplify CLI Version
You can use
amplify -v
to check the amplify cli version on your system4.47.1
What AWS Services are you utilizing? Amplify container hosting. Fargate, ECR, Cloudfront, etc.
Provide additional details e.g. code snippets
The generated
container-template.json
file does not set AllowedMethods for the cloudfront distribution. Defaults to only allowingGET, HEAD
.I need to be able to add
"AllowedMethods": ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"],
to the cloudfront cache behavior, but since this file is regenerated constantly I am lost at where to set this without manually changing it in the dashboard after each push.