Skip to content

Commit

Permalink
Kms module
Browse files Browse the repository at this point in the history
  • Loading branch information
joecks committed Feb 27, 2024
1 parent 3fe2959 commit 7ac7b1d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
11 changes: 11 additions & 0 deletions otc/kms_key/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

resource "random_id" "id" {
byte_length = 4
}

resource "opentelekomcloud_kms_key_v1" "key" {
key_alias = "${var.name}-${random_id.id.hex}"
key_description = var.description
pending_days = var.pending_days
realm = var.region_zone
}
7 changes: 7 additions & 0 deletions otc/kms_key/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output "id" {
value = opentelekomcloud_kms_key_v1.key.id
}

output "alias" {
value = opentelekomcloud_kms_key_v1.key.key_alias
}
13 changes: 13 additions & 0 deletions otc/kms_key/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
terraform {
required_version = "v1.3.7"
required_providers {
opentelekomcloud = {
source = "opentelekomcloud/opentelekomcloud"
version = ">=1.29.0"
}
random = {
source = "hashicorp/random"
version = ">=3.6.0"
}
}
}
21 changes: 21 additions & 0 deletions otc/kms_key/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "name" {
type = string
description = "The name of the key"
}

variable "description" {
type = string
description = "The description of the key"
}


variable "region_zone" {
type = string
description = "The region zone identifier: i.e. eu-de-01"
}

variable "pending_days" {
type = number
default = 30
description = "(Optional) Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 1096 days. Defaults to 30. It only is used when delete a key."
}

0 comments on commit 7ac7b1d

Please sign in to comment.