-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#17 add ssm parameter to store list of users
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
# Read the JSON file | ||
#https://registry.terraform.io/providers/hashicorp/local/latest/docs/data-sources/file | ||
data "local_file" "user_list" { | ||
filename = "${path.module}/user_list.json" | ||
} | ||
|
||
# Create SSM Parameter | ||
#https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter | ||
resource "aws_ssm_parameter" "user_list" { | ||
name = "/${var.name}/db_user_list" # Replace with your desired parameter name | ||
description = "User and database mappings for Amazon RDS for PostgreSQL DB users." | ||
type = "String" | ||
value = data.local_file.user_list.content | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"user_database_mappings": [ | ||
{ | ||
"username": "user1" | ||
}, | ||
{ | ||
"username": "user2", | ||
"database": "postgres" | ||
}, | ||
{ | ||
"username": "user3", | ||
"database": "db1" | ||
}, | ||
{ | ||
"username": "user4", | ||
"database": "db3" | ||
} | ||
] | ||
} |