-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
46 lines (40 loc) · 1.14 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
terraform {
required_providers {
google = {
source = "hashicorp/google"
version = "~> 4.14.0"
}
}
}
provider "google" {
credentials = file("example.json")
project = "example-project"
region = "us-central1"
zone = "us-central1-c"
}
resource "google_compute_network" "vpc_network" {
name = "terraform-network"
}
resource "gcp_network" "default" {
auto_create_subnetworks = "false"
delete_default_routes_on_create = "false"
description = "Default network for the project"
mtu = "0"
name = "default"
project = "example-project"
routing_mode = "REGIONAL"
}
resource "gcp_firewall" "default-allow-ssh" {
allow {
ports = ["22"]
protocol = "tcp"
}
direction = "INGRESS"
disabled = "false"
name = "default-allow-ssh"
network = "${data.terraform_remote_state.local.outputs.google_compute_network_default_self_link}"
priority = "1000"
project = "example-project"
source_ranges = ["0.0.0.0/0"]
target_tags = ["ssh-server"]
}