diff --git a/modules/vpc-endpoints/main.tf b/modules/vpc-endpoints/main.tf index 5e2d105b..0177c076 100644 --- a/modules/vpc-endpoints/main.tf +++ b/modules/vpc-endpoints/main.tf @@ -63,9 +63,9 @@ resource "aws_vpc_endpoint" "this" { ) timeouts { - create = try(var.timeouts.create, "10m") - update = try(var.timeouts.update, "10m") - delete = try(var.timeouts.delete, "10m") + create = var.timeouts.create + update = var.timeouts.update + delete = var.timeouts.delete } } @@ -75,6 +75,8 @@ resource "aws_vpc_endpoint" "this" { resource "aws_security_group" "this" { count = var.create && var.create_security_group ? 1 : 0 + # In future if need to support multiple security groups. + # for_each = var.create && var.create_security_group ? [1] : [] name = var.security_group_name name_prefix = var.security_group_name_prefix diff --git a/modules/vpc-endpoints/outputs.tf b/modules/vpc-endpoints/outputs.tf index a9df78d0..c8352812 100644 --- a/modules/vpc-endpoints/outputs.tf +++ b/modules/vpc-endpoints/outputs.tf @@ -15,4 +15,5 @@ output "security_group_arn" { output "security_group_id" { description = "ID of the security group" value = try(aws_security_group.this[0].id, null) + sensitive = true } diff --git a/modules/vpc-endpoints/variables.tf b/modules/vpc-endpoints/variables.tf index 30a747ab..426e8147 100644 --- a/modules/vpc-endpoints/variables.tf +++ b/modules/vpc-endpoints/variables.tf @@ -36,8 +36,16 @@ variable "tags" { variable "timeouts" { description = "Define maximum timeout for creating, updating, and deleting VPC endpoint resources" - type = map(string) - default = {} + type = object({ + create = optional(string) + update = optional(string) + delete = optional(string) + }) + default = { + create = "10m" + update = "10m" + delete = "10m" + } } ################################################################################ @@ -53,7 +61,7 @@ variable "create_security_group" { variable "security_group_name" { description = "Name to use on security group created. Conflicts with `security_group_name_prefix`" type = string - default = null + default = null } variable "security_group_name_prefix" {