forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanagedkafka_connect_cluster_basic.tf.tmpl
59 lines (54 loc) · 1.97 KB
/
managedkafka_connect_cluster_basic.tf.tmpl
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
47
48
49
50
51
52
53
54
55
56
57
58
59
resource "google_compute_network" "mkc_network" {
name = "{{index $.Vars "network_id"}}"
auto_create_subnetworks = false
}
resource "google_compute_subnetwork" "mkc_subnet" {
name = "{{index $.Vars "subnetwork_id"}}"
ip_cidr_range = "10.2.0.0/16"
region = "us-central1"
network = google_compute_network.mkc_network.id
}
resource "google_compute_subnetwork" "mkc_additional_subnet" {
name = "{{index $.Vars "additional_subnet_id"}}"
ip_cidr_range = "10.3.0.0/16"
region = "us-central1"
network = google_compute_network.mkc_network.id
}
resource "google_managed_kafka_cluster" "gmk_cluster" {
cluster_id = "{{index $.Vars "cluster_id"}}"
location = "us-central1"
capacity_config {
vcpu_count = 3
memory_bytes = 3221225472
}
gcp_config {
access_config {
network_configs {
subnet = "projects/${data.google_project.project.project_id}/regions/us-central1/subnetworks/${google_compute_subnetwork.mkc_subnet.id}"
}
}
}
}
resource "google_managed_kafka_connect_cluster" "{{$.PrimaryResourceId}}" {
connect_cluster_id = "{{index $.Vars "connect_cluster_id"}}"
kafka_cluster = "projects/${data.google_project.project.project_id}/locations/us-central1/clusters/${google_managed_kafka_cluster.gmk_cluster.cluster_id}"
location = "us-central1"
capacity_config {
vcpu_count = 12
memory_bytes = 21474836480
}
gcp_config {
access_config {
network_configs {
primary_subnet = "projects/${data.google_project.project.project_id}/regions/us-central1/subnetworks/${google_compute_subnetwork.mkc_subnet.id}"
additional_subnets = ["${google_compute_subnetwork.mkc_additional_subnet.id}"]
dns_domain_names = ["${google_managed_kafka_cluster.gmk_cluster.cluster_id}.us-central1.managedkafka-staging.${data.google_project.project.project_id}.cloud-staging.goog"]
}
}
}
labels = {
key = "value"
}
}
data "google_project" "project" {
}