Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/cmk.tf Secret

Created June 15, 2025 22:15
Show Gist options
  • Select an option

  • Save KyMidd/c19f7db81a3c7a3a032784f6b1621da7 to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/c19f7db81a3c7a3a032784f6b1621da7 to your computer and use it in GitHub Desktop.
locals {
cmk_alias = "alias/VeraCmk"
}
# Create the KMS key
resource "aws_kms_key" "cmk" {
description = "Key for encrypting access tokens between Vera lambda layers"
deletion_window_in_days = 10
enable_key_rotation = true
tags = {
Name = "VeraCmk"
}
}
# Optional alias for easier reference
resource "aws_kms_alias" "cmk_alias" {
name = local.cmk_alias
target_key_id = aws_kms_key.cmk.key_id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment