Skip to content
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

google_storage_transfer_job shows permanently diff when transfer_options set all false explicitly. #11744

Labels

Comments

@yudoufu
Copy link

yudoufu commented May 22, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.1.9
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v4.20.0
+ provider registry.terraform.io/hashicorp/google-beta v4.20.0
+ provider registry.terraform.io/hashicorp/random v3.1.3

Affected Resource(s)

  • google_storage_transfer_job

Terraform Configuration Files

resource "google_storage_transfer_job" "gcs_bucket_backup" {
  for_each = local.buckets

  project     = var.project
  description = "Daliy backup of ${each.value} GCS bucket"

  transfer_spec {
    gcs_data_source {
      bucket_name = each.value
    }

    gcs_data_sink {
      bucket_name = google_storage_bucket.backup[each.key].name
    }

    transfer_options {
      overwrite_objects_already_existing_in_sink = false
      delete_objects_unique_in_sink              = false
      delete_objects_from_source_after_transfer  = false
    }
  }

  schedule {
    schedule_start_date {
      year  = 2021
      month = 5
      day   = 27
    }

    start_time_of_day {
      hours   = 16
      minutes = 0
      seconds = 0
      nanos   = 0
    }
  }
}

Debug Output

After succeeded apply above resource, terraform plan shows a diff permanently.

  ~ resource "google_storage_transfer_job" "gcs_bucket_backup" {
        id                     = "knowledgework-dev/9563522446610641938"
        name                   = "transferJobs/9563522446610641938"
        # (5 unchanged attributes hidden)


      ~ transfer_spec {



          + transfer_options {
              + delete_objects_from_source_after_transfer  = false
              + delete_objects_unique_in_sink              = false
              + overwrite_objects_already_existing_in_sink = false
            }
            # (2 unchanged blocks hidden)
        }
        # (1 unchanged block hidden)
    }

Panic Output

None

Expected Behavior

terraform plan shouldn't show the diff of transfer_options after applied.

Actual Behavior

terraform plan always shows diff about transfer_options

Steps to Reproduce

  1. terraform apply

Important Factoids

None

References

@yudoufu yudoufu added the bug label May 22, 2022
@yudoufu
Copy link
Author

yudoufu commented May 22, 2022

I'll try to create the PR of this fix.

@github-actions
Copy link

github-actions bot commented Jul 3, 2022

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.