This is an automated email from the ASF dual-hosted git repository. omartushevskyi pushed a commit to branch DLAB-1467 in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
The following commit(s) were added to refs/heads/DLAB-1467 by this push: new 28dbde9 [DLAB-1467]: Added terraform scripts for deploying DLab endpoint 28dbde9 is described below commit 28dbde9cb40c6804b6c19dca22f53ce7d41a5a92 Author: Oleh Martushevskyi <oleh_martushevs...@epam.com> AuthorDate: Tue Feb 4 11:36:55 2020 +0200 [DLAB-1467]: Added terraform scripts for deploying DLab endpoint --- .../terraform/azure/endpoint/main/outputs.tf | 2 +- .../terraform/azure/endpoint/main/sg.tf | 76 ++++++++++++---------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/infrastructure-provisioning/terraform/azure/endpoint/main/outputs.tf b/infrastructure-provisioning/terraform/azure/endpoint/main/outputs.tf index fe09d3e..bc5e20d 100644 --- a/infrastructure-provisioning/terraform/azure/endpoint/main/outputs.tf +++ b/infrastructure-provisioning/terraform/azure/endpoint/main/outputs.tf @@ -32,5 +32,5 @@ output "vpc_id" { } output "ssn_k8s_sg_id" { - value = azure_security_group.enpoint-sg.id + value = azurerm_network_security_group.enpoint-sg.id } \ No newline at end of file diff --git a/infrastructure-provisioning/terraform/azure/endpoint/main/sg.tf b/infrastructure-provisioning/terraform/azure/endpoint/main/sg.tf index 63f11c5..9ab63cc 100644 --- a/infrastructure-provisioning/terraform/azure/endpoint/main/sg.tf +++ b/infrastructure-provisioning/terraform/azure/endpoint/main/sg.tf @@ -23,46 +23,50 @@ locals { endpoint_sg_name = "${var.service_base_name}-${var.endpoint_id}-sg" } -resource "azure_security_group" "enpoint-sg" { - name = local.endpoint_sg_name - location = var.region +resource "azurerm_network_security_group" "enpoint-sg" { + location = data.azurerm_resource_group.data-endpoint-resource-group.location + resource_group_name = data.azurerm_resource_group.data-endpoint-resource-group.name + name = local.endpoint_sg_name } -resource "azure_security_group_rule" "inbound-1" { - name = "inbound-1" - security_group_names = [azure_security_group.enpoint-sg.name] - type = "Inbound" - action = "Allow" - priority = 100 - source_address_prefix = "*" - source_port_range = "*" - destination_address_prefix = "*" - destination_port_range = "22" - protocol = "TCP" +resource "azurerm_network_security_rule" "inbound-1" { + resource_group_name = data.azurerm_resource_group.data-endpoint-resource-group.name + network_security_group_name = azurerm_network_security_group.enpoint-sg.name + name = "inbound-1" + direction = "Inbound" + access = "Allow" + priority = 100 + source_address_prefix = "*" + source_port_range = "*" + destination_address_prefix = "*" + destination_port_range = "22" + protocol = "TCP" } -resource "azure_security_group_rule" "inbound-2" { - name = "inbound-2" - security_group_names = [azure_security_group.enpoint-sg.name] - type = "Inbound" - action = "Allow" - priority = 200 - source_address_prefix = "*" - source_port_range = "*" - destination_address_prefix = "*" - destination_port_range = "8084" - protocol = "TCP" +resource "azurerm_network_security_rule" "inbound-2" { + resource_group_name = data.azurerm_resource_group.data-endpoint-resource-group.name + network_security_group_name = azurerm_network_security_group.enpoint-sg.name + name = "inbound-2" + direction = "Inbound" + access = "Allow" + priority = 200 + source_address_prefix = "*" + source_port_range = "*" + destination_address_prefix = "*" + destination_port_range = "8084" + protocol = "TCP" } -resource "azure_security_group_rule" "outbound-1" { - name = "outbound-1" - security_group_names = [azure_security_group.enpoint-sg.name] - type = "Outbound" - action = "Allow" - priority = 100 - source_address_prefix = "*" - source_port_range = "*" - destination_address_prefix = "*" - destination_port_range = "*" - protocol = "*" +resource "azurerm_network_security_rule" "outbound-1" { + resource_group_name = data.azurerm_resource_group.data-endpoint-resource-group.name + network_security_group_name = azurerm_network_security_group.enpoint-sg.name + name = "outbound-1" + direction = "Outbound" + access = "Allow" + priority = 100 + source_address_prefix = "*" + source_port_range = "*" + destination_address_prefix = "*" + destination_port_range = "*" + protocol = "*" } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@dlab.apache.org For additional commands, e-mail: commits-h...@dlab.apache.org