Skip to content

Commit

Permalink
Merge branch 't26_s3-feat' of github.e.it.census.gov:terraform-module…
Browse files Browse the repository at this point in the history
…s/aws-t26-s3 into aws-t26-s3
  • Loading branch information
ashle001 committed Sep 21, 2020
2 parents f8ea902 + 350db34 commit bb1f4d8
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,32 @@ resource "null_resource" "s3_create_wait" {
}
}

resource "aws_s3_bucket_object" "this_objects" {
riesource "aws_s3_bucket_object" "this_objects" {
bucket = aws_s3_bucket.this.id
count = length(var.bucket_folders)
key = format("%s/", element(var.bucket_folders, count.index))
source = "/dev/null"

depends_on = [null_resource.s3_create_wait]
}

#-------------------------------------------------------------------------
# EFS KMS KEY
#-------------------------------------------------------------------------
resource "aws_kms_key" "key" {
count = local.kms_key_arn_exists ? 0 : 1
description = "KMS CMK for title26_s3 ${local.name}"
enable_key_rotation = true

tags = merge(
local.base_tags,
{ "Name" = local.kms_key_name },
var.tags
)
}

resource "aws_kms_alias" "key" {
count = local.kms_key_arn_exists ? 0 : 1
name = "alias/${local.kms_key_name}"
target_key_id = (aws_kms_key.key.*)[0].key_id
}

0 comments on commit bb1f4d8

Please sign in to comment.