|
1 | 1 | # terraform-ibm-kms |
2 | 2 | Terraform modules to create and work with IBM Key Management Service |
| 3 | + |
| 4 | +The supported modules are |
| 5 | +* [Provisioning Key protect Instance](./modules/instance) |
| 6 | +* [Creating or Importing Key Protect Key](./modules/key) |
| 7 | + |
| 8 | +## Example Usage |
| 9 | +``` |
| 10 | +data "ibm_resource_group" "resource_group" { |
| 11 | + name = var.resource_group |
| 12 | +} |
| 13 | +
|
| 14 | +module "kms_instance" { |
| 15 | + source = "terraform-ibm-modules/kms/ibm//modules/instance" |
| 16 | + resource_group_id = data.ibm_resource_group.resource_group.id |
| 17 | + service_name = var.service_name |
| 18 | + location = var.location |
| 19 | + plan = "tiered-pricing" |
| 20 | + tags = var.tags |
| 21 | + allowed_network_policy = var.allowed_network_policy |
| 22 | +} |
| 23 | +
|
| 24 | +module "kms_key" { |
| 25 | + source = "terraform-ibm-modules/kms/ibm//modules/key" |
| 26 | + kms_instance_guid = module.kms_instance.kms_instance-guid |
| 27 | + name = var.name |
| 28 | + standard_key_type = var.standard_key_type |
| 29 | + force_delete = var.force_delete |
| 30 | + network_access_allowed = var.network_access_allowed |
| 31 | +} |
| 32 | +
|
| 33 | +``` |
| 34 | + |
| 35 | +<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 36 | +## Inputs |
| 37 | +| Name | Description | Type |Default |Required | |
| 38 | +|--------------------------|----------------------------------------------------------------|:-------|:--------|:--------| |
| 39 | +| resource\_group | Name of the resource group |`string`| n/a | yes | |
| 40 | +| service_name | A descriptive name used to identify the resource instance |`string`| n/a | yes | |
| 41 | +| location | Target location or environment to create the resource instance |`string`| n/a | yes | |
| 42 | +| tags | Tags for the KMS Instance |`set` | n/a | no | |
| 43 | +| allowed_network_policy | Types of the service endpoints. |`string`| n/a | no | |
| 44 | +| kms_instance_guid | GUID of the Instance |`string`| n/a | yes | |
| 45 | +| name | Name of the Key |`string`| n/a | yes | |
| 46 | +| standard_key_type | Determines if it has to be a standard key or root key |`bool` | false | no | |
| 47 | +| force_delete | Determines if it has to be force deleted |`bool` | false | no | |
| 48 | +| network_access_allowed | public or private |`string`| `public`| no | |
| 49 | + |
| 50 | +<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
| 51 | + |
| 52 | +## Usage |
| 53 | + |
| 54 | +To run this example you need to execute: |
| 55 | + |
| 56 | +```bash |
| 57 | +$ terraform init |
| 58 | +$ terraform plan |
| 59 | +$ terraform apply |
| 60 | +``` |
| 61 | + |
| 62 | +Run `terraform destroy` when you don't need these resources. |
| 63 | + |
| 64 | + ## Note: |
| 65 | +* All optional fields are given value `null` in varaible.tf file. User can configure the same by overwriting with appropriate values. |
| 66 | + * Provide `version` attribute in terraform block in versions.tf file to use specific version of terraform provider |
0 commit comments