forked from DNXLabs/terraform-aws-client-vpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsg.tf
23 lines (21 loc) · 737 Bytes
/
sg.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
resource "aws_security_group" "default" {
count = var.security_group_id == "" ? 1 : 0
name_prefix = "${var.name}-Client-VPN"
description = "security group allowing egress for client-vpn users"
vpc_id = var.vpc_id
tags = {
Name = "${var.name}-Client-VPN"
EnvName = var.name
Service = "client-vpn"
TerraformWorkspace = terraform.workspace
}
}
resource "aws_security_group_rule" "default_egress_world" {
count = var.security_group_id == "" ? 1 : 0
type = "egress"
from_port = -1
to_port = -1
protocol = "all"
cidr_blocks = ["0.0.0.0/0"]
security_group_id = aws_security_group.default[0].id
}