Skip to content

Commit 676b625

Browse files
Fix aws region (#109)
* fixes #108, Put region flag in aws command * update CHANGELOG.md
1 parent 5a790eb commit 676b625

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
55

6+
## [2.0.1] - 2019-06-05
7+
8+
### Added
9+
- `region` flag to `mysql_user.sh` script.
10+
611
## [2.0.0] - 2019-05-23
712

813
### Added

db.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ resource "null_resource" "mysql_rw_user" {
122122
MYSQL_DB = "${var.apiary_database_name}"
123123
MYSQL_SECRET_ARN = "${data.aws_secretsmanager_secret.db_rw_user.arn}"
124124
MYSQL_PERMISSIONS = "ALL"
125+
AWS_REGION = "${var.aws_region}"
125126
}
126127
}
127128
}

scripts/mysql-user.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
MYSQL_OPTIONS="-h $MYSQL_HOST --user=$MYSQL_MASTER_USER --password=$MYSQL_MASTER_PASSWORD"
33
MYSQL_USER=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN}|jq .SecretString -r|jq .username -r)
4-
MYSQL_PASSWORD=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN}|jq .SecretString -r|jq .password -r)
4+
MYSQL_PASSWORD=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN} --region ${AWS_REGION}|jq .SecretString -r|jq .password -r)
55

66
echo "GRANT $MYSQL_PERMISSIONS ON $MYSQL_DB.* TO '$MYSQL_USER'@\`%\` IDENTIFIED BY '$MYSQL_PASSWORD';"|mysql $MYSQL_OPTIONS

0 commit comments

Comments
 (0)