분류 전체보기 썸네일형 리스트형 [Terraform] 테라폼 인스턴스(public) 생성 테라폼 인스턴스(public) 생성 메인 모듈 $ vim main.tf #####웹 서버 module "webserver" { source = "../../../modules/ec2/instance/" prefix = module.vpc.out_prefix suffix = module.vpc.out_suffix env = module.vpc.out_env region = module.vpc.out_region instance_count = 2 name = "web1" group_name = "web" #aws_amis = "ami-03ca998611da0fe12" instance_type = "t3a.medium" disk_size = "8" key_name = "keypem" subnet_id = mo.. 더보기 [Terraform] 테라폼 리소스 태그 지정(tags) -2 테라폼 리소스 태그 지정(tags) key_pair 편집 - key_pair 모듈 $ vim key_pair.tf ###keypair 생성 resource "aws_key_pair" "this" { count = var.create ? 1 : 0 key_name = var.key_name public_key = var.public_key lifecycle { ignore_changes = [ tags.CreatedDate ] } tags = merge( var.customer_tags, { Name = "${var.suffix}-rds01" } ) } vars.tf 편집 - key_pair 모듈 변수 $ vim vars.tf variable "customer_tags" {} main.tf 편집 - 메인 .. 더보기 [Terraform] 테라폼 리소스 태그 지정(tags) -1 테라폼 리소스 태그 지정(tags) VPC 모듈 vpc.tf 편집 $ vim vpc.tf ###### # locals ###### locals { default_tags = { CreateUser = "terraform" Owner = "sangchul" Project = "blog" Service = "network" } } ###### # VPC ###### resource "aws_vpc" "this" { cidr_block = var.cidr_block enable_dns_hostnames = var.enable_dns_hostnames enable_dns_support = var.enable_dns_support instance_tenancy = var.instance_tenancy lifecy.. 더보기 timedatectl 명령어 timedatectl 명령어 timedatectl 명령어는 시스템의 시간 및 날짜 설정을 관리하는데 사용되는 Linux 시스템 명령어입니다. 이 명령어를 사용하면 시스템 시간, 날짜, 시간대 등을 설정하고 확인할 수 있습니다. 일반적으로 timedatectl 명령어를 사용할 때 아래와 같은 옵션을 사용할 수 있습니다. status: 현재 시간 및 날짜 설정 상태를 보여줍니다. set-time YYYY-MM-DD: 시스템 날짜를 지정한 날짜로 설정합니다. set-time HH:MM:SS: 시스템 시간을 지정한 시간으로 설정합니다. set-timezone TIMEZONE: 시스템 시간대를 설정합니다. 예: Asia/Seoul. list-timezones: 사용 가능한 시간대 목록을 표시합니다. timedat.. 더보기 [mac] macos sed 명령어 에러 macos sed 명령어 에러 sed -i 's/module.vpc/modules.vpc/g' test.tf sed -i 's/module.vpc/modules.vpc/g' test.tf $ sed -i 's/module.vpc/modules.vpc/g' test.tf sed: 1: "test.tf": extra characters at the end of p command 해결 방법 sed -i '' 's/module.vpc/modules.vpc/g' test.tf sed -i '' 's/module.vpc/modules.vpc/g' test.tf 더보기 [VSCode] Visual Studio Code 테마 변경 Visual Studio Code 테마 변경 UI Themes Extension Marketplace 단축키 : cmd + shift + x 더보기 테라폼 vpc peering import(terraform import) 테라폼 vpc peering import(terraform import) vpc peering connection import [버지니아 리전] vpc resources 파일 생성 vim peering.tf #####VPC 페어링 resource "aws_vpc_peering_connection" "vatosg" {} terraform import aws_vpc_peering_connection.vatosg pcx-03c5b $ terraform import aws_vpc_peering_connection.vatosg pcx-03c5b aws_vpc_peering_connection.vatosg: Importing from ID "pcx-03c5b"... aws_vpc_peering_connection... 더보기 [Terraform] 테라폼 output 명령어 테라폼 output 명령어 : terraform 출력 명령은 상태 파일에서 출력 변수의 값을 추출하는데 사용됩니다 VPC 모듈 - output $ vim vpc.tf output "out_prefix" { value = var.prefix } output "out_suffix" { value = var.suffix } output "out_env" { value = var.env } output "out_region" { value = var.aws_region } output "out_aws_vpc_id" { value = aws_vpc.this.id } output "out_aws_vpc_cidr" { value = aws_vpc.this.cidr_block } main 모듈 - output $ vi.. 더보기 이전 1 ··· 180 181 182 183 184 185 186 ··· 298 다음