aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
[CloudFront::ResponseHeadersPolicy] - [BUG] - Internal error occures when `CorsBehavior.AccessControlAllowMethods` contains improper value
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
AWS::CloudFront::ResponseHeadersPolicy
### Resource Name
_No response_
### Issue Description
When I specify improper method name in `CorsBehavior.AccessControlAllowMethods`,
CloudFormation fails with internal error instead of validation error.
The full message is:
```
Internal error reported from downstream service during operation 'AWS::CloudFront::ResponseHeadersPolicy'
```
### Expected Behavior
CloudFormation reports "Invalid request provided" error.
### Observed Behavior
CloudFormation reports an internal error occurs.
### Test Cases
Deploy following resource:
``` json5
{
"Resources": {
"TestResponseHeadersPolicy": {
"Type": "AWS::CloudFront::ResponseHeadersPolicy",
"Properties": {
"Name": "TestResponseHeadersPolicy",
"ResponseHeadersPolicyConfig": {
"CorsConfig": {
"AccessControlAllowCredentials": false,
"AccessControlAllowHeaders": {"Items": ["*"]},
"AccessControlAllowMethods": {"Items": ["PROPFIND"]}, // PROPFIND is not allowed here
"AccessControlAllowOrigins": {"Items": ["*"]},
"AccessControlExposeHeaders": {"Items": ["*"]},
"OriginOverride": true
}
}
}
}
}
}
```
### Other Details
Related #1156
Contributor guide
Research direction
Start by deploying the CloudFormation template in the issue with PROPFIND in CorsBehavior.AccessControlAllowMethods and compare the resulting error with the expected validation error. Done means the invalid method is rejected with an "Invalid request provided" error rather than an internal error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100