aws-amplify / aws-amplify/amplify-hosting

Build Error after Import an existing DynamoDB table: storage headless is missing the following inputParams tables, region

Open
#1,544 19 comments 8 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

From _Originally posted by @hsspain in https://github.com/aws-amplify/amplify-console/issues/1359#issuecomment-745626000_

To resolve this error add the following variables to your environment variables in your build:

AMPLIFY_STORAGE_BUCKET_NAME
AMPLIFY_STORAGE_REGION

These values should correlate to the bucket name and region for your imported storage.

This documentation will guide you to the right page to add these settings:

https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html

---

@hsspain But not work for me when import dynamo and build
Error: storage headless is missing the following inputParams tables, region

and after i add ENV like this

AMPLIFY_STORAGE_REGION
AMPLIFY_STORAGE_TABLES

Not Work, Same Error

---

**To Reproduce**
Steps to reproduce the behavior:
On any amplify project with deployed frontend and backend
1. `amplify import storage`
2. Select any dynamodb resource
3. `amplify push`
4. `git add .`
5. `git commit -m 'message'`
6. `git push`
7. Go to Amplify Console `amplify console`
8. See error

```
2021-02-06T12:15:53.731Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2021-02-06T12:15:54.353Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2021-02-06T12:15:54.578Z [WARNING]: ✖ There was an error initializing your environment.
2021-02-06T12:15:54.591Z [INFO]: Failed to pull the backend.
2021-02-06T12:15:54.592Z [INFO]: storage headless is missing the following inputParams tables, region
2021-02-06T12:15:54.596Z [INFO]: Error: storage headless is missing the following inputParams tables, region
 at ensureHeadlessParameters (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-dynamodb.ts:439:11)
 at headlessImport (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-dynamodb.ts:387:40)
 at exports.importedDynamoDBEnvInit (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/import/import-dynamodb.ts:277:18)
 at runMicrotasks ()
 at processTicksAndRejections (internal/process/task_queues.js:97:5)
 at updateConfigOnEnvInit (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/provider-utils/awscloudformation/index.js:84:72)
 at /root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-category-storage/src/index.js:147:22
2021-02-06T12:15:54.614Z [ERROR]: !!! Build failed
2021-02-06T12:15:54.615Z [ERROR]: !!! Non-Zero Exit Code detected
```

Contributor guide

Open the contributing guide

Research direction

Start with amplify-category-storage/src/provider-utils/awscloudformation/import/import-dynamodb.ts, especially ensureHeadlessParameters and headlessImport, using the reported amplify import storage and amplify push flow to reproduce the failure. Done means an imported DynamoDB resource can be pulled and built without the missing tables and region error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
cloud, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.