Skip to content

Commit

Permalink
feat: extend timeouts for create/update/delete operations (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
maheshwarishikha authored Jul 24, 2023
1 parent 97b3de9 commit 62e0892
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_admins"></a> [admins](#input\_admins) | A list of administrators for the instance crypto units. See [instructions](https://github.com/terraform-ibm-modules/terraform-ibm-hpcs#before-you-begin) to create administrator signature keys. You can set up to 8 administrators. Required if auto\_initialization\_using\_recovery\_crypto\_units set to true. | <pre>list(object({<br> name = string # max length: 30 chars<br> key = string # the absolute path and the file name of the signature key file if key files are created using TKE CLI and are not using a third-party signing service<br> # if you are using a signing service, the key name is appended to a URI that will be sent to the signing service<br> token = string # sensitive: the administrator password/token to authorize and access the corresponding signature key file<br> }))</pre> | `[]` | no |
| <a name="input_auto_initialization_using_recovery_crypto_units"></a> [auto\_initialization\_using\_recovery\_crypto\_units](#input\_auto\_initialization\_using\_recovery\_crypto\_units) | Set to true if auto initialization using recovery crypto units is required. | `bool` | `true` | no |
| <a name="input_create_timeout"></a> [create\_timeout](#input\_create\_timeout) | Create timeout value of the HPCS instance. | `string` | `"120m"` | no |
| <a name="input_delete_timeout"></a> [delete\_timeout](#input\_delete\_timeout) | Delete timeout value of the HPCS instance. | `string` | `"120m"` | no |
| <a name="input_hsm_connector_id"></a> [hsm\_connector\_id](#input\_hsm\_connector\_id) | The HSM connector ID provided by IBM required for Hybrid HPCS. Available to selected customers only. | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | The name to give the Hyper Protect Crypto Service instance. Max length allowed is 30 chars. | `string` | n/a | yes |
| <a name="input_number_of_crypto_units"></a> [number\_of\_crypto\_units](#input\_number\_of\_crypto\_units) | The number of operational crypto units for your service instance. | `number` | `2` | no |
Expand All @@ -186,6 +188,7 @@ No modules.
| <a name="input_signature_server_url"></a> [signature\_server\_url](#input\_signature\_server\_url) | The URL and port number of the signing service. Required if auto\_initialization\_using\_recovery\_crypto\_units set to true and using a third-party signing service to provide administrator signature keys. Only used if auto\_initialization\_using\_recovery\_crypto\_units is true | `string` | `null` | no |
| <a name="input_signature_threshold"></a> [signature\_threshold](#input\_signature\_threshold) | The number of administrator signatures that is required to execute administrative commands. Required if auto\_initialization\_using\_recovery\_crypto\_units set to true. | `number` | `1` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Optional list of resource tags to apply to the HPCS instance. | `list(string)` | `[]` | no |
| <a name="input_update_timeout"></a> [update\_timeout](#input\_update\_timeout) | Update timeout value of the HPCS instance. | `string` | `"120m"` | no |

### Outputs

Expand Down
12 changes: 12 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ resource "ibm_hpcs" "hpcs_instance" {
token = admins.value["token"]
}
}

timeouts {
create = var.create_timeout
update = var.update_timeout
delete = var.delete_timeout
}
}

resource "ibm_resource_instance" "base_hpcs_instance" {
Expand All @@ -55,4 +61,10 @@ resource "ibm_resource_instance" "base_hpcs_instance" {
hsm_connector = (var.hsm_connector_id != null) ? var.hsm_connector_id : null
allowed_network = var.service_endpoints
}

timeouts {
create = var.create_timeout
update = var.update_timeout
delete = var.delete_timeout
}
}
32 changes: 31 additions & 1 deletion module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@
"line": 34
}
},
"create_timeout": {
"name": "create_timeout",
"type": "string",
"description": "Create timeout value of the HPCS instance.",
"default": "120m",
"pos": {
"filename": "variables.tf",
"line": 121
}
},
"delete_timeout": {
"name": "delete_timeout",
"type": "string",
"description": "Delete timeout value of the HPCS instance.",
"default": "120m",
"pos": {
"filename": "variables.tf",
"line": 133
}
},
"hsm_connector_id": {
"name": "hsm_connector_id",
"type": "string",
Expand Down Expand Up @@ -204,6 +224,16 @@
"elem": {
"type": "TypeString"
}
},
"update_timeout": {
"name": "update_timeout",
"type": "string",
"description": "Update timeout value of the HPCS instance.",
"default": "120m",
"pos": {
"filename": "variables.tf",
"line": 127
}
}
},
"outputs": {
Expand Down Expand Up @@ -304,7 +334,7 @@
},
"pos": {
"filename": "main.tf",
"line": 42
"line": 48
}
}
},
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,22 @@ variable "hsm_connector_id" {
description = "The HSM connector ID provided by IBM required for Hybrid HPCS. Available to selected customers only."
default = null
}

variable "create_timeout" {
type = string
description = "Create timeout value of the HPCS instance."
default = "120m"
}

variable "update_timeout" {
type = string
description = "Update timeout value of the HPCS instance."
default = "120m"
}

variable "delete_timeout" {
type = string
description = "Delete timeout value of the HPCS instance."
default = "120m"
}
##############################################################################

0 comments on commit 62e0892

Please sign in to comment.