Open rnelson0 opened 2 years ago
I put the tf/provider version definition from the versions.tf file, once I validate the specific versions with the user who was experiencing this issue, I will update it.
I went through the provider code and I don't know either terraform or go well enough to fully pinpoint the issue, but I'm trying to learn both and if someone can help me pinpoint where this change is (if it's even in provider at all), I'm happy to start looking into a fix. Conceptually it seems like it's an issue with normalization so a well known class of problem to resolve.
Updated the versions now that I've got them.
I don't think it's an ordering issue, per se - flip the input order (below) and it doesn't show up. Somehow it's not normalizing the values between jsonencode and a flat string which gives the same result.
resource "vra_deployment" "vaultenterprise_bed_fuzzy" {
for_each = toset([
# sanitized list
])
name = each.key
description = "Vault Enterprise server created by Terraform"
catalog_item_id = data.vra_catalog_item.catalog_item.id
catalog_item_version = var.vra_catalog_item_version
project_id = data.vra_project.project.id
inputs = {
tags = jsonencode(
[
{
key = "Backup"
value = "CloudEng_Daily"
},
]
)
datacenter = "Bedford"
hostname = each.key
numCpu = 4
numMem = 16
OSversion = "OL8 Development"
puppetBranch = "nop4dev"
puppetRole = "vault_server"
vlanId = 30
}
timeouts {
create = "30m"
delete = "30m"
update = "30m"
}
lifecycle {
ignore_changes = [
catalog_item_version,
]
}
}
> terraform plan
...
No changes. Your infrastructure matches the configuration.
Code of Conduct
This project has a Code of Conduct that all participants are expected to understand and follow:
vRA Version
8.6.2
Terraform Version
Terraform v1.2.5 on darwin_amd64
vRA Terraform Provider Version
Affected Resource(s)
vra_deployment
I suspect others are affected due to the underlying issue, but this is the only verified resource
Terraform Configuration Files
Slightly sanitized, the inputs->tags is the relevant portion anyway
Expected Behavior
When there are no changes, terraform plan should show no changes
Actual Behavior
On every
terraform plan
, thetags
entries are marked for change. No effective change is made during aterraform apply
(an Update event happens on the deployment but no actual change) but the nextterraform plan
shows the same marked changeSteps to Reproduce
terraform plan
orterraform apply
Screenshots
Debug Output
Plan output:
The relevant portion of the state file says:
You can see that the tags are marked in different ways:
Changing the definition in the .tf file to use
jsonencode
for the tags eliminated the marked changes on every run.Community Note