File tree Expand file tree Collapse file tree 4 files changed +43
-18
lines changed
examples/simple_composer_env_v3 Expand file tree Collapse file tree 4 files changed +43
-18
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,9 @@ This example also creates a Cloud Storage Bucket for scheduled snapshots and ass
1010| Name | Description | Type | Default | Required |
1111| ------| -------------| ------| ---------| :--------:|
1212| composer\_ env\_ name | Name of Cloud Composer Environment. | ` string ` | ` "ci-composer" ` | no |
13- | composer\_ service\_ account | Service Account to be used for running Cloud Composer Environment. | ` string ` | n/a | yes |
14- | network | Network where Cloud Composer is created. | ` string ` | n/a | yes |
13+ | composer\_ sa | Service Account to be used for running Cloud Composer Environment. | ` string ` | n/a | yes |
1514| project\_ id | Project ID where Cloud Composer Environment is created. | ` string ` | n/a | yes |
16- | region | Region where Cloud Composer Environment is created. | ` string ` | n/a | yes |
17- | subnetwork | Name of the Subetwork where Cloud Composer is created. | ` string ` | n/a | yes |
15+ | region | Region where Cloud Composer Environment is created. | ` string ` | ` "us-central1" ` | no |
1816
1917## Outputs
2018
Original file line number Diff line number Diff line change @@ -42,9 +42,9 @@ module "simple-composer-environment" {
4242 project_id = var. project_id
4343 composer_env_name = var. composer_env_name
4444 region = var. region
45- composer_service_account = var. composer_service_account
46- network = var . network
47- subnetwork = var . subnetwork
45+ composer_service_account = var. composer_sa
46+ network = google_compute_network . main . id
47+ subnetwork = google_compute_subnetwork . main . id
4848 create_network_attachment = true
4949
5050 grant_sa_agent_permission = false
Original file line number Diff line number Diff line change 1+ /* *
2+ * Copyright 2022 Google LLC
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ resource "google_compute_network" "main" {
18+ project = var. project_id
19+ name = " ci-composer-test-${ random_string . suffix . result } "
20+ auto_create_subnetworks = false
21+ }
22+
23+ resource "google_compute_subnetwork" "main" {
24+ project = var. project_id
25+ name = " ci-composer-test-${ random_string . suffix . result } "
26+ ip_cidr_range = " 10.0.0.0/17"
27+ region = var. region
28+ network = google_compute_network. main . self_link
29+ private_ip_google_access = true
30+ }
31+
32+ resource "random_string" "suffix" {
33+ length = 4
34+ special = false
35+ upper = false
36+ }
Original file line number Diff line number Diff line change @@ -28,19 +28,10 @@ variable "composer_env_name" {
2828variable "region" {
2929 description = " Region where Cloud Composer Environment is created."
3030 type = string
31+ default = " us-central1"
3132}
3233
33- variable "composer_service_account " {
34+ variable "composer_sa " {
3435 description = " Service Account to be used for running Cloud Composer Environment."
3536 type = string
3637}
37-
38- variable "network" {
39- description = " Network where Cloud Composer is created."
40- type = string
41- }
42-
43- variable "subnetwork" {
44- description = " Name of the Subetwork where Cloud Composer is created."
45- type = string
46- }
You can’t perform that action at this time.
0 commit comments