Skip to content

Commit 768f8ac

Browse files
authored
fix: added workaround for known [provider issue](IBM-Cloud/terraform-provider-ibm#4478) (#14)
1 parent b7c6fe0 commit 768f8ac

File tree

4 files changed

+37
-5
lines changed

4 files changed

+37
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ You need the following permissions to run this module.
4747
|------|---------|
4848
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
4949
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.54.0, < 2.0.0 |
50+
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |
5051

5152
### Modules
5253

@@ -62,6 +63,7 @@ You need the following permissions to run this module.
6263
| [ibm_iam_authorization_policy.kms_policy](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/iam_authorization_policy) | resource |
6364
| [ibm_resource_key.service_credentials](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_key) | resource |
6465
| [ibm_resource_tag.rabbitmq_tag](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) | resource |
66+
| [time_sleep.wait_for_authorization_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
6567
| [ibm_database_connection.database_connection](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/database_connection) | data source |
6668

6769
### Inputs

main.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ resource "ibm_iam_authorization_policy" "kms_policy" {
3232
roles = ["Reader"]
3333
}
3434

35+
# workaround for https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4478
36+
resource "time_sleep" "wait_for_authorization_policy" {
37+
depends_on = [ibm_iam_authorization_policy.kms_policy]
38+
39+
create_duration = "30s"
40+
}
41+
42+
3543
resource "ibm_database" "rabbitmq_database" {
3644
depends_on = [ibm_iam_authorization_policy.kms_policy]
3745
name = var.instance_name

module-metadata.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@
404404
"version_constraints": [
405405
"\u003e= 1.54.0, \u003c 2.0.0"
406406
]
407+
},
408+
"time": {
409+
"source": "hashicorp/time",
410+
"version_constraints": [
411+
"\u003e= 0.9.1"
412+
]
407413
}
408414
},
409415
"managed_resources": {
@@ -428,7 +434,7 @@
428434
},
429435
"pos": {
430436
"filename": "main.tf",
431-
"line": 35
437+
"line": 43
432438
}
433439
},
434440
"ibm_iam_authorization_policy.kms_policy": {
@@ -460,7 +466,7 @@
460466
},
461467
"pos": {
462468
"filename": "main.tf",
463-
"line": 170
469+
"line": 178
464470
}
465471
},
466472
"ibm_resource_tag.rabbitmq_tag": {
@@ -476,7 +482,19 @@
476482
},
477483
"pos": {
478484
"filename": "main.tf",
479-
"line": 122
485+
"line": 130
486+
}
487+
},
488+
"time_sleep.wait_for_authorization_policy": {
489+
"mode": "managed",
490+
"type": "time_sleep",
491+
"name": "wait_for_authorization_policy",
492+
"provider": {
493+
"name": "time"
494+
},
495+
"pos": {
496+
"filename": "main.tf",
497+
"line": 36
480498
}
481499
}
482500
},
@@ -496,7 +514,7 @@
496514
},
497515
"pos": {
498516
"filename": "main.tf",
499-
"line": 198
517+
"line": 206
500518
}
501519
}
502520
},
@@ -574,7 +592,7 @@
574592
},
575593
"pos": {
576594
"filename": "main.tf",
577-
"line": 132
595+
"line": 140
578596
}
579597
}
580598
}

version.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ terraform {
66
source = "IBM-Cloud/ibm"
77
version = ">= 1.54.0, < 2.0.0"
88
}
9+
time = {
10+
source = "hashicorp/time"
11+
version = ">= 0.9.1"
12+
}
913
}
1014
}

0 commit comments

Comments
 (0)