amplify-cli: Creating function and doing amplify push results in cloudformation `Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values` error

Describe the bug I added a lambda function through amplify cli and did amplify push. Also tried amplify function push. The push failed with:

UPDATE_FAILED <redact>AmplifyCLI AWS::CloudFormation::Stack Wed Apr 24 2019 10:21:12 GMT-0600 (Mountain Daylight Time) Parameters: [S3DeploymentBucket, S3DeploymentRootKey] must have values

This error above is with my graphql API stack.

Then what I did is just touch one of my custom nested stacks to force an “Update” on my graphql API. The the push succeeded.

To Reproduce Steps to reproduce the behavior:

  1. Have a graphql API with some custom stacks pushed
  2. Create a lambda function through amplify console. amplify status will show only the function needs to be created and there is no changes elsewhere.
  3. Do amplify push
  4. You’ll get the error and push fails
  5. Force the graphql API to go in “Update” state by touching one of the nested stack json
  6. Do amplify push, it succeeds and the lambda function is created.

Expected behavior Lambda function creation should succeed without having to update the Appsync/GraphQL API portion of the stack.

Additional context Running 1.6.4. Also tried reverting to 1.6.3 but got same error.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I discovered that the above issue only occurs when using amplify init with the --yes option. When the yes option is provided the init starts the push (which does in itself seem weird to me) and generates the above exception. If you run init without the yes option and then run push afterwards, it works ok. Now I have a new issue, that the amplify publish fails due to an unhandled exception related to the AWS SDK not finding an AWS accessKey, which I need to investigate further. This is odd as the init was ok and the configLevel is set to general so I would expect it to use the ECS instance metadata.

I had the same issue. I’ve upgraded to amplify 1.6.7 and now get this when running amplify init in CodeBuild (with configLevel set to general).

Edit: Docker image is aws/codebuild/nodejs:10.14.1

- Initializing your environment: test ✔ Initialized provider successfully. Could not read cloudformation template at path: /codebuild/output/srcxxxxxxxx/src/amplify/backend/api/xxxxxx/build/cloudformation-template.json ✖ An error occurred when pushing the resources to the cloud ✖ There was an error initializing your environment. init failed { Error: ENOENT: no such file or directory, open '/codebuild/output/srcxxxxxx/src/amplify/backend/api/xxxxxx/build/parameters.json' at Object.openSync (fs.js:436:3) at Object.writeFileSync (fs.js:1187:35) at writeUpdatedParametersJson (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/upload-appsync-files.js:85:8) at uploadAppSyncFiles (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/upload-appsync-files.js:126:5) at process._tickCallback (internal/process/next_tick.js:68:7) errno: -2, syscall: 'open', code: 'ENOENT', path: '/codebuild/output/srcxxxxxxxx/src/amplify/backend/api/xxxxxx/build/parameters.json' }

I have the exact same error when I push code to my repository and trigger an automated build in the console. The issue only occurs if I don’t make a change to my Graphql. Steps to reproduce include:

  • Make a change to my code and schema.graphql file
  • Commit and push code
  • Automated deployment succeeds
  • Go back to code and make a change to application (no changes to graphql)
  • Commit and push code
  • Automated build fails
  • Go back to code, add a new line to my schema.graphql file
  • Commit and push
  • Automated build succeeds.