Skip to content

Commit

Permalink
feat: expose KMS instance id as output (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
shemau authored May 2, 2023
1 parent 17122fa commit 61a46ba
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ No resources.
|------|-------------|
| <a name="output_existing_key_ring_keys"></a> [existing\_key\_ring\_keys](#output\_existing\_key\_ring\_keys) | IDs of Keys created by the module in existing Key Rings |
| <a name="output_key_protect_guid"></a> [key\_protect\_guid](#output\_key\_protect\_guid) | Key Protect GUID |
| <a name="output_key_protect_id"></a> [key\_protect\_id](#output\_key\_protect\_id) | Key Protect service instance ID when an instance is created, otherwise null |
| <a name="output_key_protect_instance_policies"></a> [key\_protect\_instance\_policies](#output\_key\_protect\_instance\_policies) | Instance Polices of the Key Protect instance |
| <a name="output_key_protect_name"></a> [key\_protect\_name](#output\_key\_protect\_name) | Key Protect Name |
| <a name="output_key_rings"></a> [key\_rings](#output\_key\_rings) | IDs of new Key Rings created by the module |
Expand Down
5 changes: 5 additions & 0 deletions examples/existing-resources/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ output "resource_group_id" {
value = module.resource_group.resource_group_id
}

output "key_protect_id" {
description = "Key Protect service instance ID"
value = module.existing_key_protect.key_protect_id
}

output "key_protect_guid" {
description = "Key Protect GUID"
value = module.key_protect_all_inclusive.key_protect_guid
Expand Down
18 changes: 13 additions & 5 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
"value": "module.existing_key_ring_keys",
"pos": {
"filename": "outputs.tf",
"line": 30
"line": 35
}
},
"key_protect_guid": {
Expand All @@ -222,20 +222,28 @@
"line": 5
}
},
"key_protect_id": {
"name": "key_protect_id",
"description": "Key Protect service instance ID when an instance is created, otherwise null",
"pos": {
"filename": "outputs.tf",
"line": 10
}
},
"key_protect_instance_policies": {
"name": "key_protect_instance_policies",
"description": "Instance Polices of the Key Protect instance",
"pos": {
"filename": "outputs.tf",
"line": 15
"line": 20
}
},
"key_protect_name": {
"name": "key_protect_name",
"description": "Key Protect Name",
"pos": {
"filename": "outputs.tf",
"line": 10
"line": 15
}
},
"key_rings": {
Expand All @@ -244,7 +252,7 @@
"value": "module.key_protect_key_rings",
"pos": {
"filename": "outputs.tf",
"line": 20
"line": 25
}
},
"keys": {
Expand All @@ -253,7 +261,7 @@
"value": "module.key_protect_keys",
"pos": {
"filename": "outputs.tf",
"line": 25
"line": 30
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ output "key_protect_guid" {
value = local.key_protect_guid
}

output "key_protect_id" {
description = "Key Protect service instance ID when an instance is created, otherwise null"
value = can(module.key_protect[0].key_protect_id) ? module.key_protect[0].key_protect_id : null
}

output "key_protect_name" {
description = "Key Protect Name"
value = length(module.key_protect) > 0 ? module.key_protect[0].key_protect_name : null
Expand Down

0 comments on commit 61a46ba

Please sign in to comment.