|
6 | 6 | "_generator": { |
7 | 7 | "name": "bicep", |
8 | 8 | "version": "0.33.93.31351", |
9 | | - "templateHash": "15877188685327638829" |
| 9 | + "templateHash": "14741729812904551283" |
10 | 10 | } |
11 | 11 | }, |
12 | 12 | "functions": [ |
|
530 | 530 | "metadata": { |
531 | 531 | "description": "whether to enable network outbound access" |
532 | 532 | } |
| 533 | + }, |
| 534 | + "source_address_prefixes": { |
| 535 | + "type": "array", |
| 536 | + "metadata": { |
| 537 | + "description": "The source IP address prefixes allowed in NSG" |
| 538 | + } |
533 | 539 | } |
534 | 540 | }, |
535 | 541 | "variables": { |
|
574 | 580 | "name": "[format('{0}{1}', parameters('subnet_prefix'), range(0, parameters('subnet_count'))[copyIndex('subnets')])]", |
575 | 581 | "properties": { |
576 | 582 | "addressPrefixes": "[concat(createArray(format('10.0.{0}.0/24', range(0, parameters('subnet_count'))[copyIndex('subnets')])), if(parameters('use_ipv6'), createArray(format('2001:db8:{0}::/64', range(0, parameters('subnet_count'))[copyIndex('subnets')])), createArray()))]", |
577 | | - "defaultOutboundAccess": "[parameters('enable_vm_nat')]" |
| 583 | + "defaultOutboundAccess": "[parameters('enable_vm_nat')]", |
| 584 | + "networkSecurityGroup": { |
| 585 | + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', format('{0}-nsg', toLower(parameters('virtual_network_name'))))]" |
| 586 | + } |
578 | 587 | } |
579 | 588 | } |
580 | 589 | } |
581 | 590 | ], |
582 | 591 | "addressSpace": { |
583 | 592 | "addressPrefixes": "[concat(createArray('10.0.0.0/16'), if(parameters('use_ipv6'), createArray('2001:db8::/32'), createArray()))]" |
584 | 593 | } |
| 594 | + }, |
| 595 | + "dependsOn": [ |
| 596 | + "nsg" |
| 597 | + ] |
| 598 | + }, |
| 599 | + "nsg": { |
| 600 | + "type": "Microsoft.Network/networkSecurityGroups", |
| 601 | + "apiVersion": "2024-05-01", |
| 602 | + "name": "[format('{0}-nsg', toLower(parameters('virtual_network_name')))]", |
| 603 | + "location": "[parameters('location')]", |
| 604 | + "properties": { |
| 605 | + "securityRules": [ |
| 606 | + { |
| 607 | + "name": "LISASSH", |
| 608 | + "properties": { |
| 609 | + "priority": 100, |
| 610 | + "direction": "Inbound", |
| 611 | + "access": "Allow", |
| 612 | + "protocol": "Tcp", |
| 613 | + "sourcePortRange": "*", |
| 614 | + "destinationPortRange": "22", |
| 615 | + "sourceAddressPrefixes": "[parameters('source_address_prefixes')]", |
| 616 | + "destinationAddressPrefix": "*" |
| 617 | + } |
| 618 | + }, |
| 619 | + { |
| 620 | + "name": "LISAKVMSSH", |
| 621 | + "properties": { |
| 622 | + "description": "Allows nested VM SSH traffic", |
| 623 | + "protocol": "Tcp", |
| 624 | + "sourcePortRange": "*", |
| 625 | + "destinationPortRange": "60020-60030", |
| 626 | + "destinationAddressPrefix": "*", |
| 627 | + "sourceAddressPrefixes": "[parameters('source_address_prefixes')]", |
| 628 | + "access": "Allow", |
| 629 | + "priority": 206, |
| 630 | + "direction": "Inbound" |
| 631 | + } |
| 632 | + }, |
| 633 | + { |
| 634 | + "name": "LISALIBVIRTSSH", |
| 635 | + "properties": { |
| 636 | + "description": "Allows SSH traffic to Libvirt Platform Guests", |
| 637 | + "protocol": "Tcp", |
| 638 | + "sourcePortRange": "*", |
| 639 | + "destinationPortRange": "49152-49352", |
| 640 | + "destinationAddressPrefix": "*", |
| 641 | + "sourceAddressPrefixes": "[parameters('source_address_prefixes')]", |
| 642 | + "access": "Allow", |
| 643 | + "priority": 208, |
| 644 | + "direction": "Inbound" |
| 645 | + } |
| 646 | + } |
| 647 | + ] |
585 | 648 | } |
586 | 649 | }, |
587 | 650 | "availability_set": { |
|
607 | 670 | "location": "[parameters('location')]", |
608 | 671 | "tags": "[parameters('tags')]", |
609 | 672 | "properties": { |
610 | | - "publicIPAllocationMethod": "[if(or(or(parameters('is_ultradisk'), variables('use_availability_zones')), parameters('use_ipv6')), 'Static', 'Dynamic')]", |
| 673 | + "publicIPAllocationMethod": "Static", |
611 | 674 | "ipTags": "[if(empty(variables('ip_tags')), null(), variables('ip_tags'))]" |
612 | 675 | }, |
613 | 676 | "sku": { |
614 | | - "name": "[if(or(or(parameters('is_ultradisk'), variables('use_availability_zones')), parameters('use_ipv6')), 'Standard', 'Basic')]" |
| 677 | + "name": "Standard" |
615 | 678 | }, |
616 | 679 | "zones": "[if(variables('use_availability_zones'), variables('availability_zones'), null())]" |
617 | 680 | }, |
|
0 commit comments