aws-amplify / aws-amplify/amplify-cli
No export named apiXXXXXXXiGraphQLAPIIdOutput:GetAtt:TodoTable:StreamArn found
- 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?
v20.11.0
### Amplify CLI Version
12.10.1 , 12.10.3, 12.11.1
### 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
### Describe the bug
I have an existing function which is created` amplify add function` as DynamoDB Stream trigger.
After the I added a permission for reading auth category using `amplify update function`, `amplify push ` fails with error :
No export named apiXXXXGraphQLAPIIdOutput:GetAtt:TodoTable:StreamArn found, IsCustomResource: false
However if directly running ` amplify add function` and then adding the lambda as trigger and adding auth access allows successful push.
### Expected behavior
Push should succeed with the lambda as a stream trigger with auth access.
### Reproduction steps
% node -v
v20.12.2
% amplify --version
12.10.1
% mkdir testapp && cd $_
% amplify init
## add default auth ##
% amplify add auth
Do you want to use the default authentication and security configuration? Default configuration
How do you want users to be able to sign in? Username
Do you want to configure advanced settings? No, I am done.
## add Todo GraphQL api ##
% amplify add api
Select from one of the below mentioned services: GraphQL
Here is the GraphQL API that we will create. Select a setting to edit or continue Continue
Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)
## add a function as DynamoDB trigger ##
% amplify add function
Select which capability you want to add: Lambda function (serverless function)
Provide an AWS Lambda function name: dbtriggerfunction
Choose the runtime that you want to use: NodeJS
Choose the function template that you want to use: Lambda trigger
What event source do you want to associate with Lambda trigger? Amazon DynamoDB Stream
Choose a DynamoDB event source option Use API category graphql `@model` backed DynamoDB table(s) in the current Amplify project
Selected resource
Selected `@model` Todo
? Do you want to configure advanced settings? No
? Do you want to edit the local lambda function now? No
## deploy successfully ##
% amplify push -y
## update the function to add reading auth permission ##
% amplify update function
? Select the Lambda function you want to update dbtriggerfunction
? Which setting do you want to update? Resource access permissions
? Select the categories you want this function to have access to. auth
? Select the operations you want to permit on dbtriggerfunction read
? Do you want to edit the local lambda function now? No
## fail to deploy ##
% amplify push -y
## creating with adding permission works fine ##
% amplify remove function dbtriggerfunction
% amplify add function
? Select which capability you want to add: Lambda function (serverless function)
? Provide an AWS Lambda function name: dbtriggerfunction
? Choose the runtime that you want to use: NodeJS
? Choose the function template that you want to use: Lambda trigger
? What event source do you want to associate with Lambda trigger? Amazon DynamoDB Stream
? Choose a DynamoDB event source option Use API category graphql `@model` backed DynamoDB table(s) in the current Amplify project
Selected resource
Selected `@model` Todo
? Do you want to configure advanced settings? Yes
? Do you want to access other resources in this project from your Lambda function? Yes
? Select the categories you want this function to have access to. auth
? Select the operations you want to permit on dbtriggerfunction read
? Do you want to invoke this function on a recurring schedule? No
? Do you want to enable Lambda layers for this function? No
? Do you want to configure environment variables for this function? No
? Do you want to configure secret values this function can access? No
✔ Choose the package manager that you want to use: · NPM
? Do you want to edit the local lambda function now? No
## deploy successfully ##
% amplify push -y
### 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
Research direction
Reproduce the failure with the documented amplify init, add api, add function, amplify update function, and amplify push sequence. Trace the generated deployment resources for the GraphQL Todo table stream export before and after adding auth read access. Done means the existing stream-triggered function retains auth access and amplify push succeeds without the missing export error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, graphql, node.js, typescript
- Domain
- api, backend, cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100