From ae0ebb87ff97a54d501223dce6b526823eca2de4 Mon Sep 17 00:00:00 2001 From: Greg Dubicki Date: Mon, 22 Apr 2024 14:04:41 +0100 Subject: [PATCH] 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"