Skip to content

Plugin causes incorrect endpoint ServiceEndpoint/URLs in Service Information output after deploy  #149

@dannyshisler

Description

@dannyshisler

This is a Bug Report

Description

stepFunctions:
  stateMachines:
    SendConnectionRequestStepFunction:
      events:
        - http:
            path: /orders/{customerid}/resource
            method: POST
            request:
              template:
                application/json: | ...
  • What stacktrace or error message from your provider did you see?

Additional Data

I can see the problem is caused by the following code in:
serverless-step-functions/lib/deploy/events/apiGateway/deployment.js

_.merge(this.serverless.service.provider.compiledCloudFormationTemplate.Outputs, {
      ServiceEndpoint: {
        Description: 'URL of the service endpoint',
        Value: {
          'Fn::Join': ['',
            [
              'https://',
              this.provider.getApiGatewayRestApiId(),
              `.execute-api.${this.options.region}.amazonaws.com/${this.options.stage}`,
            ],
          ],
        },
      },
    });

It incorrectly overwrites the ServiceEndpoint value defined by the Serverless framework in:
serverless/lib/plugins/aws/package/compile/events/apiGateway/lib/deployment.js
using the following code:

 _.merge(this.serverless.service.provider.compiledCloudFormationTemplate.Outputs, {
      ServiceEndpoint: {
        Description: 'URL of the service endpoint',
        Value: {
          'Fn::Join': ['',
            [
              'https://',
              this.provider.getApiGatewayRestApiId(),
              `.execute-api.${this.provider.getRegion()}.`,
              { Ref: 'AWS::URLSuffix' },
              `/${this.provider.getStage()}`,
            ],
          ],
        },
      },
    });

I think the serverless-step-functions deployment code needs to more closely match the serverless framework version so that it doesn't break the outputs.

I'll try to create a pull request.

  • Serverless Framework Core Version you're using:
    1.3.1
  • The Plugin Version you're using:
    1.7.2
  • Operating System:
    OS X 10.13.6
  • Stack Trace:
  • Provider Error messages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions