From a442bdee96bd28d965aa3b52fa3d2bf454f332af Mon Sep 17 00:00:00 2001 From: Aayush-Abhyarthi <122350533+Aayush-Abhyarthi@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:23:16 +0530 Subject: [PATCH] fix: added workaround for known [provider issue](https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478) ([#160](https://github.ibm.com/GoldenEye/icd-datastax-module/issues/160)) (#65) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Conall Ó Cofaigh --- README.md | 2 ++ main.tf | 7 +++++++ module-metadata.json | 28 +++++++++++++++++++++++----- version.tf | 4 ++++ 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6de8c63c..dff170bd 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ You need the following permissions to run this module. |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | | [ibm](#requirement\_ibm) | >= 1.54.0, < 2.0.0 | +| [time](#requirement\_time) | >= 0.9.1 | ### Modules @@ -142,6 +143,7 @@ You need the following permissions to run this module. | [ibm_event_streams_topic.es_topic](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/event_streams_topic) | resource | | [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource | | [ibm_resource_instance.es_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource | +| [time_sleep.wait_for_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource | ### Inputs diff --git a/main.tf b/main.tf index 56f62ad0..bc469985 100644 --- a/main.tf +++ b/main.tf @@ -27,6 +27,13 @@ locals { ) : null } +# workaround for https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478 +resource "time_sleep" "wait_for_authorization_policy" { + depends_on = [ibm_iam_authorization_policy.kms_policy] + + create_duration = "30s" +} + resource "ibm_resource_instance" "es_instance" { name = var.es_name service = "messagehub" diff --git a/module-metadata.json b/module-metadata.json index 3737402d..7e254555 100644 --- a/module-metadata.json +++ b/module-metadata.json @@ -300,6 +300,12 @@ "version_constraints": [ "\u003e= 1.54.0, \u003c 2.0.0" ] + }, + "time": { + "source": "hashicorp/time", + "version_constraints": [ + "\u003e= 0.9.1" + ] } }, "managed_resources": { @@ -317,7 +323,7 @@ }, "pos": { "filename": "main.tf", - "line": 55 + "line": 62 } }, "ibm_event_streams_topic.es_topic": { @@ -335,7 +341,7 @@ }, "pos": { "filename": "main.tf", - "line": 66 + "line": 73 } }, "ibm_iam_authorization_policy.kms_policy": { @@ -352,7 +358,7 @@ }, "pos": { "filename": "main.tf", - "line": 80 + "line": 87 } }, "ibm_resource_instance.es_instance": { @@ -372,7 +378,19 @@ }, "pos": { "filename": "main.tf", - "line": 30 + "line": 37 + } + }, + "time_sleep.wait_for_authorization_policy": { + "mode": "managed", + "type": "time_sleep", + "name": "wait_for_authorization_policy", + "provider": { + "name": "time" + }, + "pos": { + "filename": "main.tf", + "line": 31 } } }, @@ -452,7 +470,7 @@ }, "pos": { "filename": "main.tf", - "line": 93 + "line": 100 } } } diff --git a/version.tf b/version.tf index d03d72a6..d55b7ac1 100644 --- a/version.tf +++ b/version.tf @@ -6,5 +6,9 @@ terraform { source = "IBM-Cloud/ibm" version = ">= 1.54.0, < 2.0.0" } + time = { + source = "hashicorp/time" + version = ">= 0.9.1" + } } }