From 6b4e76a7e32dcd009a42ae27d84c479994cc67ce Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Wed, 8 Jan 2025 17:40:00 +0000 Subject: [PATCH] Fixes PermaDiff Issue in `google_storage_transfer_job.aws_s3_data_source.aws_access_key` field (#12666) [upstream:2b00b9bdf989b2ea8902acec8ee401d0d889da22] Signed-off-by: Modular Magician --- .changelog/12666.txt | 3 +++ .../services/storagetransfer/resource_storage_transfer_job.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/12666.txt diff --git a/.changelog/12666.txt b/.changelog/12666.txt new file mode 100644 index 00000000000..02c3078100b --- /dev/null +++ b/.changelog/12666.txt @@ -0,0 +1,3 @@ +```release-note:bug +storagetransfer: fixed a permadiff with `transfer_spec.aws_s3_data_source.aws_access_key` in `google_storage_transfer_job` +``` \ No newline at end of file diff --git a/google/services/storagetransfer/resource_storage_transfer_job.go b/google/services/storagetransfer/resource_storage_transfer_job.go index 3ddae3698ed..1c9f6b455e6 100644 --- a/google/services/storagetransfer/resource_storage_transfer_job.go +++ b/google/services/storagetransfer/resource_storage_transfer_job.go @@ -1133,7 +1133,7 @@ func flattenAwsS3Data(awsS3Data *storagetransfer.AwsS3Data, d *schema.ResourceDa "path": awsS3Data.Path, "role_arn": awsS3Data.RoleArn, } - if _, exist := d.GetOkExists("transfer_spec.0.aws_s3_data_source.0.aws_access_key"); exist { + if _, exist := d.GetOk("transfer_spec.0.aws_s3_data_source.0.aws_access_key"); exist { data["aws_access_key"] = flattenAwsAccessKeys(d) } return []map[string]interface{}{data}