Skip to content

Commit

Permalink
fixing agentless key rotation (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpais authored Nov 4, 2024
1 parent 88eb60b commit 9939f6c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions modules/services/agentless-scanning/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,13 @@ resource "aws_kms_key" "scanning" {
count = var.is_organizational ? 0 : 1

description = "Sysdig Agentless Scanning encryption key"
enable_key_rotation = true
deletion_window_in_days = var.kms_key_deletion_window
key_usage = "ENCRYPT_DECRYPT"
policy = data.aws_iam_policy_document.key_policy[0].json
tags = var.tags
}

# Enable key rotation for the KMS key
resource "aws_kms_key_rotation" "scanning_rotation" {
count = var.is_organizational ? 0 : 1
key_id = aws_kms_key.scanning[0].id # Reference to the KMS key
}

# KMS alias resource only if singleton account
resource "aws_kms_alias" "scanning" {
count = var.is_organizational ? 0 : 1
Expand Down

0 comments on commit 9939f6c

Please sign in to comment.