I just recently created on my terraform base module a composer environment instance (resource google_composer_environment
) with the following attribute : image_version = "composer-2.0.30-airflow-2.3.3"
.
When you try to upgrade via the console, the cluster is not destroyed (I think?), but when I try to do it via terraform using image_version = "composer-2.0.32-airflow-2.3.4"
the environment will apparently be scrapped and recreated :
# module.dev-omni-orchestrator-instance.google_composer_environment.omni-orchestrator-instance must be replaced
...
Plan: 1 to add, 0 to change, 1 to destroy.
Is there a way to achieve these version upgrade within terraform without destroying the existing environment? Perhaps upgrade via the console or gcloud and then update+import somehow?
I had the same issue previously, to solve it :
Cloud Composer
console
, in this case the cluster will not be destroyedTerraform
codeTerraform
Composer
resource, Terraform
will detect a change in the real infrastructure and will no plan change and nothing to update (because the version from the real infra is the same than in the Terraform resource)I think it's an issue of the resource in the Google provider
but it was not blocking for me with this technique.