AWS/Terraform 23

[AWS Terraform 기초]10. 라우팅 테이블과 서브넷 연결(private)

1. Terraform Docs 예시 https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association Terraform Registry registry.terraform.io 예시: 인수: 2. Terraform 코드 작성 # 09_natrtass.tf resource "aws_route_table_association" "pmh_natrtassa" { subnet_id = aws_subnet.pmh_wasa.id route_table_id = aws_route_table.pmh_natgwrt.id } resource "aws_route_table_association" "pmh_natrta..

AWS/Terraform 2023.07.11

[AWS Terraform 기초]9. NAT Gateway Route Table 생성

1. Terraform Docs 예시 https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table Terraform Registry registry.terraform.io 예시: 인수: 2. Terraform 코드 작성 # 08_natgwrt.tf resource "aws_route_table" "pmh_natgwrt" { vpc_id = aws_vpc.pmh_vpc.id route { cidr_block = "0.0.0.0/0" gateway_id = aws_nat_gateway.pmh_natgw.id } tags = { Name = "pmh-natgwrt" } } resource "aws_route_tab..

AWS/Terraform 2023.07.11

[AWS Terraform 기초]7. 라우팅 테이블과 서브넷 연결(public)

1. Terraform Docs 예시 https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association Terraform Registry registry.terraform.io 예시: 인수: 2. Terraform 코드 작성 # 06_rtass.tf resource "aws_route_table_association" "pmh_rtassa" { subnet_id = aws_subnet.pmh_puba.id route_table_id = aws_route_table.pmh_rt.id } resource "aws_route_table_association" "pmh_rtassc" { subnet_..

AWS/Terraform 2023.07.11

[AWS Terraform 기초]5. Internet Gateway 생성

1. Terraform Docs 예시 https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/internet_gateway Terraform Registry registry.terraform.io 예시: 인수: 2. Terraform 코드 작성 # 04_ig.tf resource "aws_internet_gateway" "pmh_ig" { vpc_id = aws_vpc.pmh_vpc.id tags = { Name = "pmh-ig" } } resource "aws_internet_gateway" "pmh_ig" pmh_ig 라는 이름의 aws_internet_gateway 리소스를 정의 vpc_id 인터넷 게이트웨이가 연결될..

AWS/Terraform 2023.07.11

[AWS Terraform 기초]3. Key Pair 생성

1. AWSCLIV2 설치 https://docs.aws.amazon.com/ko_kr/cli/latest/userguide/getting-started-install.html 최신 버전의 AWS CLI 설치 또는 업데이트 - AWS Command Line Interface 이전 버전에서 업데이트하는 경우 unzip 명령을 실행하면 기존 파일을 덮어쓸지 묻는 메시지가 표시됩니다. 스크립트 자동화와 같은 경우에 이러한 프롬프트를 건너뛰려면 unzip에 대한 -u 업데이 docs.aws.amazon.com 2. AWS 액세스 키 생성 IAM > 보안 자격 증명 > 액세스 키 만들기 Access key ID와 Secret Access key가 있는 csv 파일 저장 3. AWS CLI 자격 증명 aws con..

AWS/Terraform 2023.07.11