Skip to content

Instantly share code, notes, and snippets.

@remm
Created January 17, 2019 08:49
Show Gist options
  • Save remm/57bd5308bf9619d1671186afdaad326c to your computer and use it in GitHub Desktop.
Save remm/57bd5308bf9619d1671186afdaad326c to your computer and use it in GitHub Desktop.
terraform data google_compute_subnetwork attributes
# use existing subnets and call theit attributes
data "google_compute_subnetwork" "k8s-us-west2" {
name = "k8s"
region = "us-west2"
}
ip_allocation_policy = {
cluster_ipv4_cidr_block = "${data.google_compute_subnetwork.k8s-us-west2.secondary_ip_range.0.range_name}",
services_ipv4_cidr_block = "${data.google_compute_subnetwork.k8s-us-west2.secondary_ip_range.1.range_name}",
}
ip_allocation_policy = {
cluster_ipv4_cidr_block = "${data.google_compute_subnetwork.k8s-us-west2.secondary_ip_range.0.ip_cidr_range}",
services_ipv4_cidr_block = "${data.google_compute_subnetwork.k8s-us-west2.secondary_ip_range.1.ip_cidr_range}",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment