Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Deploying different environments #14

Open
veloware opened this issue Mar 4, 2020 · 1 comment
Open

Deploying different environments #14

veloware opened this issue Mar 4, 2020 · 1 comment

Comments

@veloware
Copy link

veloware commented Mar 4, 2020

I have followed the steps for the serverless.js file that is to allow deployments to separate environments.

The following -

Invoking sls --env=dev will result in state files in .serverless/ being prefixed with the value of your env: Deploy.dev.json, etc. That way you can deploy unlimited environments, add pre/post processing, load whatever .env you need, etc.

Yes, I see the various state files, but when I give my dynamodb table a name in the serverless file, running a deploy for dev, then another deploy for prod will fail with

message: 'Table already exists: posts-table'

Without Serverless components, I could have posts-table-${opt:stage} to create a posts-table-dev and posts-table-prod.

How do I do this with serverless components?

@veloware
Copy link
Author

veloware commented Mar 5, 2020

I was able to get this working using the example in the following repo using serverless.js file rather than serverless.yml https://github.com/hoang-innomizetech/sls-website-example/blob/master/serverless.js

Is this the correct approach?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant