Skip to content
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

Disable NSG on Azure #956

Merged
merged 3 commits into from
Mar 3, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix for NGS name in NIC definition
  • Loading branch information
seriva committed Feb 28, 2020
commit 546f06445e46af4d9c7aa78c9e8c149c8c0dbed7
Original file line number Diff line number Diff line change
@@ -84,11 +84,16 @@ def run(self):
infrastructure.append(public_ip)
public_ip_name = public_ip.specification.name

if self.use_network_security_groups:
nsg_name = nsg.specification.name
else:
nsg_name = ''

network_interface = self.get_network_interface(component_key,
component_value,
vm_config,
subnet.specification.name,
nsg.specification.name,
nsg_name,
public_ip_name,
index)
infrastructure.append(network_interface)
@@ -133,6 +138,7 @@ def get_subnet_network_security_group_association(self, component_key, subnet_na
def get_network_interface(self, component_key, component_value, vm_config, subnet_name, security_group_name, public_ip_name, index):
network_interface = self.get_config_or_default(self.docs, 'infrastructure/network-interface')
network_interface.specification.name = resource_name(self.cluster_prefix, self.cluster_name, 'nic' + '-' + str(index), component_key)
network_interface.specification.use_network_security_groups = self.use_network_security_groups
network_interface.specification.security_group_name = security_group_name
network_interface.specification.ip_configuration_name = resource_name(self.cluster_prefix, self.cluster_name, 'ipconf' + '-' + str(index), component_key)
network_interface.specification.subnet_name = subnet_name
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ provider: azure
name: default
specification:
name: SET_BY_AUTOMATION
use_network_security_groups: SET_BY_AUTOMATION
security_group_name: SET_BY_AUTOMATION
ip_configuration_name: SET_BY_AUTOMATION
subnet_name: SET_BY_AUTOMATION
Original file line number Diff line number Diff line change
@@ -14,7 +14,9 @@ resource "azurerm_network_interface" "{{ specification.name }}" {
name = "{{ specification.name }}"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
{%- if specification.use_network_security_groups == true %}
network_security_group_id = "${azurerm_network_security_group.{{ specification.security_group_name }}.id}"
{%- endif %}
enable_accelerated_networking = "{{ specification.enable_accelerated_networking | lower }}"

ip_configuration {