-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Expected params.restApiId to be a string #27
Comments
Hi @mlewis7127, Thanks for reporting the issue. I'll paste a sample of your yml here for easier reference and so that search engines have a chance to index it: provider:
name: aws
runtime: nodejs16.x
apiGateway:
restApiId: !ImportValue DemoApiGW-restApiId
restApiRootResourceId: !ImportValue DemoApiGW-rootResourceId
plugins:
- serverless-api-gateway-throttling
custom:
apiGatewayThrottling:
maxRequestsPerSecond: 1000
maxConcurrentRequests: 500 |
Error:
Expected params.restApiId to be a string
***@***.*** backend % sls print
Running "serverless" from node_modules
service: backend-issue
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs16.x
memorySize: 512
stage: dev
region: eu-west-2
logRetentionInDays: 7
tracing:
lambda: true
apiGateway:
restApiId:
Fn::ImportValue: DemoApiGW-restApiId
restApiRootResourceId:
Fn::ImportValue: DemoApiGW-rootResourceId
versionFunctions: true
plugins:
- serverless-api-gateway-throttling
custom:
apiGatewayThrottling:
maxRequestsPerSecond: 1000
maxConcurrentRequests: 500
functions:
hello:
handler: handler.hello
events:
- http:
path: /issue
method: get
name: backend-issue-dev-hello
***@***.*** backend % sls print --path
provider.apiGateway.restApiId --format text
Running "serverless" from node_modules
Environment: darwin, node 14.19.2, framework 3.21.0 (local) 3.19.0v
(global), plugin 6.2.2, SDK 4.3.2
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Cannot print an object as "text"
…On Thu, Jul 21, 2022 at 3:20 PM Diana Ionita ***@***.***> wrote:
Hi @mlewis7127 <https://github.com/mlewis7127>,
Thanks for reporting the issue.
Could you please try executing sls print (reference
<https://www.serverless.com/framework/docs/providers/aws/cli-reference/print>)
in your repository and checking whether the restApiId value is properly
filled in?
I'll paste a sample of your yml here for easier reference and so that
search engines have a chance to index it:
provider:
name: aws
runtime: nodejs16.x
apiGateway:
restApiId: !ImportValue DemoApiGW-restApiId
restApiRootResourceId: !ImportValue DemoApiGW-rootResourceId
plugins:
- serverless-api-gateway-throttling
custom:
apiGatewayThrottling:
maxRequestsPerSecond: 1000
maxConcurrentRequests: 500
—
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABK2POZWH6WVUY63LBEJUXTVVFMEFANCNFSM535RUVSA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
.com>
|
Hi @mlewis7127, From the output of your console command, it looks like there's a problem with your
Could you please sort that out and come back with the result of |
Closing because there have been no updates on this issue in a while. |
Can we please re-open the issue? The error |
I've found a workaround. Instead of imporing CF output variable using
|
Hi @jjshinobi, Thanks for the information, I'll add it to the readme in case anyone runs into this again. |
When using this plugin with serverless framework v3 and referencing a restApi from another stack, I get an error that it expected params.restApiId to be a string.
For one stack I use the following serverless.yml file
serverless.yml.zip
The next stack uses the following serverless.yml from a base aws-nodejs template:
serverless.yml.zip
If I remove the throttling plugin the error message goes away.
The text was updated successfully, but these errors were encountered: