From 7cee6e9a0ed071c66789323a9d46e6fc6dcf1be7 Mon Sep 17 00:00:00 2001 From: mashiike Date: Wed, 16 Jun 2021 11:31:52 +0900 Subject: [PATCH 1/4] push latest tag --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 12701d3..f081e6d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,9 @@ export GO111MODULE := on image: docker build \ --tag ghcr.io/kayac/mascaras:$(GIT_VER) \ + --tag ghcr.io/kayac/mascaras:latest \ . release-image: image docker push ghcr.io/kayac/mascaras:$(GIT_VER) + docker push ghcr.io/kayac/mascaras:latest From 0f51b46188c30dfe06a85162abf2ac88bd3cb4a9 Mon Sep 17 00:00:00 2001 From: mashiike Date: Wed, 16 Jun 2021 11:32:14 +0900 Subject: [PATCH 2/4] update README.md --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6fa5bea..9c35727 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,26 @@ this is backup tool for Aurora MySQL. mascaras creates Clone Aurora MySQL, execute the SQL, and then create a Snapshot. + +## Architecture + +1. Clone Source Aurora MySQL. +2. Execute SQL on cloned Aurora MySQL. +3. Wait for LatestRestorableTime to pass the last SQL execution time. +4. Take a snapshot of the cloned Aurora MySQL. +5. (Optional) Start S3 Export Task of the created snapshot. + +## Installation + +### Binary packages + +[Releases](https://github.com/kayac/mascaras/releases) + +### Docker + +```console +$ docker pull ghcr.io/kayac/mascaras:latest +``` ## Usage ```shell @@ -157,8 +177,7 @@ $ mascaras -db-user-name user01 -database db01 -sql-file ./mask.sql database-src 2021/06/10 17:00:56 [info] finish cleanup 2021/06/10 17:01:01 [info] success ``` - -## Extended usage (intaractive) +## Usage: intaractive mode `-interactive` will launch a simple Prompt after running sql. For example, if you want to check the temporary mask data, you can use it as shown in the example below. @@ -260,6 +279,58 @@ exit prompt. 2021/06/11 15:00:19 [info] success. ``` +## Usage: ECS scheduled tasks with Fargate + +As a usecase, Consider using ECS scheduled tasks. + +example task definition +```json +{ + "taskDefinition": { + "family": "mascaras", + "executionRoleArn": "", + "taskRoleArn": "" + } + ], + "secrets": [ + { + "name": "MASCARAS_DB_USER_NAME", + "valueFrom": "/MASCARAS_DB_USER_NAME" + }, + { + "name": "MASCARAS_DB_USER_PASSWORD", + "valueFrom": "/MASCARAS_DB_USER_PASSWORD" + } + ], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": "/docker/mascaras", + "awslogs-region": "ap-northeast-1", + "awslogs-stream-prefix": "mascaras" + } + } + } + ] + } +} +``` + + + # LICENCE MIT From e93e2afbf6eda8da0710d87c63cecb166cb8a25c Mon Sep 17 00:00:00 2001 From: ikeda-masashi Date: Wed, 16 Jun 2021 12:19:56 +0900 Subject: [PATCH 3/4] Update README.md Co-authored-by: FUJIWARA Shunichiro --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c35727..064aa63 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ mascaras creates Clone Aurora MySQL, execute the SQL, and then create a Snapshot ## Architecture 1. Clone Source Aurora MySQL. -2. Execute SQL on cloned Aurora MySQL. +2. Execute SQL on the cloned Aurora MySQL. 3. Wait for LatestRestorableTime to pass the last SQL execution time. 4. Take a snapshot of the cloned Aurora MySQL. 5. (Optional) Start S3 Export Task of the created snapshot. From 3f6e31d5f77643e0861c1cc95f4eb3ecf7e84555 Mon Sep 17 00:00:00 2001 From: mashiike Date: Wed, 16 Jun 2021 14:06:26 +0900 Subject: [PATCH 4/4] update README --- README.md | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 064aa63..3925fd2 100644 --- a/README.md +++ b/README.md @@ -286,46 +286,44 @@ As a usecase, Consider using ECS scheduled tasks. example task definition ```json { - "taskDefinition": { - "family": "mascaras", - "executionRoleArn": "", - "taskRoleArn": "" - } - ], - "secrets": [ - { - "name": "MASCARAS_DB_USER_NAME", - "valueFrom": "/MASCARAS_DB_USER_NAME" - }, - { - "name": "MASCARAS_DB_USER_PASSWORD", - "valueFrom": "/MASCARAS_DB_USER_PASSWORD" - } - ], - "logConfiguration": { - "logDriver": "awslogs", - "options": { - "awslogs-group": "/docker/mascaras", - "awslogs-region": "ap-northeast-1", - "awslogs-stream-prefix": "mascaras" - } + "family": "mascaras", + "executionRoleArn": "", + "taskRoleArn": "" + } + ], + "secrets": [ + { + "name": "MASCARAS_DB_USER_NAME", + "valueFrom": "/MASCARAS_DB_USER_NAME" + }, + { + "name": "MASCARAS_DB_USER_PASSWORD", + "valueFrom": "/MASCARAS_DB_USER_PASSWORD" + } + ], + "logConfiguration": { + "logDriver": "awslogs", + "options": { + "awslogs-group": "/docker/mascaras", + "awslogs-region": "ap-northeast-1", + "awslogs-stream-prefix": "mascaras" } } - ] - } + } + ] } ```