Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to accepts remote changes into state #358

Open
VatslauX opened this issue Nov 13, 2023 · 0 comments
Open

Way to accepts remote changes into state #358

VatslauX opened this issue Nov 13, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@VatslauX
Copy link

VatslauX commented Nov 13, 2023

Is your feature request related to a problem? Please describe.
The problem is that dynatrace has UI)), and 90% of things are better to CREATE and VALIDATE for UI
That means incoming remote changes are just a fact.
The creation of any complex entity for code - it is in 90% is a waste of time.
Since we need validation at first and UI has great help.

Examples: SLO - try to validate bгrn rate in code
Naming rules - try to validate matching in code
Auto tags - try to validate in code
etc. everything that needs adjustment and validation is better to do in UI

Config from code in Dynatrace on CREATION stage it is "fire and forget".

Describe the solution you'd like
During a conversation with the Terraform forum, I realised that there is no unique API to fulfil these needs.
Just because Terraform's ideology is different.

Use case:
WHEN I make changes in the UI
AND pull changes by Terraform
THEN remote configuration should replace the old configuration in the state

Describe alternatives you've considered
How it can be done it existing Terraform api
For provider need to create new command e.g: accept

It will work in next chain of commands:

  1. terraform -export - to pull remote changes
  2. terraform plan -out=tfplan -no-color
  3. detect changes something like with saving resources IDs: terraform show -no-color tfplan | grep -E '^+ |^- |~ '
  4. for each: terraform state rm 'resource_id'
  5. for each: terraform import 'resource_id'
    now we have a state like in SaaS Dynatrace without back push

As alternative:
possible to make direct changes in state file:
Pseudo code:
image

Additional context
A similar problem discussed in the community but ignore changes will not solve the problem of Dynatrace top-down creation approach.
https://itnext.io/how-and-when-to-ignore-lifecycle-changes-in-terraform-ed5bfb46e7ae

Any discusssion or ideas are welkome)

@VatslauX VatslauX added the enhancement New feature or request label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant