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.64k stars 9.01k forks source link

[Bug]: Permanent drift when `preserve_source_data_typing` is set to false in `aws_appflow_flow` resource #37478

Open dnlloyd opened 2 months ago

dnlloyd commented 2 months ago

Terraform Core Version

v1.8.3

AWS Provider Version

5.49.0

Affected Resource(s)

Permanent drift occurs when the following arguments/values are present:

Setting destination_flow_config.destination_connector_properties.s3.s3_output_format_config.preserve_source_data_typing to true results in No changes.

Perhaps this is the intended behavior? If so we should document it.

Also,should preserve_source_data_typing be a Computed value?

Expected Behavior

With all other configuration being equal, setting destination_flow_config.destination_connector_properties.s3.s3_output_format_config.preserve_source_data_typing to false should produce No changes on subsequent Terraform plans.

Actual Behavior

After setting destination_flow_config.destination_connector_properties.s3.s3_output_format_config.preserve_source_data_typing to false, subsequent plans always show pending changes to tasks when no other arguments have been modified.

Relevant Error/Panic Output Snippet

# module.salesforce_to_s3_individual_mapping.aws_appflow_flow.appflow_flow_individual_mappings[0] will be updated in-place
  ~ resource "aws_appflow_flow" "appflow_flow_individual_mappings" {
        id          = "arn:aws:appflow:us-east-1:XXXXXXXXX:flow/xxx"
        name        = "xxx"
        tags        = {
            "BusinessLine"       = "Module Development"
        }
        # (5 unchanged attributes hidden)
.
.
.

      - task {
          - destination_field = "Email" -> null
          - source_fields     = [
              - "Email",
            ] -> null
          - task_properties   = {
              - "DESTINATION_DATA_TYPE" = "string"
              - "SOURCE_DATA_TYPE"      = "email"
            } -> null
          - task_type         = "Map" -> null

          - connector_operator {
              - salesforce       = "NO_OP" -> null
                # (15 unchanged attributes hidden)
            }
        }
.
.
.
      + task {
          + destination_field = "Email"
          + source_fields     = [
              + "Email",
            ]
          + task_properties   = {
              + "DESTINATION_DATA_TYPE" = "string"
              + "SOURCE_DATA_TYPE"      = "email"
            }
          + task_type         = "Map"

          + connector_operator {
              + salesforce = "NO_OP"
            }
        }
.
.
.
Plan: 0 to add, 1 to change, 0 to destroy.

Terraform Configuration Files

https://gist.github.com/dnlloyd/50bd64505541d62a01a5bdc5d7e77822

Steps to Reproduce

  1. Set destination_flow_config.destination_connector_properties.s3.s3_output_format_config.file_type to "PARQUET" and destination_flow_config.destination_connector_properties.s3.s3_output_format_config.preserve_source_data_typing to false.

  2. terraform plan

  3. terraform apply

  4. terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 2 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue