Skip to content

enahnacement: update timeouts, variables, and outputs for vpc-endpoin… #1220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions modules/vpc-endpoints/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions modules/vpc-endpoints/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
14 changes: 11 additions & 3 deletions modules/vpc-endpoints/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

################################################################################
Expand All @@ -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" {
Expand Down
Loading