1등팀 예

https://www.notion.so/Infra-249288ce408c80f4b2c9f15639537422?p=249288ce408c814ba89ae540677727ab&pm=s

디렉터리 구조

root.tf
variables.tf
module/
	vpc/
		main.tf
		variables.tf
		output.tf
	sg/
		main.tf
		variables.tf
		output.tf
	ec2/
		main.tf
		variables.tf
		output.tf
	eks/
		main.tf
		variables.tf
		output.tf

Terraform으로 VPC 구성

https://bosungtea9416.tistory.com/entry/AWS-Terraform으로-간단한-VPC-구성하기

Docker run ide

name: "aws-cicd-practice"d
services:
  code-server:
    image: dangtong76/cicd-devops-ide:amd64-v2
    container_name: "ide"
    networks: # 네트워크 항목 주석제거
      - kind_network
    environment:
      AUTH: none
      #FILE__PASSWORD: /run/secrets/code-server-password
    env_file:
      - .env
    working_dir: /code
    ports:
      - "8080:8080" # istory-web
      - "1314:1314" # hugo port 1
      - "1315:1315" # hugo port 2
      - "8444:8443" # vscode service port
      - "5500:5500"
    # secrets:s
    #   - code-server-password
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - devops-cicd-apps:/code/devops-cicd-apps
      - devops-cicd-vscode:/config
networks: # 네트워크 항목 주석제거
  kind_network:
    name: kind
    external: true
volumes:
  devops-cicd-apps:
    external: true
    name: devops-cicd-apps
  devops-cicd-vscode:
    external: true
    name: devops-cicd-vscode

Eksctl

https://wrynn.tistory.com/62

https://eksctl.io/usage/creating-and-managing-clusters/#

Terraform Doc

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_peering_connection

⇒ VPC Peering

resource "aws_vpc_peering_connection" "foo" {
  peer_owner_id = var.peer_owner_id    # (선택) 상대 계정 ID. 같은 계정이면 생략 가능
  peer_vpc_id   = aws_vpc.bar.id       # 피어링 대상 VPC (us-east-1)
  vpc_id        = aws_vpc.foo.id       # 요청자 VPC (us-west-2)
  peer_region   = "ap-northeast-2"          # 리전이 다르므로 꼭 지정
}

resource "aws_vpc" "foo" {
  provider   = aws.ap-northeast-2
  cidr_block = "10.1.0.0/16"
}

resource "aws_vpc" "bar" {
  provider   = aws.ap-northeast-2
  cidr_block = "10.2.0.0/16"
}

DR Architecture