Skip to content

Add append/merge mode for single-flow Terraform exports to prevent overwriting existing configuration#120

Description

@homeybeam

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently, when using Terraformer to export a single DaVinci flow from a source environment, the generated Terraform output overwrites existing configuration files (e.g., flow.tf, deploy.tf, connectors.tf). This behavior makes it unsafe to use targeted exports for incremental promotion workflows, as it can unintentionally remove unrelated resources already managed in the Terraform repository and tracked in state.

This request is to introduce an append or merge export mode for single-flow exports, where Terraformer would:

  • Identify existing Terraform resources in the target output directory
  • Append new davinci_flow resources into existing .tf files instead of regenerating them entirely
  • Preserve all existing unrelated resources in those files
  • Only modify or insert blocks related to the exported flow and its direct dependencies
  • Avoid reordering or rewriting unchanged resources unless explicitly required

Expected Outcome

  • Single-flow exports become safe for iterative promotion
  • Existing Terraform state alignment is preserved
  • Reduced need for manual copy/paste or diff reconciliation
  • Improved support for CI/CD-driven DaVinci promotion pipelines
  • Lower risk of accidental resource removal during targeted exports

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions