hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.61k stars 9k forks source link

[Bug]: operation error Pipes: UpdatePipe: TF deletes input template whenever there is a modification to filter #33938

Open solagappan opened 8 months ago

solagappan commented 8 months ago

Terraform Core Version

1.3.0

AWS Provider Version

5.20.0

Affected Resource(s)

Expected Behavior

When SQS que is used as target in pipe and any change to the pipe filtering pattern and applying the TF change is automatically removing the "Target input transformer" template from the pipe and its not displayed in the apply command output.

When we tried to re-apply again without any TF code change, the "Target input transformer" is added back.

Expected behavior: pipe configuration in TF code should should be removed silently.

Actual Behavior

After apply command, "Target input transformer" got removed from the pipe configuration.

Relevant Error/Panic Output Snippet

No error

Terraform Configuration Files

# code snippet
resource "aws_pipes_pipe" "test-eventbridge-pipe" {
  name = "test-eventbridge-pipe"
  role_arn = aws_iam_role.test-eventbridge-pipe-role.arn
  source = var.msk_cluster_arn
  target = var.sqs_fifo_que_arn
  source_parameters {
    filter_criteria {
      filter{
        pattern = jsonencode({
          "value": {
            "data": {
              "event_type": [{
                "prefix": "PURCHASE_ORDER"
              }]
            },
            "metadata": {
              "operation": [{
                "prefix": "created"
              }]
            }
          }
        })
      }
    }
  }
  target_parameters {
    input_template = "<$.value.data.event>"
    sqs_queue_parameters {
      message_deduplication_id = "$.value.data.de_duplication_id"
      message_group_id = "$.value.data.group_id"
    }
  }
  tags = {
    Env = "${lower(var.env)}"
  }
}

Steps to Reproduce

Step 1 : Apply the code snippet Step 2 : Edit the filter_criteria -> filter ( do some change ) Step 3: Apply the change Step 4 : Go to AWs console and you will see the input_template = "<$.value.data.event>" removed Step 5: Apply the change again ( no code change ) Step 6: Go to AWS console Step 7: You will see the input_template back in pipe target configuration

Debug Output

Nil

Panic Output

Nil

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 8 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

egidijustidal commented 5 months ago

We experienced the same, even applying changes to source, like changing the batch size on the source, ends up removing existing target_parameters. Reapplying this without changes puts it back in.

playermanny2 commented 5 days ago

we're experiencing the same as well, wondering if this has been updated in newer terraform modules? 1.7.5 >

solagappan commented 4 days ago

If you run the "apply" again, template will get updated. I did not check in latest version.