This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch DATALAB-2969
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2969 by this push:
new a499d0e89 [DATALAB-2969]: added multiple sgs for aws endpoint
a499d0e89 is described below
commit a499d0e890cdccb0c635ed8eca3f8434031f5775
Author: leonidfrolov <[email protected]>
AuthorDate: Mon Aug 15 14:48:46 2022 +0300
[DATALAB-2969]: added multiple sgs for aws endpoint
---
infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf | 2 +-
infrastructure-provisioning/terraform/aws/endpoint/main/network.tf | 4 ++--
infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf | 5 +++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git
a/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
b/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
index f863c9342..ead9cad6d 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/instance.tf
@@ -28,7 +28,7 @@ resource "aws_instance" "endpoint" {
instance_type = var.endpoint_instance_shape
key_name = var.key_name
subnet_id = data.aws_subnet.data_subnet.id
- security_groups = [aws_security_group.data_sg.id]
+ security_groups = aws_security_group.data_sg.id
iam_instance_profile = aws_iam_instance_profile.endpoint_profile.name
root_block_device {
volume_type = "gp2"
diff --git a/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
b/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
index 37198fc49..94586e0f0 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/network.tf
@@ -85,7 +85,7 @@ resource "aws_route" "route" {
resource "aws_security_group" "endpoint_sec_group" {
name = local.endpoint_sg_name
- count = var.sg_id == "" ? 1 : 0
+ count = var.sg_ids == [""] ? 1 : 0
vpc_id = data.aws_vpc.data_vpc.id
ingress {
from_port = 22
@@ -145,7 +145,7 @@ resource "aws_security_group" "endpoint_sec_group" {
}
data "aws_security_group" "data_sg" {
- id = var.sg_id == "" ? aws_security_group.endpoint_sec_group.id : var.sg_id
+ id = var.sg_ids == [""] ? [aws_security_group.endpoint_sec_group.id] :
var.sg_ids
}
resource "aws_eip" "endpoint_eip" {
diff --git
a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
index 9c89bcdba..28cece504 100644
--- a/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
+++ b/infrastructure-provisioning/terraform/aws/endpoint/main/variables.tf
@@ -53,8 +53,9 @@ variable "vpc_id" {
default = ""
}
-variable "sg_id" {
- default = ""
+variable "sg_ids" {
+ type = list(string)
+ default = [""]
}
variable "subnet_id" {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]