Open eduardo3g opened 3 years ago
This error occurs because, during the deployment with Serverless Framework, it goes to SSM Parameter Store to retrieve an S3 bucket name - which is the bucket that'll store the dependencies files, etc.
There are currently three approaches to deploy the back-end application:
Easiest way - Removing Serverless Layers feature
serverless.yml
file.npx sls deploy
.Manually creating an S3 Bucket for your layers and SSM Parameter
twitterappsync-layer-deployment-bucket-<an-unique-identifier>
. Remember that S3 is a global service, so S3 bucket names must be unique.twitterappsync-layer-deployment-bucket-ASDKJL1d
.Parameter Store
on the left menutwitterappsync/dev/layer-deployment-bucket
. The parameter type can be String.npx sls deploy
The ideal solution
Unfortunately, there's not a workaround via Serverless Framework to first deploy an S3 Bucket and SSM Parameter, the deploy the app using serverless layers.
One good approach is combining Serverless Framework with some IaC (Infrastructure as Code) tool such as Terraform. I'd go with the following solution:
can you solve it and share running application and please share .env example ? Please add terraform also if need
Hi @pchauhan77, adding the Terraform step is on my roadmap but there is not an ETA yet.
I recommend you to follow the second option ("Manually creating an S3 Bucket for your layers and SSM Parameter") for now.
Regarding the .env
file, there's already a closed issue for that. After you're able to deploy the application by running npx sls deploy
, run the command npm run exportEnv
and it'll generate a .env file in your root directory.
The error below is thrown when the command
npx sls deploy
is executed. This comes from theserverless-layers
plugin because it could not find an S3 Bucket to push the layers during the deployment.