Skip to content

lifecycle.ignore_changes argument does not work for metadata on payment_method #25

Open
@Bart-Kuipers

Description

@Bart-Kuipers

Version information

  • terraform: 1.9.8
  • terraform provider: 0.21.0

Describe the bug

the lifecycle.ignore_changes argument is not working for the metadata attribute on the payment_method resource

To Reproduce

  1. Provision a payment method resource with the ignore_changes argument set to ignore changes to the metadata attribute:
resource "commercelayer_payment_method" "example_1" {
  attributes {
    name                 = "example-payment-method-name-1"
    payment_source_type  = "wire_transfers"
    currency_code        = "EUR"
    price_amount_cents   = 4
    moto                 = false
    reference            = "example-payment-method-ref-1"
  }

  relationships {
    payment_gateway_id = "WxQGrsBGJj"
    # market_id is optional
    # market_id = "your-market-id"
  }

  lifecycle {
    ignore_changes = [
      attributes[0].metadata
    ]
  }
}
  1. Modify the metadata outside of Terraform
  2. Update the name of the resource with Terraform
  3. The metadata field is cleared by Terraform

Expected behavior

Terraform should preserve the metadata set outside of Terraform

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions