Open tomchiverton opened 1 year ago
Thanks for reporting this issue @tomchiverton.
To my knowledge, there is no mechanism to automatically trim long resource name in the Serverless framework packaging process. That is one of the reason for the existence of the name
property, available in lambda function definition in the service file definition (see https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/#functions).
The following exemple service file, using solely core serverless framework (not this plugin), results in the exact same error:
# serverless.yml
service: myService
provider:
name: aws
runtime: nodejs14.x
functions:
myVeryVeryLongAndDefinitelyOverTheLimitOfSixtyFourCharsFunctionName:
handler: handler.index
Could you let me know which trimming logic you're referring to ?
On the other hand, the AWS CDK, used within Lift, to provision all non-Lambda function resources, does indeed handle resource name generation to guarantee those generated strings are within services constraints.
Finally, you can use any property existing within Serverless framework documentation in the worker
property of the queue construct. You can therefore refer to worker.name
property, defining a short acceptable name, to bypass this problem.
service: something-service
constructs:
pdf-email-send-queue-no-vpc:
type: queue
worker:
handler: pdfEmail.emailSender
name: short-name
I think I was thinking of things like the S3 deploy bucket name being truncated.
That work around is a handy trick.
Description
In main Serverless, if a resource name ends up being too long, it's truncated and made unique e.g. 'my-long-name-trunc-H6E8'
Constructs do not appear fo this for their workers, so deployments of projects with "too long" service and/or stage and/or resource (
type: queue
) names fails.How to Reproduce
sls deploy --stage the-stage-name
Additional Information