forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudrunv2_job_vpcaccess.tf.erb
38 lines (36 loc) · 1.1 KB
/
cloudrunv2_job_vpcaccess.tf.erb
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
resource "google_cloud_run_v2_job" "<%= ctx[:primary_resource_id] %>" {
name = "<%= ctx[:vars]['cloud_run_job_name'] %>"
location = "us-central1"
deletion_protection = false
template {
template{
containers {
image = "us-docker.pkg.dev/cloudrun/container/job"
}
vpc_access{
connector = google_vpc_access_connector.connector.id
egress = "ALL_TRAFFIC"
}
}
}
}
resource "google_vpc_access_connector" "connector" {
name = "<%= ctx[:vars]['vpc_access_connector_name'] %>"
subnet {
name = google_compute_subnetwork.custom_test.name
}
machine_type = "e2-standard-4"
min_instances = 2
max_instances = 3
region = "us-central1"
}
resource "google_compute_subnetwork" "custom_test" {
name = "<%= ctx[:vars]['vpc_compute_subnetwork_name'] %>"
ip_cidr_range = "10.2.0.0/28"
region = "us-central1"
network = google_compute_network.custom_test.id
}
resource "google_compute_network" "custom_test" {
name = "<%= ctx[:vars]['compute_network_name'] %>"
auto_create_subnetworks = false
}