You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -201,28 +201,29 @@ Shown below is a simple Node.js 16 function which has the appropriate [IAM Permi
201
201
202
202

203
203
204
-
#### Scope variables to a specific environment
205
-
Your `template.yaml` file can contain a variable that indicates the environment of the app. You can use this variable to fetch the correct env variable in SSM depending on the environment you are deploying your app to.
206
-
For exemple, a [Lamby app](https://lamby.cloud/docs/quick-start) has a `RailsEnv` variable in the `template.yaml` file that indicates the environment you are deploying the app:
204
+
#### Using Dynamic SSM Paths
205
+
206
+
Your `template.yaml` file can contain input `Parameters` that indicates the environment of the app. You can use this parameter to fetch the correct env variable in SSM depending on the environment you are deploying your app to. For exemple, a [Lamby app](https://lamby.cloud/docs/quick-start) has a `RailsEnv` parameter which is commonly set to to indicate the environment you running under:
207
+
207
208
```yaml
208
209
Parameters:
209
-
210
210
RailsEnv:
211
211
Type: String
212
212
Default: staging
213
213
AllowedValues:
214
214
- staging
215
215
- production
216
216
```
217
-
This variable can be used to get SSM variables that follow this path: `/myapp/${RailsEnv}/MY_VARIABLE`. The `template.yaml` file will then look like this:
217
+
218
+
This parameter can be used to fetch SSM-backed environment variables that leveage dynamic paths like `/myapp/${RailsEnv}/MY_VARIABLE`. The `template.yaml` file will then look like this example below. This way you can have one different SSM variable for each one of your environments in a single AWS account.
0 commit comments