Skip to content

Plan comparison fails for move actions #473

@shaunkillingbeck

Description

@shaunkillingbeck

There is a more recent feature that allows resources to be moved via configuration rather than terraform state mv commands. A very handy feature!

Unfortunately, when there is only a "move" action to perform, the lines that compact_plan.py looks for to find a plan are not printed and so it is not treated as a plan. For example:

[...]
module.orion_migration_omp_engine.aiven_kafka_acl.omp_task_status_read_data_platform_secure["omp_task_status_v1"]: Refreshing state... [id=ap1-prod-1/kafka-prod/acl39b6abe2093]
module.orion_migration_omp_engine.aiven_kafka_acl.omp_task_status_read_data_platform_secure["omp_task_status_v2"]: Refreshing state... [id=ap1-prod-1/kafka-prod/acl3abf60c7aae]

Terraform will perform the following actions:

  # module.reads-and-consumption.aiven_kafka_acl.energy_charging_topic_merger_rac_daily_electricity_consumption_v1_read has moved to module.reads-and-consumption.aiven_kafka_acl.energy_charging_topic_merger_rac_daily_electricity_consumption_v1_read[0]
    resource "aiven_kafka_acl" "energy_charging_topic_merger_rac_daily_electricity_consumption_v1_read" {
        id           = "ap1-prod-1/kafka-prod/acl3ae0a2b4b23"
        # (6 unchanged attributes hidden)
    }

Plan: 0 to add, 0 to change, 0 to destroy.
Releasing state lock. This may take a few moments...

The full output including all the Refreshing state... lines is added to the GitHub comment, and when this is later compared with cmp.py it is unlikely to ever match because the Refreshing state... lines do not appear in a deterministic order. As such CD pipeline will continue to fail and changes will not be applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions