DevOps R&D Center
  • Home
    • DevOps R&D Center
  • EKS
    • Networking
      • IRSA
      • EKS API server endpoint policy
        • aws cli command
  • LOKI
    • grafana alert
    • LogQL
  • ISTIO
    • references
    • Istio 학습
  • GITLAB
    • ssh key 등록 ( n개의 계정 )
  • AWS
    • aws eks cluster kube config 등록
    • aws account protection
    • aws configure
      • configure profile 설정
  • R&D Center
    • ISTIO
      • ISTIO Documentation
        • Overview
          • What is Istio
          • Why choose Istio?
          • Sidecar or ambient?
        • Concepts
          • Traffic Management
      • 메모장
      • dev cluster ( public subnet ) traffic 조회
      • Istio Tutorial
      • 카카오페이 사례
      • 트래블 월렛 EKS 전환 여정
    • EKS
      • eks provisioning
        • alb controller, istio
        • EFS
        • loki
        • cattle-monitoring-system
        • Gitlab Kubernetes Agent 적용
        • 프로젝트 배포
        • IRSA 설정
      • Secrets Store CSI Driver
      • AWS 보안 서비스를 이용하여 안전한 컨테이너 운영환경 만들기
    • AWS
      • AWS Secrets Manager
    • Network
      • 혼자서 공부하는 네트워크
      • AWS ENI
    • IAC
      • Terraform
        • 첫번째 교육 아카이브
  • SRE
    • 장애 대응 메뉴얼
  • DevOps
    • DevOps란
Powered by GitBook
On this page

Was this helpful?

  1. R&D Center
  2. IAC
  3. Terraform

첫번째 교육 아카이브

terraform {
  required_version = ">=1.9.1"
  required_providers {
      aws = {
        source  = "hashicorp/aws"
        version = ">= 5.57.0"
    }
  } 
}

provider "aws" {}

variable "ecr_repository" {
  type = list(string)
  default = ["foo", "bar", "baz"]
}

resource "aws_ecr_repository" "ecr_repository" {
  for_each = toset(var.ecr_repository)

  name                 = each.key

  image_tag_mutability = "MUTABLE"

  encryption_configuration {
    encryption_type = "KMS"
  }

  image_scanning_configuration {
    scan_on_push = true
  }
}

terraform {
  required_version = ">=1.9.1"
  required_providers {
      aws = {
        source  = "hashicorp/aws"
        version = ">= 5.57.0"
    }
  } 
}

provider "aws" {}

resource "aws_vpc" "main" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_security_group" "allow_tls" {
  name        = "allow_tls"
  description = "Allow TLS inbound traffic and all outbound traffic"
  vpc_id      = aws_vpc.main.id

  tags = {
    Name = "allow_tls"
  }
}

output "vpc_id" {
  value = aws_vpc.main.id
}

PreviousTerraformNext장애 대응 메뉴얼

Last updated 10 months ago

Was this helpful?