cf-ops-automation
cf-ops-automation copied to clipboard
Support terraform-provider-cf
Add support for migrating to https://github.com/mevansam/terraform-provider-cf
This is a follow up of #23
@o-orand terraform-provider-cf version 0.9.8 was just released with import support. This sholuld help us kick off the migration. Can you please include the provider in the docker image used by COA ?
Summary of related design session on Sep 12th:
- a big bang to switch from orange TF provider CF to mevansam provider CF is risky and hard as: *this requires to synchronize coa, paas-templates (TF specs updates + TF state migration scripts in all root deployments) and paas-secrets TF (TF specs overrides)
- a gradual iterative approach is preferrable
- coexistence of orange TF provider CF and mevansam provider CF in the same TF state is an expensive step, as it requires
- tf provider renaming
- tf specs resource renaming and update of cross references
- tf state tweaks, see https://github.com/mevansam/terraform-provider-cf/pull/85#issuecomment-395998798
- a progressive switch root deployment by root deployment seems preferable, with steps such as:
- cloudflare-deps
- coab-deps: migrate existing resources (brokers) + experiment deploy new resources (cf_app)
- master-deps: migrate existing resources (spaces, orgs, brokers, service plan visibility ...)
- coexistence of orange TF provider CF and mevansam provider CF in the same TF state is an expensive step, as it requires
Two approaches were considered for the "progressive switch root deployment by root deployment":
- invest and prioritize into docker image override per root deployment #189
- add transient specific coa support to switch between TF cloudfoundry providers (
mevansam/
vsorange-cloudfoundry/
per root deployment- include binaries for both providers in the docker image, with a default one being active
- tweak coa tf task to select which provider to load at runtime depending on new environment variables: CURRENT_DEPL and USE_ORANGE_TF_PROVIDER_ON_DEPLS
- introduce new global concourse pipeline variable that can be progressively turned on in paas-secrets ("USE_ORANGE_TF_PROVIDER_ON_DEPLS=coab-depls master-depls micro-depls ops-depls kubo-deps"
- potentially each release would provide scripts to edit this variable as new root deployments switch to the new provider
the USE_ORANGE_TF_PROVIDER_ON_DEPLS
flag should be set as part of paas-template and not paas-secret
On hold => spike in progress to use a dedicated terraform boshrelease