serverless-aws-alias icon indicating copy to clipboard operation
serverless-aws-alias copied to clipboard

Template format error: Unresolved resource dependencies [ApiGatewayDeployment1570755540682] in the Resources block of the template

Open lkolchin opened this issue 4 years ago • 0 comments

Since the plugin create deployment in the separate cloudformation stack I get an error on the following code in the serverless.yaml

  Resources:
      MyServiceUsagePlan:
        Type: "AWS::ApiGateway::UsagePlan"
        DependsOn: ApiGatewayDeployment${sls:instanceId} # https://serverless.com/framework/docs/providers/aws/guide/variables/
        Properties:
          UsagePlanName: !Sub "${self:service}-${self:provider.stage}"
          ApiStages:
            - ApiId:
                Ref: ApiGatewayRestApi
              Stage: ${self:provider.stage}
          Quota:
            Limit: 500000
            Period: MONTH
          Throttle:
            BurstLimit: 200
            RateLimit: 100
      
      MyServiceUsagePlanKey:
        Type: "AWS::ApiGateway::UsagePlanKey"
        DependsOn: MyServiceUsagePlan
        Properties :
          KeyId: ${self:provider.KeyId}
          KeyType: API_KEY
          UsagePlanId:
            Ref: MyServiceUsagePlan

How can I use a custom ApiKey and Custom Usage Plan for APIGW and it's stages with this plugin then?

lkolchin avatar Oct 11 '19 01:10 lkolchin