From ae0ebb87ff97a54d501223dce6b526823eca2de4 Mon Sep 17 00:00:00 2001 From: Greg Dubicki Date: Mon, 22 Apr 2024 14:04:41 +0100 Subject: [PATCH 1/2] Depend explicitly on the challenge to prevent some errors like ``` "registry.terraform.io/cloudflare/cloudflare" produced an invalid new value for .ownership_challenge: was null, but now cty.StringVal("[redacted]..[redacted]") ``` As recommended by @jacobbednarz in https://github.com/cloudflare/terraform-provider-cloudflare/issues/2752#issuecomment-1712190497 Workaround for issues like https://github.com/cloudflare/terraform-provider-cloudflare/issues/2794 https://github.com/cloudflare/terraform-provider-cloudflare/issues/2752 https://github.com/cloudflare/terraform-provider-cloudflare/issues/3001 --- docs/resources/logpush_job.md | 3 +++ examples/resources/cloudflare_logpush_job/resource.tf | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/resources/logpush_job.md b/docs/resources/logpush_job.md index 386f231ef5..fefb68e496 100644 --- a/docs/resources/logpush_job.md +++ b/docs/resources/logpush_job.md @@ -74,6 +74,9 @@ data "aws_s3_bucket_object" "challenge_file" { } resource "cloudflare_logpush_job" "example_job" { + depends_on = [ + cloudflare_logpush_ownership_challenge.ownership_challenge, data.aws_s3_bucket_object.challenge_file + ] enabled = true zone_id = "0da42c8d2132a9ddaf714f9e7c920711" name = "My-logpush-job" diff --git a/examples/resources/cloudflare_logpush_job/resource.tf b/examples/resources/cloudflare_logpush_job/resource.tf index cb95e33f60..60f8b8c03b 100644 --- a/examples/resources/cloudflare_logpush_job/resource.tf +++ b/examples/resources/cloudflare_logpush_job/resource.tf @@ -45,6 +45,9 @@ data "aws_s3_bucket_object" "challenge_file" { } resource "cloudflare_logpush_job" "example_job" { + depends_on = [ + cloudflare_logpush_ownership_challenge.ownership_challenge, data.aws_s3_bucket_object.challenge_file + ] enabled = true zone_id = "0da42c8d2132a9ddaf714f9e7c920711" name = "My-logpush-job" From 388fa940cc78ae2247cf86ecc481256ecf7666be Mon Sep 17 00:00:00 2001 From: Greg Dubicki Date: Wed, 8 May 2024 12:43:55 +0100 Subject: [PATCH 2/2] Fix: remove redundant resource (thx @jacobbednarz) --- docs/resources/logpush_job.md | 4 +--- examples/resources/cloudflare_logpush_job/resource.tf | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/resources/logpush_job.md b/docs/resources/logpush_job.md index fefb68e496..481e621501 100644 --- a/docs/resources/logpush_job.md +++ b/docs/resources/logpush_job.md @@ -74,9 +74,7 @@ data "aws_s3_bucket_object" "challenge_file" { } resource "cloudflare_logpush_job" "example_job" { - depends_on = [ - cloudflare_logpush_ownership_challenge.ownership_challenge, data.aws_s3_bucket_object.challenge_file - ] + depends_on = [cloudflare_logpush_ownership_challenge.ownership_challenge] enabled = true zone_id = "0da42c8d2132a9ddaf714f9e7c920711" name = "My-logpush-job" diff --git a/examples/resources/cloudflare_logpush_job/resource.tf b/examples/resources/cloudflare_logpush_job/resource.tf index 60f8b8c03b..19339beaa4 100644 --- a/examples/resources/cloudflare_logpush_job/resource.tf +++ b/examples/resources/cloudflare_logpush_job/resource.tf @@ -45,9 +45,7 @@ data "aws_s3_bucket_object" "challenge_file" { } resource "cloudflare_logpush_job" "example_job" { - depends_on = [ - cloudflare_logpush_ownership_challenge.ownership_challenge, data.aws_s3_bucket_object.challenge_file - ] + depends_on = [cloudflare_logpush_ownership_challenge.ownership_challenge] enabled = true zone_id = "0da42c8d2132a9ddaf714f9e7c920711" name = "My-logpush-job"