Skip to content

Commit

Permalink
Add region flag to MYSQL_USER command (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepbhadani authored Jun 6, 2019
1 parent 676b625 commit 3f7cd47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

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).

## [2.0.2] - 2019-06-06

### Added
- `region` flag to `mysql_user.sh` script.

## [2.0.1] - 2019-06-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion scripts/mysql-user.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
MYSQL_OPTIONS="-h $MYSQL_HOST --user=$MYSQL_MASTER_USER --password=$MYSQL_MASTER_PASSWORD"
MYSQL_USER=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN}|jq .SecretString -r|jq .username -r)
MYSQL_USER=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN} --region ${AWS_REGION}|jq .SecretString -r|jq .username -r)
MYSQL_PASSWORD=$(aws secretsmanager get-secret-value --secret-id ${MYSQL_SECRET_ARN} --region ${AWS_REGION}|jq .SecretString -r|jq .password -r)

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

0 comments on commit 3f7cd47

Please sign in to comment.