- Newest
- Most votes
- Most comments
If you need to use methods like PUT, POST, or DELETE with CloudFront, keep in mind that S3 doesn't support them — that's why they're removed. To fix this, you can use API Gateway or an Application Load Balancer (ALB) as the origin instead. Both support all HTTP methods and give you more control. If you share more about your setup, it'll be easier to help you better.
The issue you're experiencing with CloudFront Allowed HTTP Methods resetting is unusual and not expected behavior. However, there are a few things to consider:
-
Permissions: Ensure that you have the necessary permissions to modify the CloudFront distribution settings. If you don't have the right permissions, changes might not persist.
-
Origin Configuration: Since your CloudFront distribution is connected to an S3 origin, it's important to note that S3 doesn't support all HTTP methods by default. This could potentially cause issues with certain method selections.
-
Lambda Function: The Lambda function in the Viewer Request section could potentially be interfering with the HTTP methods configuration. Review the Lambda function to ensure it's not modifying the allowed methods.
-
Cache Behavior Settings: Double-check other settings in the cache behavior that might be conflicting with the allowed methods. For example, if you're using field-level encryption, it requires specific settings for allowed methods.
-
CloudFront Console Bug: There's a possibility that you're encountering a bug in the CloudFront console. In this case, you could try using the AWS CLI or SDK to update the distribution instead of the console.
-
Wait for Deployment: Remember that changes to a CloudFront distribution can take some time to propagate. Make sure you're waiting for the distribution to fully deploy before checking if the changes have persisted.
If the issue persists after considering these points, it would be advisable to contact AWS Support for further assistance, as this behavior is not typical and might indicate a deeper issue with your specific distribution or account settings.
Sources
AllowedMethods - Amazon CloudFront
HTTP 405 status code (Method Not Allowed) - Amazon CloudFront
CacheBehavior - Amazon CloudFront
Use field-level encryption to help protect sensitive data - Amazon CloudFront
Relevant content
- asked 2 years ago
- asked a year ago
- AWS OFFICIALUpdated 10 months ago