question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot add API permissions to new lambda function

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

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

v14.10.1

Amplify CLI Version

4.45.0

What operating system are you using?

Windows/Ubuntu (WLS2)

Amplify Categories

api

Amplify Commands

add, push

Describe the bug

I can no longer add API permissions to a new lambda function. This was working before I “upgraded” to the latest Amplify CLI version…

UPDATE_FAILED   functioncreateNewCompany AWS::CloudFormation::Stack Wed Mar 10 2021 13:33:54 GMT+0000 (Greenwich Mean Time) Output 'ApiId' not found in stack 'arn:aws:cloudformation:us-east-1xxxxxxxxxxx:stack/amplify-resourceshub-develop-xxxxxxx-apiAdminQueries-xxxxxxxxxxxxx/958aae00-6c96-11eb-b487-0e53bf60440d'

Expected behavior

To be able to create a new lambda function with access to my GraphQL API.

Reproduction steps

  1. amplify add function and add permissions to access your API instance.
  2. amplify push and see the stack fail to deploy since an ApiId does not exist.

Log output

# Put your logs below this line

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
attilahcommented, Mar 11, 2021

@kylekirkby I am happy that you are unblocked, I was able to reproduce the same issue, so I’m marking it as a bug:

CREATE_FAILED functionadminqff5fda81 AWS::CloudFormation::Stack Thu Mar 11 2021 13:59:25 GMT-0800 (Pacific Standard Time) Output 'ApiId' not found in stack 'arn:aws:cloudformation:us-west-2:xxxxxxx:stack/amplify-adminq-dev-135206-apiAdminQueries-xxxxxxx/fcf54a30-82b4-11eb-xxxx-xxxxxxxxxxxx'

Repro:

  • amplify init
  • add auth -> add AdminQueries
  • add function
  • update function, grant CRUD to API (AdminQueries)
  • push

Output parameters needs to include the ApiId to support the CRUD scenario.

1reaction
kylekirkbycommented, Mar 11, 2021

I’ve moved away from this approach anyway, so doesn’t block me but should still be looked at, I believe. I’ve added the adminQueriesAPI functions to a lambda layer so I’m running some Congito admin bits through that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve API Gateway REST API Lambda integration errors
To add Lambda invoke permission to a REST API with a Lambda integration using the AWS CLI ... Run the following add-permission AWS...
Read more >
How do I troubleshoot Invalid Permissions on Lambda ...
Your browser can't play this video. ... you how to troubleshoot Invalid Permissions on Lambda function errors from API Gateway REST APIs.
Read more >
How do I troubleshoot "Invalid permissions on Lambda ...
Your browser can't play this video. ... you how to troubleshoot "Invalid permissions on Lambda function " errors from API Gateway REST APIs....
Read more >
Issue with Lambda-Permission for API-Gateway #59 - GitHub
All, it seems to me that there is a bug with the created LAMBDA-Policy when creating a "ANY"- API-Gateway-Mapping to a Lambda-Function, ...
Read more >
AWS API Gateway Invoke Lambda Function Permission
You can add a resource based policy for your API Gateway to invoke your Lambda function on AWS API Gateway console. These are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found