Skip to content

Commit dde0c40

Browse files
committed
chore: added test fixtures
1 parent 682cb64 commit dde0c40

File tree

4 files changed

+158
-0
lines changed

4 files changed

+158
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright 2025 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+
module "simple-composer" {
18+
source = "../../../examples/simple_composer_env_v3"
19+
20+
project_id = var.project_id
21+
composer_env_name = "composer-env-${random_id.random_suffix.hex}"
22+
region = var.region
23+
composer_service_account = var.composer_sa
24+
network = google_compute_network.main.name
25+
subnetwork = google_compute_subnetwork.main.name
26+
create_network_attachment = true
27+
}
28+
29+
resource "random_id" "random_suffix" {
30+
byte_length = 2
31+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright 2025 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+
secondary_ip_range {
32+
range_name = "ci-composer-test-pods-${random_string.suffix.result}"
33+
ip_cidr_range = "192.168.0.0/18"
34+
}
35+
36+
secondary_ip_range {
37+
range_name = "ci-composer-test-services-${random_string.suffix.result}"
38+
ip_cidr_range = "192.168.64.0/18"
39+
}
40+
}
41+
42+
resource "random_string" "suffix" {
43+
length = 4
44+
special = false
45+
upper = false
46+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/**
2+
* Copyright 2025 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+
output "project_id" {
18+
description = "Project ID where Cloud Composer Environment is created."
19+
value = var.project_id
20+
}
21+
22+
output "composer_env_name" {
23+
description = "Name of the Cloud Composer Environment."
24+
value = module.simple-composer.composer_env_name
25+
}
26+
27+
output "network" {
28+
description = "The Cloud Composer Network."
29+
value = google_compute_network.main.name
30+
}
31+
32+
output "subnetwork" {
33+
description = "The Cloud Composer Subnetwork."
34+
value = google_compute_subnetwork.main.name
35+
}
36+
37+
output "composer_env_id" {
38+
description = "ID of Cloud Composer Environment."
39+
value = module.simple-composer.composer_env_id
40+
}
41+
42+
output "gcs_bucket" {
43+
description = "Google Cloud Storage bucket which hosts DAGs for the Cloud Composer Environment."
44+
value = module.simple-composer.gcs_bucket
45+
}
46+
47+
output "airflow_uri" {
48+
description = "URI of the Apache Airflow Web UI hosted within the Cloud Composer Environment."
49+
value = module.simple-composer.airflow_uri
50+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* Copyright 2025 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+
variable "project_id" {
18+
description = "Project ID where Cloud Composer Environment is created."
19+
type = string
20+
}
21+
22+
variable "composer_sa" {
23+
description = "Service Account to be used for running Cloud Composer Environment."
24+
type = string
25+
}
26+
27+
variable "region" {
28+
description = "Region where Cloud Composer Environment is created."
29+
type = string
30+
default = "us-central1"
31+
}

0 commit comments

Comments
 (0)