-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(amplify-alpha): customResponseHeaders does not support monorepo structures #31758
Copy link
Copy link
Closed
Closed
Copy link
Labels
@aws-cdk/aws-amplifyRelated to AWS AmplifyRelated to AWS AmplifybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2
Description
Describe the bug
Firstly, I can't tell if this is a CDK or Amplify issue. aws-amplify/amplify-hosting#1995 seems related, but someone in that issue was using customHttp.yml which we can't do on CDK.
I've tried to condense this into a simple example app below. It works without the customResponseHeaders property. However, when I add customResponseHeaders, it still deploys via CloudFormation, but when the Amplify build runs I get the errors below.
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
The app deploys successfully on Amplify.
Current Behavior
The app errors on Amplify deploy:
!!!Monorepo spec provided without "applications" key
!!!Unable to save headers: CustomerError: Monorepo spec provided without "applications" key
Reproduction Steps
Example Amplify app:
const amplifyApp = new AmplifyApp(this, `AmplifyApp`, {
buildSpec: BuildSpec.fromObjectToYaml({
version: "1.0",
applications: [
{
appRoot: "frontend",
frontend: {
phases: {
preBuild: {
commands: [
"npm install -g pnpm",
"pnpm install --frozen-lockfile",
],
},
build: {
commands: ["pnpm run build"],
},
},
artifacts: {
baseDirectory: ".next",
files: ["**/*"],
},
cache: {
paths: [".next/cache/**/*"],
},
},
},
],
}),
customResponseHeaders: [
{
pattern: "**",
headers: {
Test: "test",
},
},
],
});Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.162.1 (build 10aa526)
Framework Version
2.162.1-alpha.0
Node.js Version
v22.9.0
OS
macOS 14.7 (23H124)
Language
TypeScript
Language Version
TypeScript 5.6.3
Other information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-amplifyRelated to AWS AmplifyRelated to AWS AmplifybugThis issue is a bug.This issue is a bug.effort/mediumMedium work item – several days of effortMedium work item – several days of effortp2