amplify-backend
amplify-backend copied to clipboard
Amplify Custom Headers Monorepo format not supported
How did you install the Amplify CLI?
pnpm
If applicable, what version of Node.js are you using?
18+
Amplify CLI Version
11.0.5
What operating system are you using?
macOS
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
The custom headers format for monorepo is not recognised.
Expected behavior
The custom headers format for monorepo is recognised.
Reproduction steps
- Go to Amplify Console
- Select the Application/Hosting/Custom Headers
- Try to use the Monorepo format as shown in the example: https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html#custom-header-YAML-format ex:
applications:
- appRoot: 'dfd'
customHeaders:
- pattern: '**'
headers:
- key: 'Strict-Transport-Security'
value: 'max-age=31536000; includeSubDomains'
- key: 'X-Frame-Options'
value: 'SAMEORIGIN'
- key: 'X-XSS-Protection'
value: '1; mode=block'
- key: 'X-Content-Type-Options'
value: 'nosniff'
- key: 'Content-Security-Policy'
value: "default-src 'self'"
The result:
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
This origins from Amplify Console new UI changes.
In the old UI, the format was recognised and it showed a correct YAML format. There is a customHttp.yml at the root of the project with the values
Now, it looks like this(notice that no changes were made):
You're making customers to lose money. Please do something.
On a quick test, I was able to reproduce the issue. Marking as bug.
created the header as nested throws an error:
creating it without nested does not throw an error.
The docs show as nested: https://docs.aws.amazon.com/amplify/latest/userguide/custom-headers.html#custom-header-YAML-format
On a save the console throws an error:
@hackmajoris we are prioritizing a fix for this issue. In the meantime can you DM me or @Jay2113 on Discord to discuss this?
@hackmajoris thank you for your continued cooperation. We have deployed a fix for this issue and can you please verify if you are now unblocked?
@hackmajoris thank you for your continued cooperation. We have deployed a fix for this issue and can you please verify if you are now unblocked?
I did some tests and the issue is gone. Thanks for your effort to fix it. I'll close the issue.