Setting function with Serverless Variables not working
See original GitHub issueThis is a Bug Report
Description
For bug reports:
- What went wrong? Failure to deploy
- What did you expect should have happened? Deployment
- What was the config you used?
service: my-lambda-test # NOTE: update this with your service name
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "= 1.15.4-alpha.1"
provider:
name: aws
runtime: python2.7
# stage: dev
region: us-east-1
memorySize: 256 # optional, in MB, default is 1024
timeout: 30 # optional, in seconds, default is 6
versionFunctions: false # optional, default is true
role: rolenameishere
profile: cantsay
deploymentBucket:
# name: my.serverless.deployment.bucket.test
serverSideEncryption: AES256
functions:
test-lambda:
handler: health-check/handler.hello # required, handler set in AWS Lambda
name: test-lambda-stuff- # ${self:provider.stage} optional, Deployed Lambda name
description: This is a test # optional, Description to publish to AWS
runtime: python2.7 # optional overwrite, default is provider runtime
memorySize: 512 # optional, in MB, default is 1024
timeout: 10 # optional, in seconds, default is 6
hello-world:
handler: health-check/handler.hello
- What stacktrace or error message from your provider did you see?
$ sls deploy -s dev -verbose Serverless: Packaging service…
Serverless Error ---------------------------------------
The stack service name “my-lambda-test-dev,true” is not valid. A service name should only contain alphanumeric (case sensitive) and hyphens. It should start with an alphabetic character and shouldn’t exceed 128 characters.
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Forums: forum.serverless.com Chat: gitter.im/serverless/serverless
Your Environment Information ----------------------------- OS: darwin Node Version: 7.8.0 Serverless Version: 1.15.4-alpha.1
If i uncomment the bucketname it becomes Could not locate deployment bucket. Error: this.getStage(…).toUpperCase is not a function
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (8 by maintainers)
At least part of the issue is that the correct verbose flag is --verbose not -verbose.
As it happens, the -s in -verbose sets the stage flag to
true
which doesn’t have a .toUpperCase() which is where the error comes from.I had the same issue, except that I incorrectly typed -stage instead of --stage