Skip to content

Commit

Permalink
added efs filesystem policy to force TLS on connections, and updated …
Browse files Browse the repository at this point in the history
…provider block
  • Loading branch information
jeremycook123 committed May 22, 2024
1 parent 16b25e5 commit 7aac2fc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions terraform/modules/efs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ resource "aws_efs_file_system" "file_system" {
}
}

data "aws_iam_policy_document" "policy" {
statement {
sid = "DenyInsecureTransport"
effect = "Deny"

principals {
type = "AWS"
identifiers = ["*"]
}

actions = [
"elasticfilesystem:ClientMount",
"elasticfilesystem:ClientWrite",
]

resources = [aws_efs_file_system.file_system.arn]

condition {
test = "Bool"
variable = "aws:SecureTransport"
values = ["false"]
}
}
}

resource "aws_efs_access_point" "access_point" {
count = var.posix_access_point_config == null || var.root_access_point_config == null ? 0 : 1

Expand Down
2 changes: 1 addition & 1 deletion terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 5.0.0"
version = "~> 5.50.0"
}
}
}
Expand Down

0 comments on commit 7aac2fc

Please sign in to comment.