Skip to content

Commit 27a60c8

Browse files
committed
refactor: 개발 환경 스케일다운 및 스왑 메모리 할당
1 parent 39af70a commit 27a60c8

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

terraform/dev/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ locals {
4242

4343
dev_instance_definitions = {
4444
ami = "ami-012ea6058806ff688"
45-
instance_type = "t3a.small"
45+
instance_type = "t2.micro"
4646
role = "dev"
4747
iam_instance_profile = data.terraform_remote_state.common.outputs.instance_profile_name["ec2-to-ecs"]
4848
key_name = "eatda-ec2-dev-key"

terraform/dev/scripts/user-data.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
echo ECS_CLUSTER=${ecs_cluster_name} >> /etc/ecs/ecs.config
33

4+
fallocate -l 2G /swapfile
5+
chmod 600 /swapfile
6+
mkswap /swapfile
7+
swapon /swapfile
8+
echo '/swapfile none swap sw 0 0' >> /etc/fstab
9+
410
mkdir -p /home/ec2-user/logs/backup
511
mkdir -p /home/ec2-user/mysql
612
mkdir -p /home/ec2-user/scripts

terraform/dev/terraform.tfvars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ecs_services = {
2020

2121
ecs_task_definitions_base = {
2222
api-dev = {
23-
cpu = 1500
24-
memory = 1024
23+
cpu = 500
24+
memory = 256
2525
network_mode = "host"
2626
requires_compatibilities = ["EC2"]
2727

@@ -47,7 +47,7 @@ ecs_task_definitions_base = {
4747
mysql-dev = {
4848
cpu = 256
4949
memoryReservation = 128
50-
memory = 512
50+
memory = 256
5151
network_mode = "host"
5252
requires_compatibilities = ["EC2"]
5353
container_image = "mysql:8"

0 commit comments

Comments
 (0)