안녕하세요! 하씨가문의 영광입니다!
이번에는 firewall와 image에 대해서 다뤄보도록 하겠습니다:)
![](https://t1.daumcdn.net/keditor/emoticon/niniz/large/002.gif)
▶ 목차
1. google_compute_firewall
resource "google_compute_firewall" "default" {
name = "test-firewall"
network = google_compute_network.default.name
allow {
protocol = "icmp"
}
allow {
protocol = "tcp"
ports = ["80", "8080", "1000-2000"]
}
source_tags = ["web"]
}
필수 | 설명 | 옵션 | 설명 |
name | 리소스의 이름입니다. | allow | 이 방화벽에서 지정한 허용 규칙 목록입니다. |
network | 방화벽을 연결할 네트워크의 이름 또는 self_link입니다. | deny | 방화벽에서 지정한 거부 규칙 목록입니다. |
description | 리소스의 설명을 입력하는 곳입니다. |
![](https://t1.daumcdn.net/keditor/emoticon/niniz/large/015.gif)
2. google_compute_image
resource "google_compute_image" "example" {
name = "example-image"
raw_disk {
source = "https://storage.googleapis.com/bosh-gce-raw-stemcells/bosh-stemcell-97.98-google-kvm-ubuntu-xenial-go_agent-raw-1557960142.tar.gz"
}
}
필수 | 설명 | 옵션 | 설명 |
name | 이미지의 이름입니다. | description | 리소스를 설명을 입력하는 곳입니다. |
disk_size_gb | 영구 디스크에 복원될 때 이미지의 크기(GB) | ||
labels | 이미지에 적용할 레이블입니다. |
![](https://t1.daumcdn.net/keditor/emoticon/niniz/large/042.gif)
이렇게 Terraform 기반 GCP를 다뤄보았는데요!
방화벽과 이미지는 자주 사용되니 참고하시면 좋을 거 같아요!
오늘도 읽어주셔서 감사합니다:)
'INFRA > Operation' 카테고리의 다른 글
terraform import 알아보기 #2 (0) | 2022.12.01 |
---|---|
terraform import 알아보기 #1 (0) | 2022.11.30 |
Terraform 리소스의 개념 이해 - GCP 4편 (0) | 2022.11.29 |
Terraform 리소스의 개념 이해 - GCP 3편 (0) | 2022.11.10 |
terraform data 구문 (0) | 2022.11.09 |
댓글