-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: separate packages by Airflow version * feature: new cloud composer (v2) version * feature: license * feature: add roles/composer.ServiceAgentV2Ext to composer api agent * fix: rename simple composer env dir * fix: cloud build kitchen-tf test integration * fix: cloud build kitchen-tf test integration * fix: cloud build kitchen-tf test integration * refactor: license year + docs * fix: lint * fix: master_authorized_networks_config flag * update
- Loading branch information
1 parent
13813fc
commit 959db7d
Showing
40 changed files
with
1,085 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/simple_composer_env/README.md → examples/simple_composer_env_v1/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Simple Cloud Composer Environment (V2) Example | ||
|
||
This example illustrates how to use the `composer` module. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| composer\_env\_name | Name of Cloud Composer Environment. | `string` | `"ci-composer"` | no | | ||
| composer\_service\_account | Service Account to be used for running Cloud Composer Environment. | `string` | n/a | yes | | ||
| network | Network where Cloud Composer is created. | `string` | n/a | yes | | ||
| pod\_ip\_allocation\_range\_name | The name of the cluster's secondary range used to allocate IP addresses to pods. | `string` | n/a | yes | | ||
| project\_id | Project ID where Cloud Composer Environment is created. | `string` | n/a | yes | | ||
| region | Region where Cloud Composer Environment is created. | `string` | n/a | yes | | ||
| service\_ip\_allocation\_range\_name | The name of the services' secondary range used to allocate IP addresses to the cluster. | `string` | n/a | yes | | ||
| subnetwork | Subetwork where Cloud Composer is created. | `string` | n/a | yes | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| airflow\_uri | URI of the Apache Airflow Web UI hosted within the Cloud Composer Environment. | | ||
| composer\_env\_id | ID of Cloud Composer Environment. | | ||
| composer\_env\_name | Name of the Cloud Composer Environment. | | ||
| gcs\_bucket | Google Cloud Storage bucket which hosts DAGs for the Cloud Composer Environment. | | ||
| gke\_cluster | Google Kubernetes Engine cluster used to run the Cloud Composer Environment. | | ||
|
||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
|
||
To provision this example, run the following from within this directory: | ||
- `terraform init` to get the plugins | ||
- `terraform plan` to see the infrastructure plan | ||
- `terraform apply` to apply the infrastructure build | ||
- `terraform destroy` to destroy the built infrastructure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
module "simple-composer-environment" { | ||
source = "../../modules/create_environment_v2" | ||
project_id = var.project_id | ||
composer_env_name = var.composer_env_name | ||
region = var.region | ||
composer_service_account = var.composer_service_account | ||
network = var.network | ||
subnetwork = var.subnetwork | ||
pod_ip_allocation_range_name = var.pod_ip_allocation_range_name | ||
service_ip_allocation_range_name = var.service_ip_allocation_range_name | ||
grant_sa_agent_permission = false | ||
environment_size = "ENVIRONMENT_SIZE_SMALL" | ||
scheduler = { | ||
cpu = 0.5 | ||
memory_gb = 1.875 | ||
storage_gb = 1 | ||
count = 1 | ||
} | ||
web_server = { | ||
cpu = 0.5 | ||
memory_gb = 1.875 | ||
storage_gb = 1 | ||
} | ||
worker = { | ||
cpu = 0.5 | ||
memory_gb = 1.875 | ||
storage_gb = 1 | ||
min_count = 1 | ||
max_count = 3 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
output "composer_env_name" { | ||
description = "Name of the Cloud Composer Environment." | ||
value = module.simple-composer-environment.composer_env_name | ||
} | ||
|
||
output "composer_env_id" { | ||
description = "ID of Cloud Composer Environment." | ||
value = module.simple-composer-environment.composer_env_id | ||
} | ||
|
||
output "gke_cluster" { | ||
description = "Google Kubernetes Engine cluster used to run the Cloud Composer Environment." | ||
value = module.simple-composer-environment.gke_cluster | ||
} | ||
|
||
output "gcs_bucket" { | ||
description = "Google Cloud Storage bucket which hosts DAGs for the Cloud Composer Environment." | ||
value = module.simple-composer-environment.gcs_bucket | ||
} | ||
|
||
output "airflow_uri" { | ||
description = "URI of the Apache Airflow Web UI hosted within the Cloud Composer Environment." | ||
value = module.simple-composer-environment.airflow_uri | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
variable "project_id" { | ||
description = "Project ID where Cloud Composer Environment is created." | ||
type = string | ||
} | ||
|
||
variable "composer_env_name" { | ||
description = "Name of Cloud Composer Environment." | ||
default = "ci-composer" | ||
type = string | ||
} | ||
|
||
variable "region" { | ||
description = "Region where Cloud Composer Environment is created." | ||
type = string | ||
} | ||
|
||
variable "composer_service_account" { | ||
description = "Service Account to be used for running Cloud Composer Environment." | ||
type = string | ||
} | ||
|
||
variable "network" { | ||
description = "Network where Cloud Composer is created." | ||
type = string | ||
} | ||
|
||
variable "subnetwork" { | ||
description = "Subetwork where Cloud Composer is created." | ||
type = string | ||
} | ||
|
||
variable "pod_ip_allocation_range_name" { | ||
description = "The name of the cluster's secondary range used to allocate IP addresses to pods." | ||
type = string | ||
} | ||
|
||
variable "service_ip_allocation_range_name" { | ||
type = string | ||
description = "The name of the services' secondary range used to allocate IP addresses to the cluster." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
terraform { | ||
required_version = ">= 0.13" | ||
required_providers { | ||
google = { | ||
source = "hashicorp/google" | ||
version = "~> 4.8.0" | ||
} | ||
google-beta = { | ||
source = "hashicorp/google-beta" | ||
version = "~> 4.8.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
modules/create_environment/README.md → modules/create_environment_v1/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.