Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions docs/DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Overview

Deploy usage guide and design decision.

## Multi-stage, multi-region deploy

By default, all functions are deploy to a stage (`dev`) and a region. The
autogenerated resource group name will reflect this information. The name
follow the Microsoft recommended [naming convention](https://docs.microsoft.com/en-us/azure/architecture/best-practices/naming-conventions#general).

### Using exitsing resource group

`sls deploy -s dev -r westus2 -g myResourceGroup`

- Use resource group `myResourceGroup`
- Create/Update app service plan, app service
- Zipdeploy code

### No resource group specified

`sls deploy -s dev -r westus2`

- Create if not exist resource group `<service>-dev-westus2-rg`
- Create/Update app service plan, app service
- Zipdeploy code

### Design decision on resource group support

#### Specifying resourceGroup in serverless.yml

- it is not clear if a resourceGroup has already been associated with a given stage and region.

For example, we have the following default config

```yaml
provider:
stage: dev
region: westus
resourceGroup: myResourceGroup
```

then user try to deploy
`sls deploy -s prod -r westus`

1. Do we use the environment variables / creds associated with `dev` or `prod`?
1. Someone new to the codecase see both the `serverless.yaml` and the command in a CD script, how can they tell which resourceGroup goes where.

#### Specifying resourceGroup in command line

`sls deploy -s prod -r westus -g prodResourceGroup`

1. With this format, it's more clear which stage+region combo is associated with a resourceGroup.
1. User can still make mistake, however, and use the `wrong` resource group for a specific stage.

#### Don't support user defined resource group

1. always using the right resource group
1. restrictive for user who have already defined their resources
68 changes: 53 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading