Skip to content

Commit

Permalink
SSE algorythm as variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Varrkan82 committed Jul 29, 2024
1 parent ba95ee9 commit 8d820b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "default" {
bucket = aws_s3_bucket.this.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
sse_algorithm = var.sse_algorithm
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,13 @@ variable "enable_versioning" {
error_message = "Wrong state. Available only: Enabled, Disabled or Suspended"
}
}

variable "sse_algorithm" {
description = "Server-side encryption algorythm"
type = string
default = "AES256"
validation {
condition = can(regex("^(AES256|aws:kms)$", var.sse_algorithm))
error_message = "Wrong SSE algorythm. Available only: AES256 or aws:kms"
}
}

0 comments on commit 8d820b4

Please sign in to comment.