diff --git a/README.md b/README.md
index 95c5efd3..c0271d09 100644
--- a/README.md
+++ b/README.md
@@ -59,6 +59,7 @@ To attach access management tags to resources in this module, you need the follo
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.3.0 |
| [ibm](#requirement\_ibm) | >= 1.54.0, < 2.0.0 |
+| [time](#requirement\_time) | >= 0.9.1 |
### Modules
@@ -74,6 +75,7 @@ To attach access management tags to resources in this module, you need the follo
| [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
| [ibm_resource_key.service_credentials](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_key) | resource |
| [ibm_resource_tag.postgresql_tag](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) | resource |
+| [time_sleep.wait_for_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [ibm_database_connection.database_connection](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/database_connection) | data source |
### Inputs
diff --git a/main.tf b/main.tf
index d8b3f3c6..961d75be 100644
--- a/main.tf
+++ b/main.tf
@@ -38,6 +38,13 @@ resource "ibm_iam_authorization_policy" "kms_policy" {
roles = ["Reader"]
}
+# 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"
+}
+
# Create postgresql database
resource "ibm_database" "postgresql_db" {
depends_on = [ibm_iam_authorization_policy.kms_policy]
diff --git a/module-metadata.json b/module-metadata.json
index 27a2526e..74e99385 100644
--- a/module-metadata.json
+++ b/module-metadata.json
@@ -455,6 +455,12 @@
"version_constraints": [
"\u003e= 1.54.0, \u003c 2.0.0"
]
+ },
+ "time": {
+ "source": "hashicorp/time",
+ "version_constraints": [
+ "\u003e= 0.9.1"
+ ]
}
},
"managed_resources": {
@@ -483,7 +489,7 @@
},
"pos": {
"filename": "main.tf",
- "line": 42
+ "line": 49
}
},
"ibm_iam_authorization_policy.kms_policy": {
@@ -515,7 +521,7 @@
},
"pos": {
"filename": "main.tf",
- "line": 182
+ "line": 189
}
},
"ibm_resource_tag.postgresql_tag": {
@@ -531,7 +537,19 @@
},
"pos": {
"filename": "main.tf",
- "line": 133
+ "line": 140
+ }
+ },
+ "time_sleep.wait_for_authorization_policy": {
+ "mode": "managed",
+ "type": "time_sleep",
+ "name": "wait_for_authorization_policy",
+ "provider": {
+ "name": "time"
+ },
+ "pos": {
+ "filename": "main.tf",
+ "line": 42
}
}
},
@@ -551,7 +569,7 @@
},
"pos": {
"filename": "main.tf",
- "line": 210
+ "line": 217
}
}
},
@@ -630,7 +648,7 @@
},
"pos": {
"filename": "main.tf",
- "line": 143
+ "line": 150
}
}
}
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"
+ }
}
}