File tree 1 file changed +29
-3
lines changed
1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -199,23 +199,49 @@ values={[
199
199
200
200
4 . Create a new file named ` atlas.hcl ` with the following contents:
201
201
202
+ <Tabs >
203
+ <TabItem value = " postgres" label = " postgres" default >
204
+
202
205
``` hcl
203
206
locals {
204
207
user = "iamuser"
205
208
endpoint = "hostname-of-db.example9y7k.us-east-1.rds.amazonaws.com:5432"
206
209
}
207
210
208
211
data "aws_rds_token" "db" {
209
- region = "us-east-1"
210
- endpoint = local.endpoint
211
- username = local.user
212
+ region = "us-east-1"
213
+ endpoint = local.endpoint
214
+ username = local.user
212
215
}
213
216
214
217
env "rds" {
215
218
url = "postgres://${local.user}:${urlescape(data.aws_rds_token.db)}@${local.endpoint}/postgres"
216
219
}
217
220
```
218
221
222
+ </TabItem >
223
+ <TabItem value = " mysql" label = " mysql" >
224
+
225
+ ``` hcl
226
+ locals {
227
+ user = "iamuser"
228
+ endpoint = "hostname-of-db.example9y7k.us-east-1.rds.amazonaws.com:3306"
229
+ }
230
+
231
+ data "aws_rds_token" "db" {
232
+ region = "us-east-1"
233
+ endpoint = local.endpoint
234
+ username = local.user
235
+ }
236
+
237
+ env "rds" {
238
+ url = "mysql://${local.user}:${urlescape(data.aws_rds_token.db)}@${local.endpoint}?tls=preferred&allowCleartextPasswords=true"
239
+ }
240
+ ```
241
+
242
+ </TabItem >
243
+ </Tabs >
244
+
219
245
Let's breakdown the configuration:
220
246
* The ` aws_rds_token ` data source is used to retrieve the database password from AWS Secrets Manager.
221
247
* We define an ` env ` named ` rds ` . The value retrieved by the ` aws_rds_token ` data source
You can’t perform that action at this time.
0 commit comments