Pennyway iac Repository

πŸ“Œ Architecture

☁️ Cloud Architecture

image

πŸ—‚οΈ Directory Architecture

pennyway-iac/
β”œβ”€β”€ modules/
β”‚   β”œβ”€β”€ network/
β”‚   β”‚   β”œβ”€β”€ main.tf
β”‚   β”‚   β”œβ”€β”€ variables.tf
β”‚   β”‚   └── outputs.tf
β”‚   └── compute/
β”‚       β”œβ”€β”€ bastion
β”‚       β”‚   β”œβ”€β”€ main.tf
β”‚       β”‚   └── variables.tf
β”‚       └── was
β”‚           β”œβ”€β”€ main.tf
β”‚           └── variables.tf
β”œβ”€β”€ main.tf
β”œβ”€β”€ terraform.tfvars
└── configurations/
    └── provider.tf
  • Modules Directory
    • μž¬μ‚¬μš© κ°€λŠ₯ν•œ Terraform μ½”λ“œ 블둝을 λͺ¨λ“ˆλ‘œ λΆ„λ¦¬ν•˜μ—¬ 관리
    • 각 λͺ¨λ“ˆμ€ νŠΉμ • 인프라 ꡬ성 μš”μ†Œ(예: λ„€νŠΈμ›Œν¬, μ»΄ν“¨νŒ… λ¦¬μ†ŒμŠ€)λ₯Ό μ •μ˜
  • Environments Directory
    • 개발(dev), μŠ€ν…Œμ΄μ§•(staging), ν”„λ‘œλ•μ…˜(production)κ³Ό 같은 λ‹€μ–‘ν•œ ν™˜κ²½μ„ κ΅¬λΆ„ν•˜μ—¬ 관리
    • 각 ν™˜κ²½μ€ 독립적인 ꡬ성을 가지며, ν•„μš”μ— 따라 λ³€μˆ˜κ°’μ„ λ‹¬λ¦¬ν•˜μ—¬ λ¦¬μ†ŒμŠ€λ₯Ό 뢄리함
  • Configurations Directory
    • Terraform μ΄ˆκΈ°ν™” 및 싀행에 ν•„μš”ν•œ μ„€μ • νŒŒμΌμ„ 보관
    • λ°±μ—”λ“œ μ„€μ •, ν”„λ‘œλ°”μ΄λ” μ„€μ • 등을 포함할 수 μžˆμŠ΅λ‹ˆλ‹€.

Setting

terraform.trvars

access_key = ""
secret_key = ""
cidr_block = ""
remote_ip = ""
keypair = ""
  • access_key: AWS κ³„μ •μ˜ μ•‘μ„ΈμŠ€ ν‚€ ID
  • secret_key: AWS κ³„μ •μ˜ μ‹œν¬λ¦Ώ μ•‘μ„ΈμŠ€ ν‚€ ID
  • cidr_block: Private Network ν™˜κ²½μ„ κ΅¬μΆ•ν•˜κΈ° μœ„ν•΄ μ‚¬μš©λ˜λŠ” IP μ£Όμ†Œ λ²”μœ„
  • remote_ip: bastion μ„œλ²„μ— μ ‘μ†ν•˜κΈ° μœ„ν•΄ μ‚¬μš©λ˜λŠ” IP μ£Όμ†Œ
  • keypair: AWS EC2 μΈμŠ€ν„΄μŠ€μ— SSH 접속을 μœ„ν•΄ μ‚¬μš©λ˜λŠ” ν‚€ 쌍