-
Notifications
You must be signed in to change notification settings - Fork 43
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
required resource update due to changes in nested attributes that have not been modified #1951
Comments
Hi @ocobles, thanks for reporting and for the detailed repro. Sorry you had issues here! This is a big difference between pulumi and terraform - tf runs refresh by default. |
Thanks @VenelinMartinov, I tried your suggestion and it does not detect changes in terraform
|
Hey @ocobles, I tried to compare the tf and pulumi behaviour here with some assumptions. So far they seem to match and both seem to trigger an update. I don't have access to the equinix platform, so I've attempted to recreate the relevant schema in a test which compares TF and pulumi: #1975 Given the output I am assuming that if the equinix API receives a metroCode it returns no metroCode back but returns a metroName instead. From the test it looks like TF also triggers an update under these conditions. I'm including the terraform plan here: {
"format_version": "1.2",
"terraform_version": "1.8.2",
"planned_values": {
"root_module": {
"resources": [
{
"address": "crossprovider_testres.example",
"mode": "managed",
"type": "crossprovider_testres",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/crossprovider",
"schema_version": 0,
"values": {
"id": "r1",
"location": [
{
"metro_code": "FRA"
}
]
},
"sensitive_values": {
"location": [
{}
]
}
}
]
}
},
"resource_changes": [
{
"address": "crossprovider_testres.example",
"mode": "managed",
"type": "crossprovider_testres",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/crossprovider",
"change": {
"actions": [
"update"
],
"before": {
"id": "r1",
"location": [
{
"metro_code": "",
"metro_name": "Frankfurt"
}
]
},
"after": {
"id": "r1",
"location": [
{
"metro_code": "FRA"
}
]
},
"after_unknown": {
"location": [
{
"metro_name": true
}
]
},
"before_sensitive": {
"location": [
{}
]
},
"after_sensitive": {
"location": [
{}
]
}
}
}
],
"prior_state": {
"format_version": "1.0",
"terraform_version": "1.8.2",
"values": {
"root_module": {
"resources": [
{
"address": "crossprovider_testres.example",
"mode": "managed",
"type": "crossprovider_testres",
"name": "example",
"provider_name": "registry.terraform.io/hashicorp/crossprovider",
"schema_version": 0,
"values": {
"id": "r1",
"location": [
{
"metro_code": "",
"metro_name": "Frankfurt"
}
]
},
"sensitive_values": {
"location": [
{}
]
}
}
]
}
}
},
"configuration": {
"provider_config": {
"crossprovider": {
"name": "crossprovider",
"full_name": "registry.terraform.io/hashicorp/crossprovider"
}
},
"root_module": {
"resources": [
{
"address": "crossprovider_testres.example",
"mode": "managed",
"type": "crossprovider_testres",
"name": "example",
"provider_config_key": "crossprovider",
"expressions": {
"location": [
{
"metro_code": {
"constant_value": "FRA"
}
}
]
},
"schema_version": 0
}
]
}
},
"timestamp": "2024-05-15T13:32:31Z",
"applyable": true,
"complete": true,
"errored": false
} It could be the case that either my repro or the framework is going wrong somewher, let me know if I've missed something! |
API always returns a value for metroCode. I did some more tests., always using
|
Can you post the state of the resource after the first pulumi up?
This seems to contradict the diff which pulumi shows there and
Very curious about the behaviour. |
This updates our `objchange` algorithm with the newest one from the OpenTofu repo. This fixes an issue with the way unknown sets are presented to TF. fixes #1951
What happened?
I work in the development of the Equinix provider. I have an issue in multiple resources where it finds changes in pulumi preview for resources without modifications. I have discovered so far:
schema.TypeSet
MaxItems 1optional
andcomputed
Example
The issue:
To reproduce: run
pulumi preview
after a successfulpulumi up
If I update the
CloudRouterLocationArgs
with the rest of optional/computed fields values returned it works well:metro_name="Frankfurt",
ibx="",
region="EMEA",
Output of
pulumi about
% pulumi about
CLI
Version 3.100.0
Go Version go1.21.5
Go Compiler gc
Plugins
NAME VERSION
equinix 0.8.0
google-native 0.32.0
python unknown
Host
OS darwin
Version 14.4.1
Arch x86_64
This project is written in python: executable='/Users/Oscar/Workspace/pulumi-equinix-fabric-cloud-router/venv/bin/python3' version='3.11.6'
Current Stack: ocobleseqx/equinix-fabric-cloud-router-2-gcp/test-fcr-gcp
Found no resources associated with test-fcr-gcp
Found no pending operations associated with test-fcr-gcp
Backend
Name pulumi.com
URL https://app.pulumi.com/ocobleseqx
User ocobleseqx
Organizations ocobleseqx
Token type personal
Dependencies:
NAME VERSION
google-cloud-compute 1.18.0
grpcio-status 1.60.1
pip 23.3.1
pulumi_equinix 0.8.0
pulumi-google-native 0.32.0
setuptools 68.2.2
Pulumi locates its logs in /var/folders/mc/fb3gq3zd4g52ykjt_rg27tpc0000gp/T/ by default
Additional context
terraform schema definition https://github.com/equinix/terraform-provider-equinix/blob/0844b8c394e50067bfc0ba3b8c50f0061405d6ee/equinix/resource_fabric_cloud_router.go#L144-L153
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: