Skip to content

Commit

Permalink
fix: added workaround for known [provider issue](IBM-Cloud/terraform-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Khuzaima05 authored Aug 15, 2023
1 parent b7c6fe0 commit 768f8ac
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ You need the following permissions to run this module.
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.54.0, < 2.0.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |

### Modules

Expand All @@ -62,6 +63,7 @@ You need the following permissions to run this module.
| [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.rabbitmq_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
Expand Down
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ 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"
}


resource "ibm_database" "rabbitmq_database" {
depends_on = [ibm_iam_authorization_policy.kms_policy]
name = var.instance_name
Expand Down
28 changes: 23 additions & 5 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@
"version_constraints": [
"\u003e= 1.54.0, \u003c 2.0.0"
]
},
"time": {
"source": "hashicorp/time",
"version_constraints": [
"\u003e= 0.9.1"
]
}
},
"managed_resources": {
Expand All @@ -428,7 +434,7 @@
},
"pos": {
"filename": "main.tf",
"line": 35
"line": 43
}
},
"ibm_iam_authorization_policy.kms_policy": {
Expand Down Expand Up @@ -460,7 +466,7 @@
},
"pos": {
"filename": "main.tf",
"line": 170
"line": 178
}
},
"ibm_resource_tag.rabbitmq_tag": {
Expand All @@ -476,7 +482,19 @@
},
"pos": {
"filename": "main.tf",
"line": 122
"line": 130
}
},
"time_sleep.wait_for_authorization_policy": {
"mode": "managed",
"type": "time_sleep",
"name": "wait_for_authorization_policy",
"provider": {
"name": "time"
},
"pos": {
"filename": "main.tf",
"line": 36
}
}
},
Expand All @@ -496,7 +514,7 @@
},
"pos": {
"filename": "main.tf",
"line": 198
"line": 206
}
}
},
Expand Down Expand Up @@ -574,7 +592,7 @@
},
"pos": {
"filename": "main.tf",
"line": 132
"line": 140
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ terraform {
source = "IBM-Cloud/ibm"
version = ">= 1.54.0, < 2.0.0"
}
time = {
source = "hashicorp/time"
version = ">= 0.9.1"
}
}
}

0 comments on commit 768f8ac

Please sign in to comment.