-
Notifications
You must be signed in to change notification settings - Fork 155
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
rds.ParameterGroup diff not clear #2442
Comments
@dirien Thanks for logging this. To confirm the severity of this, this is isolated to only the diff preview right? It doesn't cause the cloud resource to be recreated? |
@rquitales: no it does not trigger a recreated. |
Same for me. When I run multiple time
|
I've found this extends beyond just sort order. When asked, AWS will always say the So if you set a parameter
|
SummaryContrary to the original hypothesis, set element reordering is not affecting diffs as both TF and bridged providers
ResolutionCurrently leaning toward closing this as working as advertised, although the NOTE in the docs is a little vague about A more involved possibility would be to build support in pulumi-terraform-bridge for matching Minimal reproimport * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsx from "@pulumi/awsx";
import {rds} from "@pulumi/aws";
const backyardParameterGroup = new aws.rds.ParameterGroup(
"parametergroupmy",
{
family: "postgres14",
parameters: [
{
name: "track_io_timing",
value: "1",
applyMethod: "immediate", // Changing this to pending-reboot fixes the diff
},
],
},
); This yields: $ pulumi preview --diff
~ parameters: [
~ [0]: {
~ applyMethod: "pending-reboot" => "immediate"
~ name : "track_io_timing" => "track_io_timing"
~ value : "1" => "1"
}
]
Recommended workaround: edit your program source to mach applyMethod to the target values suggested by the Minimal repro in TFWrite resource "aws_db_parameter_group" "default" {
name = "rds-pg"
family = "postgres14"
parameter {
name = "track_io_timing"
value = "1"
apply_method = "immediate"
}
} And then: $ terraform apply
$ terraform plan
aws_db_parameter_group.default: Refreshing state... [id=rds-pg]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_db_parameter_group.default will be updated in-place
~ resource "aws_db_parameter_group" "default" {
id = "rds-pg"
name = "rds-pg"
tags = {}
# (4 unchanged attributes hidden)
- parameter {
- apply_method = "pending-reboot" -> null
- name = "track_io_timing" -> null
- value = "1" -> null
}
+ parameter {
+ apply_method = "immediate"
+ name = "track_io_timing"
+ value = "1"
}
}
Plan: 0 to add, 1 to change, 0 to destroy.
$ terraform plan -refresh=false
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. |
@stepan-romankov could you please open a separate issue with a repro for |
FWIW on the larger program I get:
And editing these listed entries gets rid of the perpetual diff. |
For completeness, here are some upstream issues essentially closed as won't fix: hashicorp/terraform-provider-aws#22028 |
I've tried applying an ignoreChanges workaround but it does not apply to this problem, unfortunately. This is now tracked in pulumi/pulumi-terraform-bridge#1756 |
It remains an option to consider @kmosher suggestion regarding |
Fixes #2442 This adds a diff customizer that ignores changes to parameters that only change the apply_method and not the value for the aws_db_parameter_group resource. To make this work, the change also needs to modify the set element hashing function to identify parameters that differ only by apply_method as identical. As a side-effect of the set hashing change, upgrading stacks to the newer version of the provider with this change will show a reordering update diff on the ParameterGroup resource.
What happened?
Hi,
when doing a up on a stack with a
rds.ParameterGroup
, Pulumi will always show a diff. This is due to the order the array gets saved in the Pulumi service.This makes the detection of an actuall very difficult, as everything is marked in red in the Pulumi output.
Demo code:
Expected Behavior
Shows only diffs of fields, which actually changed.
Steps to reproduce
See above the code!
Output of
pulumi about
Additional context
No response
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: