반응형
VPC 생성
vpc.tf 파일 생성
$ vim vpc.tf
###VPC 생성
resource "aws_vpc" "sangchul_vpc11" {
cidr_block = "10.11.0.0/16"
enable_dns_support = true
enable_dns_hostnames = true
instance_tenancy = "default"
tags = {
Name = "sangchul_vpc11"
Env = "stg"
CreateUser = "terraform@email.com"
Owner = "iac"
Role = "vpc"
Service = "network"
}
}
terraform apply 명령 실행
$ terraform apply
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
...
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
aws_vpc.sangchul_vpc11: Creating...
aws_vpc.sangchul_vpc11: Still creating... [10s elapsed]
aws_vpc.sangchul_vpc11: Creation complete after 12s [id=vpc]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
** VPN 생성 시 기본 Route Tables, Network ACLs, Security Groups도 같이 생성됩니다.
728x90
반응형
'퍼블릭 클라우드' 카테고리의 다른 글
[Terraform] 테라폼 인터넷 게이트웨이 생성 (0) | 2021.01.29 |
---|---|
[Terraform] 테라폼 서브넷 생성 (0) | 2021.01.29 |
[Terraform] 테라폼 provider 생성 (0) | 2021.01.29 |
[Terraform] 테라폼 프로바이더(Provider) 및 VPC 생성 (0) | 2021.01.28 |
CentOS 7에서 Terraform을 설치하는 방법 (0) | 2021.01.26 |