Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fixes for airflow_pools submodule and update dependencies#179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
VincentGoeckeritz wants to merge5 commits intoterraform-google-modules:main
base:main
Choose a base branch
Loading
fromVincentGoeckeritz:main
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletionsmodules/airflow_pool/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,15 +6,20 @@ This optional module is used to create a Cloud Composer Pool.
module "pool" {
source = "terraform-google-modules/composer/google//modules/airflow_pool"

project_id = "project-123"
environment = "Composer-Prod-Env"
location = "us-central1"
name = "beta"
slots = 1000
description = "Pool used by beta DAGs"
project = "project-123"
environment= "Composer-Prod-Env"
location= "us-central1"
composer_env_name = "beta"
slot_count = 1000
description= "Pool used by beta DAGs"
}
```

> [!IMPORTANT]
> to delete a pool you first need to run
> ``` terraform destroy --target module.however_you_named_it ```
> if you just remove the module configuration from your code the pool will not be deleted.

```
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand All@@ -24,9 +29,10 @@ module "pool" {
| composer\_env\_name | Name of the Cloud Composer Environment. | `string` | n/a | yes |
| description | The description of the pool | `string` | `"Managed by Terraform"` | no |
| pool\_name | The name of the pool | `string` | n/a | yes |
| project\_id | ProjectID where Cloud Composer Environment is created. | `string` | n/a | yes |
| project | Projectname where Cloud Composer Environment is created. | `string` | n/a | yes |
| region | Region where the Cloud Composer Environment is created. | `string` | n/a | yes |
| slot\_count | The number of slots in this pool | `number` | n/a | yes |
| include_deferred | Whether the pool should include deferred tasks in its calculation of occupied slots | `bool` | false | no |

## Outputs

Expand Down
9 changes: 5 additions & 4 deletionsmodules/airflow_pool/main.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,14 +15,15 @@
*/

locals {
gcloud_cmd_body = "composer environments run --project=${var.project_id} --location=${var.region} ${var.composer_env_name} pool"
create_cmd_body = "${local.gcloud_cmd_body} -- --set ${jsonencode(var.pool_name)} ${jsonencode(var.slot_count)} ${jsonencode(var.description)}"
destroy_cmd_body = "${local.gcloud_cmd_body} -- --delete ${jsonencode(var.pool_name)}"
include_deferred_flag = var.include_deferred ? " --include-deferred" : ""
gcloud_cmd_body = "composer environments run --project=${var.project} --location=${var.region} ${var.composer_env_name} pools"
create_cmd_body = "${local.gcloud_cmd_body} -- set ${jsonencode(var.pool_name)} ${jsonencode(var.slot_count)} ${jsonencode(var.description)} ${local.include_deferred_flag}"
destroy_cmd_body = "${local.gcloud_cmd_body} -- delete ${jsonencode(var.pool_name)}"
}

module "gcloud" {
source = "terraform-google-modules/gcloud/google"
version = "~>3.1"
version = "~>4.0"
platform = "linux"
create_cmd_body = local.create_cmd_body
destroy_cmd_body = local.destroy_cmd_body
Expand Down
10 changes: 8 additions & 2 deletionsmodules/airflow_pool/variables.tf
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,9 +14,9 @@
* limitations under the License.
*/

variable "project_id" {
variable "project" {
type = string
description = "ProjectID where Cloud Composer Environment is created."
description = "Projectname where Cloud Composer Environment is created."
}

variable "region" {
Expand All@@ -39,6 +39,12 @@ variable "slot_count" {
description = "The number of slots in this pool"
}

variable "include_deferred" {
type = bool
default = false
description = "Whether the pool should include deferred tasks in its calculation of occupied slots"
}

variable "description" {
type = string
description = "The description of the pool"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp