aws-amplify / aws-amplify/amplify-cli

The projection key is missing from dynamodb cli input

Open
#12,709 1 comment 0 reactions 0 assignees View on GitHub
feature-request p4 storage
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

v16.17.0

### Amplify CLI Version

11.0.2

### What operating system are you using?

Mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

### Describe the bug

DynamoDB lets us create Global Secondary Indexes with projection keys equal to 'ALL', 'ONLY KEYS' & 'Other Attributes'
Using the Amplify CLI, here is no option to create a DynamoDB Index with projection keys set to 'Only Keys' or 'Other Attributes.

I looked up in the code and it seems to be hardcoded as 'ALL' rather than taking input from the user through CLI
https://github.com/aws-amplify/amplify-cli/blob/b01aa4baf90d6426bbcd4ef9c5603a3ea697c09c/packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-builder.ts#L119

### Expected behavior

Amplify CLI must ask for 'Projection Keys' as well while creating a GSI on DynamoDB Table.

### Reproduction steps

1. Create a DynamoDB table
2. Try to create a GSI using the CLI

### 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.

Contributor guide

Open the contributing guide

Research direction

Start in packages/amplify-category-storage/src/provider-utils/awscloudformation/cdk-stack-builder/ddb-stack-builder.ts at the linked line, then trace the DynamoDB GSI creation prompts and input handling. Confirm how projection settings are represented by DynamoDB and make the CLI accept the requested projection choice instead of always using ALL; done means a GSI can be created with Only Keys or Other Attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cli, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.