-
Notifications
You must be signed in to change notification settings - Fork 0
[feat/init] Add terraform project files #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yongjun0511
reviewed
Aug 24, 2025
yongjun0511
reviewed
Aug 25, 2025
- terraform fmt -recursive & terraform validate μ€ν
- λ°°ν¬ κ΄λ ¨ λΈλμΉ μ€λͺ μ½λμ μΌμΉν - secret.tfvars μ΄μΈμ μ μΈ
- tfvars κ΄λ ¨ ignore νμΌλͺ μμ
- S3 λͺ¨λ μΆκ° μ μ - varsμ environment μΆκ° - S3 λͺ¨λ μ¬μ©λ² README μΆκ°
- tfvars κ΄λ ¨ ignore νμΌλͺ μμ ν terraform.tfvars λ°μλ¨
- tfvars κ΄λ ¨ ignore νμΌλͺ μμ ν terraform.tfvars λ°μλ¨
- κ° λͺ¨λ variable.tfμ purposeμ environment, tags μΆκ° - κ° λͺ¨λ main.tfμ tags μ μ - compute, database λ±μ μ μ©
- volume size μ λ ₯λ°μ - volume type μ λ ₯λ°μ - public IP μ¬μ© μ¬λΆ μ λ ₯λ°μ - SSH ν€ μ£Όμ - was-userdata.shλ‘ wsaμ© userdata μμ μΆκ°
- volume size μ λ ₯λ°μ - volume type μ λ ₯λ°μ - public IP μ¬μ© μ¬λΆ μ λ ₯λ°μ - SSH ν€ μ£Όμ - was-userdata.shλ‘ wsaμ© userdata μμ μΆκ°
- engine_version, instance_class, publicly_accessible, backup_retention_period, parameter_group_name μΆκ°
- variables.tfμ description μΆκ° - output.tfμ description μΆκ°
- dev μ μ© - prod μ μ©
- dev μ μ© - prod μ μ© - terraform format & validate
- dev μ μ© - prod μ μ©
- VPC, IGW, Route Tables -> 곡μ 리μμ€μ environment νκ·Έ μμ - compute.tf -> api μλ² λͺ μ
- κ°μ©μμ, μλΈλ· λΆλΆ νλμ½λ©μΌλ‘ μμ
- EC2μ RDSμ 보μκ·Έλ£Ή λΆλ¦¬ - RDS 보μκ·Έλ£Ήμ 3306 ν¬νΈ μ΄μ΄λ - νλΌλ―Έν° κ·Έλ£Ή μ μ©
- ACM λͺ¨λ μΆκ° (SSL μΈμ¦μ κ΄λ¦¬)
- ALB λͺ¨λ μΆκ° (Application Load Balancer)
- dev/prod νκ²½μ ACMκ³Ό ALB μ μ©
- CI μν¬νλ‘μ° μ΅μ ν (terraform plan λ³μ μ΅μν)
- DB ID ν΅μΌ ('clokey_db'λ‘ μ€μ )
- Route53 λͺ¨λ κ°μ (ALB alias λ μ½λ μ§μ)
- 보μ κ°ν (EC2λ ALBλ₯Ό ν΅ν΄μλ§ μ κ·Ό κ°λ₯)
yongjun0511
approved these changes
Sep 21, 2025
- EC2 KeyPair μ΄λ¦ λ¬Έμ ν΄κ²° - MySQL λ²μ μ 8.0.35 β 8.0.34λ‘ λ³κ²½ - μΈμ¦μ κ²μ¦ νμμμμ 10λΆ β 20λΆμΌλ‘ μ¦κ° - Route53 λ μ½λ μμ‘΄μ± λͺ μμ μΆκ° - S3 λ²ν· μ€λ³΅ λ¬Έμ - website_endpoint β website_domainμΌλ‘ λ³κ²½
- EC2 KeyPair, RDS MySQL λ²μ , S3 λ²ν· μΆ©λ λ¬Έμ ν΄κ²° - ACM μΈμ¦μ κ²μ¦ λ° UserData λ‘κΉ κ°μ - deprecated μμ± μμ
- ALB μ€μ
π Terraform Plan Result (dev)data.aws_ami.ubuntu_latest: Reading...
data.aws_availability_zones.available: Reading...
data.aws_region.current: Reading...
data.aws_caller_identity.current: Reading...
module.vpc.aws_vpc.this: Refreshing state... [id=vpc-08274a8d95d833104]
module.rds.aws_db_parameter_group.main[0]: Refreshing state... [id=dev-clokey-rds-parameter-group]
module.route53_zone.aws_route53_zone.main[0]: Refreshing state... [id=Z09909261Y36ELN4EONUQ]
module.s3.aws_s3_bucket.this: Refreshing state... [id=dev-clokey-storage-bucket]
data.aws_region.current: Read complete after 0s [id=ap-northeast-2]
module.acm.aws_acm_certificate.main: Refreshing state... [id=arn:aws:acm:ap-northeast-2:594755789271:certificate/c9eb1c76-81f0-4b8f-86d2-edb6cb6c2b9d]
data.aws_caller_identity.current: Read complete after 0s [id=594755789271]
data.aws_availability_zones.available: Read complete after 0s [id=ap-northeast-2]
module.acm.aws_route53_record.cert_validation["dev.clokey.store"]: Refreshing state... [id=Z09909261Y36ELN4EONUQ__0260b097a295b57f4ae0d8641e81a9f0.dev.clokey.store._CNAME]
data.aws_ami.ubuntu_latest: Read complete after 1s [id=ami-0e87051b5808b3155]
module.igw.aws_internet_gateway.this: Refreshing state... [id=igw-0d42973fe78800938]
module.subnet_public_a.aws_subnet.this: Refreshing state... [id=subnet-07166b82e397cee4f]
module.route_table_private.aws_route_table.this: Refreshing state... [id=rtb-0dcf39427dd9230eb]
module.subnet_public_c.aws_subnet.this: Refreshing state... [id=subnet-0d2ffedf584e19b7d]
module.route_table_public.aws_route_table.this: Refreshing state... [id=rtb-0159c824cca7c72af]
module.subnet_private_a.aws_subnet.this: Refreshing state... [id=subnet-04ce95e006ceee275]
module.sg_alb.aws_security_group.this: Refreshing state... [id=sg-03c4902cb0070a409]
module.alb.aws_lb_target_group.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-2:594755789271:targetgroup/dev-clokey-tg/acdb9eb824fd28d1]
module.subnet_private_c.aws_subnet.this: Refreshing state... [id=subnet-03a06747bd201f93c]
module.subnet_public_c.aws_route_table_association.this: Refreshing state... [id=rtbassoc-03f129f95d0b98be3]
module.route_table_public.aws_route.igw[0]: Refreshing state... [id=r-rtb-0159c824cca7c72af1080289494]
module.subnet_public_a.aws_route_table_association.this: Refreshing state... [id=rtbassoc-0dfdf6960a97bd93f]
module.s3.aws_s3_bucket_public_access_block.this[0]: Refreshing state... [id=dev-clokey-storage-bucket]
module.s3.aws_s3_bucket_server_side_encryption_configuration.this[0]: Refreshing state... [id=dev-clokey-storage-bucket]
module.s3.aws_s3_bucket_versioning.this[0]: Refreshing state... [id=dev-clokey-storage-bucket]
module.sg_ec2.aws_security_group.this: Refreshing state... [id=sg-0e3ddb785c09b7bd3]
module.alb.aws_lb.main: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-2:594755789271:loadbalancer/app/dev-clokey-alb/ec4b17bfa9ed77c4]
module.subnet_private_a.aws_route_table_association.this: Refreshing state... [id=rtbassoc-0e31c0af0ad13396e]
module.subnet_private_c.aws_route_table_association.this: Refreshing state... [id=rtbassoc-006e064dc70761fdf]
module.rds.aws_db_subnet_group.this: Refreshing state... [id=dev-clokey-rds]
module.sg_rds.aws_security_group.this: Refreshing state... [id=sg-0bc8567a3bd82199a]
module.ec2.aws_instance.this: Refreshing state... [id=i-016b6771c91fc84c9]
module.rds.aws_db_instance.this: Refreshing state... [id=db-NWBD7HN3KUUHLNNYX5IOSDHIDI]
module.alb.aws_lb_listener.http[0]: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-2:594755789271:listener/app/dev-clokey-alb/ec4b17bfa9ed77c4/eba8266a9e8816e9]
module.route53_record.aws_route53_record.alias[0]: Refreshing state... [id=Z09909261Y36ELN4EONUQ_dev.dev.clokey.store_A]
aws_lb_target_group_attachment.ec2: Refreshing state... [id=arn:aws:elasticloadbalancing:ap-northeast-2:594755789271:targetgroup/dev-clokey-tg/acdb9eb824fd28d1-20251013183202550200000002]
Note: Objects have changed outside of Terraform
Terraform detected the following changes made outside of Terraform since the
last "terraform apply" which may have affected this plan:
# module.ec2.aws_instance.this has changed
~ resource "aws_instance" "this" {
id = "i-016b6771c91fc84c9"
tags = {
"Name" = "dev-clokey-api"
}
# (40 unchanged attributes hidden)
~ root_block_device {
+ tags = {}
# (10 unchanged attributes hidden)
}
# (7 unchanged blocks hidden)
}
Unless you have made equivalent changes to your configuration, or ignored the
relevant attributes using ignore_changes, the following plan may include
actions to undo or respond to these changes.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# module.ec2.aws_instance.this will be updated in-place
~ resource "aws_instance" "this" {
id = "i-016b6771c91fc84c9"
tags = {
"Name" = "dev-clokey-api"
}
~ user_data_replace_on_change = true -> false
# (39 unchanged attributes hidden)
# (8 unchanged blocks hidden)
}
# module.rds.aws_db_parameter_group.main[0] will be updated in-place
~ resource "aws_db_parameter_group" "main" {
id = "dev-clokey-rds-parameter-group"
name = "dev-clokey-rds-parameter-group"
tags = {
"Name" = "dev-clokey-rds-parameter-group"
}
# (6 unchanged attributes hidden)
- parameter {
- apply_method = "pending-reboot" -> null
- name = "innodb_buffer_pool_size" -> null
- value = "{DBInstanceClassMemory*3/4}" -> null
}
+ parameter {
+ apply_method = "immediate"
+ name = "innodb_buffer_pool_size"
+ value = "{DBInstanceClassMemory*3/4}"
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 2 to change, 0 to destroy.
Warning: Value for undeclared variable
The root module does not declare a variable named "vpc_cidr_block" but a
value was found in file "terraform.tfvars". If you meant to use this value,
add a "variable" block to the configuration.
To silence these warnings, use TF_VAR_... environment variables to provide
certain "global" settings to all configurations in your organization. To
reduce the verbosity of these warnings, use the -compact-warnings option.
Warning: Value for undeclared variable
The root module does not declare a variable named "public_subnet_cidr" but a
value was found in file "terraform.tfvars". If you meant to use this value,
add a "variable" block to the configuration.
To silence these warnings, use TF_VAR_... environment variables to provide
certain "global" settings to all configurations in your organization. To
reduce the verbosity of these warnings, use the -compact-warnings option.
Warning: Values for undeclared variables
In addition to the other similar warnings shown, 3 other variable(s) defined
without being declared.
Warning: Deprecated attribute
on ../../modules/storage/s3/output.tf line 33, in output "bucket_website_endpoint":
33: value = aws_s3_bucket.this.website_domain
The attribute "website_domain" is deprecated. Refer to the provider
documentation for details.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π― κ°μ
Clokey νλ‘μ νΈμ AWS μΈνλΌλ₯Ό TerraformμΌλ‘ κ΄λ¦¬νκΈ° μν Infrastructure as Code μ΄κΈ° ꡬμ±μ μΆκ°νμ΅λλ€.
μ£Όμ κ΅¬μ± μμ
S3 λ°±μλ λ²ν·: Terraform μν νμΌ μ μ₯μ
λ²μ κ΄λ¦¬ νμ±ν
AES256 μλ² μ¬μ΄λ μνΈν
κ³΅κ° μ‘μΈμ€ μ°¨λ¨
κ³μ λ³ κ³ μ λ²ν·λͺ (clokey-terraform-state-{account_id})
Network: VPC, μλΈλ·, λΌμ°ν ν μ΄λΈ, Internet Gateway
Compute: EC2 μΈμ€ν΄μ€ ꡬμ±
Database: RDS MySQL μ€μ
Storage: S3 λ²ν· ꡬμ±
Security: 보μ κ·Έλ£Ή λ° NACL
Dev νκ²½: κ°λ°μ© μΈνλΌ κ΅¬μ±
Prod νκ²½: νλ‘λμ μ© μΈνλΌ κ΅¬μ±
κ° νκ²½λ³ λ 립μ μΈ λ³μ κ΄λ¦¬
Dev νκ²½: main λΈλμΉ push μ μλ λ°°ν¬
Prod νκ²½: GitHub Release μμ± μ μλ λ°°ν¬
νκ²½λ³ AWS μΈμ¦ μ 보 λΆλ¦¬ κ΄λ¦¬