Skip to content

Commit 93088b4

Browse files
author
Florencia Comuzzi
committed
create subnet
1 parent 5ade37e commit 93088b4

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

SETUP.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Deployments are triggered from GitHub Actions workflows.
1111
* Create a service account JSON file.
1212
* Add as a repository secret by going to Settings > Secrets and variables > Actions. Name it GCP_CREDENTIALS and paste in the credentials JSON.
1313
* Create the buckets for Terraform state like `prod-tf-state-bucket`. The bucket names are specified in the `backend/{env}.tfvars` file.
14-
* Go to the bucket > Permissions > Add Member > Service Account > k8s-environment-terraform-cicd@florenciacomuzzi.iam.gserviceaccount.com > Role > Storage Object Admin.
14+
* Go to the bucket > Permissions > Add Member > Service Account > k8s-environment-terraform-cicd@florenciacomuzzi.iam.gserviceaccount.com > Role >
15+
* Storage Object Admin
16+
* Compute Network Admin
1517
* Enable the Compute Engine API if it is not enabled. You will need [Owner](https://cloud.google.com/service-usage/docs/access-control#basic_roles) access to the project.
1618

1719
### GitHub

main.tf

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
resource "google_compute_network" "vpc_network" {
2-
name = var.vpc_name
2+
name = var.vpc_name
3+
auto_create_subnetworks = false
4+
enable_ula_internal_ipv6 = true
5+
}
6+
7+
resource "google_compute_subnetwork" "default" {
8+
name = "example-subnetwork"
9+
10+
ip_cidr_range = "10.0.0.0/16"
11+
region = var.region
12+
13+
stack_type = "IPV4_IPV6"
14+
ipv6_access_type = "INTERNAL" # Change to "EXTERNAL" if creating an external loadbalancer
15+
16+
network = google_compute_network.vpc_network.id
17+
secondary_ip_range {
18+
range_name = "services-range"
19+
ip_cidr_range = "192.168.0.0/24"
20+
}
21+
22+
secondary_ip_range {
23+
range_name = "pod-ranges"
24+
ip_cidr_range = "192.168.1.0/24"
25+
}
326
}

0 commit comments

Comments
 (0)