Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Add kms to s3 remote state module (#302)
Browse files Browse the repository at this point in the history
* Changes to the s3-remote-state for issue 286

* Initial attempt to add server side encryption to the s3-remote-state bucket
  • Loading branch information
Michael McGirr authored Mar 7, 2020
1 parent 941d441 commit b4feb7f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions modules/s3-remote-state/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,26 @@ variable "force_destroy" {
type = bool
}

variable "kms_key_id" {
description = "The ARN of a KMS Key to use for encrypting the state"
type = string
}

resource "aws_s3_bucket" "remote-state" {
bucket = var.bucket_name
acl = "private"
region = var.region
force_destroy = var.force_destroy

server_side_encryption_configuration {
rule {
apply_server_side_encryption_by_default {
kms_master_key_id = var.kms_key_id
sse_algorithm = "aws:kms"
}
}
}

versioning {
enabled = var.versioning
}
Expand Down

0 comments on commit b4feb7f

Please sign in to comment.