iisyos / metabase_ecs

Terraform that launches Metabase on Fargate, mounts data on EFS, and connects to RDS.

Home Page:https://qiita.com/22x34/items/62e3ffb6e95120ab5552

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metabase_ecs

This repository is showing how to store Metabase data which running ECS on Fargate.

Description

All AWS resources are created by Terraform, see Deployment section. Architecture is below.

  1. VPC has two subnet sets, public and private respectively.
  2. ALB is accessible from the internet and forwards requests to ECS.
  3. ECS (on Fargate) is corresponding to Metabase application.
  4. EFS is store Metabase data permanently. So if ECS is down, Metabase data is not lost.
  5. RDS is in private subnet. ECS can access to RDS via Security Group.

Deployment

  1. Install Terraform and AWS CLI your local machine.
  2. Create RDS user and password by below aws-cli command.
% aws ssm put-parameter \
    --name "/metabase/rds/mysql/username" \
    --description "rds username" \
    --value "xxxxx" \
    --type String

% aws ssm put-parameter \
    --name "/metabase/rds/mysql/password" \
    --description "rds password" \
    --value "xxxxxxxxxxxx" \
    --type SecureString
  1. Apply Terraform.
% cd terraform
% terraform init
% terraform apply
  1. Access to Metabase via ALB DNS name. You can retrieve by Terraform output.And connect to DB with RDS user and password.
% terraform output alb_dns_name

About

Terraform that launches Metabase on Fargate, mounts data on EFS, and connects to RDS.

https://qiita.com/22x34/items/62e3ffb6e95120ab5552


Languages

Language:HCL 99.7%Language:Dockerfile 0.3%