-
Notifications
You must be signed in to change notification settings - Fork 220
Description
This is a Bug Report
Description
-
What went wrong?
The URLs for http endpoints and the service endpoint reported by the framework in the Service Information after a deploy are incorrect after integrating and using the serverless-step-functions plugin, the amazonaws.com/{stage} part of the url is being doubled up. -
What did you expect should have happened?
In the Service Information report after a deploy instead of something like:
https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev/myendpoint/
I’m getting:
https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/devamazonaws.com/dev/myendpoint/
Also, I can see that the ServiceEndpoint key in the CloudFormation output for the stack is wrong, its value is:
https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/devamazonaws.com/dev
(I export these values to use in tests so this is causing me problems) -
What was the config you used?
I have several step functions one of which currently has an http endpoint:
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: