terraform 将 cloud composer 从 1.0 升级到 2.0?

terraform upgrade cloud composer from 1.0 to 2.0?

我尝试使用 terraform 将 composer 从 1.0 升级到 2.0。我收到以下错误。你能帮我解决问题吗?问题出在哪里?

Terraform 已成功初始化! $ terraform apply -input=false $PLAN module.composer.google_composer_environment.composer:正在创建...

│ Warning: Version constraints inside provider configuration blocks are deprecated
│ 
│   on provider.tf line 2, in provider "google":
│    2:     version = "~> 3.22"
│ 
│ Terraform 0.13 and earlier allowed provider version constraints inside the
│ provider configuration block, but that is now deprecated and will be
│ removed in a future version of Terraform. To silence this warning, move the
│ provider version constraint into the required_providers block.
╵
╷
│ Error: googleapi: Error 400: Found 2 problems:
│   1) Error validating property [core]store_dag_code. Overriding [core]store_dag_code is not permitted. 
│   2) Error validating property [core]store_serialized_dags. Overriding [core]store_serialized_dags is not permitted. , badRequest
│ 
│   with module.composer.google_composer_environment.composer,
│   on ../modules/composer/main.tf line 2, in resource "google_composer_environment" "composer":
│    2: resource "google_composer_environment" "composer" {
│ 
╵
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1

Terraform 出错,因为 GCP Cloud Composer 不允许从 Composer 1 升级到 Composer 2。参见 Composer upgrade limitations

You can only upgrade to the latest Cloud Composer version within the same major version, such as composer-1.12.4-airflow-1.10.10 to composer-1.13.0-airflow-1.10.10.

Upgrading from composer-1.4.0-airflow-1.10.0 to composer-2.0.0-airflow-1.10.0 is not permitted because the Cloud Composer major version changes from 1 to 2.

升级的唯一解决方法是创建一个新的 Cloud Composer 2.0 实例。

目前不支持将 Composer 1.x 版本升级到 Composer 2.x。事实上,用户需要从头开始创建 Composer 2.x。

可以使用迁移工具将 DAGs/tasks 的历史从 Composer1/Airflow 1 迁移到 Composer 2/Airflow 2 - 但这是一个手动步骤:https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/composer/tools/composer_db_transfer.md