Creating AWS Resources via Severless Framework

Hi everyone. Being new to the serverless and AWS, I was wondering how you’d recommend creating the resources required by the application.

Is it possible to have the resources portion of the severless.yml trigger the creation of resources if they don’t exist? Example - Creating DynamoDB tables that are required in serverless.yml



Relatively new to serverless myself but I am pretty sure this is how it works.

You define your resources in the yaml file (eg a DynamoDB table) and then the first time you deploy the yaml, it will create the table (or any resource).

Any subsequent deploys will first check if there are any changes to the resource and will then apply those changes if required. If nothing has changed in that resource, then the deploy will do nothing to that resource.

For example, you create a YAML with a dynamo DB table and an single API gateway and associated lambda function. All 3 will be created when you deploy.
If you then add a new API gateway and lambda to the yaml and deploy, only the new API gateway and lambda will be deployed, the rest will be ignored as it hasn’t changed.

1 Like