serverless-associate-waf icon indicating copy to clipboard operation
serverless-associate-waf copied to clipboard

[Feature Request] work when the API Gateway is specified external to the serverless project

Open dls314 opened this issue 2 years ago • 1 comments

I'm importing an API Gateway from outside the serverless project using syntax like this

provider:
  apiGateway:
    metrics: true
    restApiId: ${param:RestApiId}
    restApiRootResourceId: ${param:RestApiRootResourceId}

I would still like to use the plugin, but when I try to, serverless is generating a CFN template that doesn't validate, the validation error I get is like the following

Unresolved resource dependencies [ApiGatewayRestApi] in the Outputs block of the template

dls314 avatar Oct 12 '22 19:10 dls314

In case someone else comes across this in the future. To fix the above Unresolved resource dependencies error, you can add a CloudFormation parameter to the serverless stack named ApiGatewayRestApi with the API gateway ID value. e.g.

resources:
  Parameters:
    ApiGatewayRestApi: 
      Type: String
      Default: <API gateway ID>

cpcwood avatar Nov 09 '23 23:11 cpcwood