localstack / localstack/serverless-localstack

Protocol now required when using `custom.localstack.host`

Open
#257 1 comment 0 reactions 0 assignees View on GitHub
improve-error-messages status: backlog
Dominant language
JavaScript
Stars
542
Forks
92
PR merge metrics
No merged PRs in 30d

Description

## Description

Since serverless-loaclstack v1.2.1 it appears that the protocol needs to be included in the `custom.localstack.host` property.
In older versions it appears this was not required.

## Configuration

In our serverless configuration we had something similar to:
```yaml
custom:
localstack:
host: ${env:SOME_VAR, '127.0.0.1'}
```

i.e. without the protocol (`http://`).

## serverless-localstack v1.2.0:

Using this with:
- serverless: v3.36.0 (using an older version to be able test with older plugin versions)
- serverless-localstack: v1.2.0

The debug output shows:
```
Reconfiguring service acm to use http://127.0.0.1:4566
Reconfiguring service amplify to use http://127.0.0.1:4566
Reconfiguring service apigateway to use http://127.0.0.1:4566
```

## serverless-localstack v1.2.1:

Using this with:
- serverless: v3.36.0 (using an older version to be able test with older plugin versions)
- serverless-localstack: v1.2.1

The debug output shows:
```
Reconfiguring service acm to use 127.0.0.1://127.0.0.1:4566
Reconfiguring service amplify to use 127.0.0.1://127.0.0.1:4566
Reconfiguring service apigateway to use 127.0.0.1://127.0.0.1:4566
```

which then results in errors such as:
```
aws: [1] { UnknownEndpoint: Inaccessible host: `127.0.0.1' at port `443'. This service may not be available .....
```

## Additional information

In the documentation the example does include the protocol when setting the `custom.localstack.host` so I suppose it can also be seen as a configuration error on our end.. but in that case a clearer error message might be useful.

I'm also guessing the change in behavior is caused by #243

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported configuration with serverless-localstack v1.2.0 and v1.2.1, then inspect the change referenced in #243 and the code that builds the LocalStack endpoint. Done should mean a host without a protocol either continues to work as before or produces a clear configuration error, with regression coverage for the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.