File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ resource "aws_vpc_endpoint" "this" {
6363 )
6464
6565 timeouts {
66- create = try ( var. timeouts . create , " 10m " )
67- update = try ( var. timeouts . update , " 10m " )
68- delete = try ( var. timeouts . delete , " 10m " )
66+ create = var. timeouts . create
67+ update = var. timeouts . update
68+ delete = var. timeouts . delete
6969 }
7070}
7171
@@ -75,6 +75,8 @@ resource "aws_vpc_endpoint" "this" {
7575
7676resource "aws_security_group" "this" {
7777 count = var. create && var. create_security_group ? 1 : 0
78+ # In future if need to support multiple security groups.
79+ # for_each = var.create && var.create_security_group ? [1] : []
7880
7981 name = var. security_group_name
8082 name_prefix = var. security_group_name_prefix
Original file line number Diff line number Diff line change @@ -15,4 +15,5 @@ output "security_group_arn" {
1515output "security_group_id" {
1616 description = " ID of the security group"
1717 value = try (aws_security_group. this [0 ]. id , null )
18+ sensitive = true
1819}
Original file line number Diff line number Diff line change @@ -36,7 +36,11 @@ variable "tags" {
3636
3737variable "timeouts" {
3838 description = " Define maximum timeout for creating, updating, and deleting VPC endpoint resources"
39- type = map (string )
39+ type = object ({
40+ create = optional (string , " 10m" )
41+ update = optional (string , " 10m" )
42+ delete = optional (string , " 10m" )
43+ })
4044 default = {}
4145}
4246
@@ -54,6 +58,11 @@ variable "security_group_name" {
5458 description = " Name to use on security group created. Conflicts with `security_group_name_prefix`"
5559 type = string
5660 default = null
61+
62+ validation {
63+ condition = var. security_group_name == null || var. security_group_name_prefix == null
64+ error_message = " only one of security_group_name or security_group_name_prefix can be set."
65+ }
5766}
5867
5968variable "security_group_name_prefix" {
You can’t perform that action at this time.
0 commit comments