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

Provider produces invalid plan when removing dynamic "rule" blocks from autotag_v2 #360

Closed
mattBaumBeneva opened this issue Nov 17, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@mattBaumBeneva
Copy link

Describe the bug
We are currently migrating some of our configurations from an old autotag_v2 to a newer module. The autotag_v2 config generates "rule" blocks dynamically (ex.: dynamic "rule" {...}) and the for_each arguments are based on lists.

The apply step fails with the following error:

12:13:40  │ Error: Given property 'valueNormalization' with value: '' violates the following constraint: Value must be one of [Leave text as-is, To upper case, To lower case].
12:13:40  │ Given property 'type' with value: '' violates the following constraint: Value must be one of [ME, SELECTOR].
12:13:40  │ 
12:13:40  │   with dynatrace_autotag_v2.globale-proprietaire,
12:13:40  │   on TAG_globale-proprietaire.tf line 55, in resource "dynatrace_autotag_v2" "globale-proprietaire":
12:13:40  │   55: resource "dynatrace_autotag_v2" "globale-proprietaire" {

It seems thet the provider is generating an invalid plan for this ressource, which contains the following block:

12:13:14            + rule {
12:13:14              }

This obviously fails, because "valueNormalization" is required, as are other fields.

Expected behavior
It should be possible to remove any number of dynamically created "rule" blocks. It should also be possible to eventually destroy the entire old "autotag_v2" object.

Additional context
Provider version 1.46.1

@mattBaumBeneva mattBaumBeneva added the bug Something isn't working label Nov 17, 2023
@Dynatrace-Reinhard-Pilz
Copy link
Member

Hello @mattBaumBeneva,

The symptoms sound awfully familiar like a bug within the plugin sdk we've already encountered. It happens - although not consistently - with nested schemas that contain unordered lists.

We've been successful with working around that bug in other resources. Unless this is something slightly different, the upcoming release will take care of it.

@Dynatrace-Reinhard-Pilz
Copy link
Member

The changes will be available with the release tomorrow.
Just to be a bit more specific: You WILL still see the blocks like

12:13:14            + rule {
12:13:14              }

within the plan. It's not possible to prevent Terraform from creating them. But the Provider is able to recognize (and therefore ignore) them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants