From f4ef2af30cbea91eb158860257507e86e8639aa4 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Thu, 22 Sep 2022 14:37:44 -0400 Subject: [PATCH 1/2] Update tag maps to use current terraform syntax --- inputs.tf | 3 +-- main.tf | 25 +++++++++++++++---------- outputs.tf | 1 + 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/inputs.tf b/inputs.tf index 810477f..2602515 100644 --- a/inputs.tf +++ b/inputs.tf @@ -4,7 +4,7 @@ variable "name" { } variable "subnets" { - type = list + type = list(any) description = "(Required) A list of subnet ids where mount targets will be." } @@ -19,7 +19,6 @@ variable "encrypted" { type = bool } - variable "kms_key_id" { type = string description = "The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `encrypted = true`" diff --git a/main.tf b/main.tf index 3866260..f480479 100644 --- a/main.tf +++ b/main.tf @@ -10,10 +10,11 @@ resource "aws_efs_file_system" "this" { kms_key_id = var.kms_key_id tags = merge( - map("Name", var.name), - map("CreationToken", random_id.creation_token.hex), - map("terraform", "true"), - var.tags, + { "Name" : var.name, + "CreationToken" : random_id.creation_token.hex, + "terraform" : "true" + }, + var.tags ) } @@ -32,10 +33,12 @@ resource "aws_security_group" "mount_target_client" { depends_on = [aws_efs_mount_target.this] + tags = merge( - map("Name", "${var.name}-mount-target-client"), - map("terraform", "true"), - var.tags, + { "Name" : "${var.name}-mount-target-client" + "terraform" : "true" + }, + var.tags ) } @@ -54,10 +57,12 @@ resource "aws_security_group" "mount_target" { description = "Allow traffic from instances using ${var.name}-ec2." vpc_id = var.vpc_id + tags = merge( - map("Name", "${var.name}-mount-target"), - map("terraform", "true"), - var.tags, + { "Name" : "${var.name}-mount-target", + "terraform" : "true" + }, + var.tags ) } diff --git a/outputs.tf b/outputs.tf index 36c023e..27a57cf 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,6 +1,7 @@ output "file_system_dns_name" { value = aws_efs_file_system.this.dns_name } + output "file_system_arn" { value = aws_efs_file_system.this.arn } From 617d4c8376bef74ee923071c1942e164c5d73a52 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 23 Sep 2022 11:53:37 -0400 Subject: [PATCH 2/2] Update inputs.tf Co-authored-by: AJ Jordan --- inputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputs.tf b/inputs.tf index 2602515..6a16434 100644 --- a/inputs.tf +++ b/inputs.tf @@ -4,7 +4,7 @@ variable "name" { } variable "subnets" { - type = list(any) + type = list(string) description = "(Required) A list of subnet ids where mount targets will be." }