Deploy error : "Value of property ApiId must be of type String"

I am getting the following error when deploying:

CloudFormation - UPDATE_FAILED - AWS::ApiGateway::UsagePlan - ApiGatewayUsagePlan
Serverless: Operation failed!
  Serverless Error ---------------------------------------
  An error occurred: ApiGatewayUsagePlan - Value of property ApiId must be of type String.

This is after I specified an existing API gateway to reuse in serverless.yml:

    restApiId: g182i56ug3
    restApiRootResourceId: fdlrrhdba0

The exact same configuration worked OK last week, but for some reason not today.
Is anyone experiencing the same or has seen this before?

I managed to figure this out. Basically I was incorrectly including the API key:

    - shedd-product-analytics-api-key
    restApiId: "g182i56ug3"
    restApiRootResourceId: "fdlrrhdba0"

The API key had already been created before, so removing the apiKeys section fixed the issue.

1 Like