Skip to content

Commit

Permalink
update docs, replace nsg w/ vnet
Browse files Browse the repository at this point in the history
  • Loading branch information
jksprattler committed Jan 15, 2025
1 parent ba6245f commit 906dcbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
33 changes: 6 additions & 27 deletions cloud_Azure/terraform/module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
Module supporting management of Azure and Kentik resources required for flow log export from Azure to Kentik.

Module enables:
* Flow logs in all Network Security Groups (NSG) found in requested Resource Groups
* Flow logs in all Virtual Networks (VNets) found in requested Resource Groups

Module creates:
* Service Principal for Kentik NSG Flow Exporter application
* Service Principal for Kentik VNet Flow Exporter application
* Reader and Contributor Roles for above mentioned Service Principal
* One Storage Account for flow logs per requested Resource Group
* Registers flow in Kentik platform per requested Resource Group

All resources created in Azure are tagged, see variable "resource_tag" in [variables.tf](./variables.tf)

Module assumes that NetworkWatcher resource exists in NetworkWatcherRG resource group in specified Azure location (see variable "location" in [variables.tf](./variables.tf)).
For example, in location "eastus" there should be "NetworkWatcher_eastus" in "NetworkWatcherRG" resource group.
Module assumes that NetworkWatcher resource exists in NetworkWatcherRG resource group in specified Azure location (see variable "location" in [variables.tf](./variables.tf)).
For example, in location "eastus" there should be "NetworkWatcher_eastus" in "NetworkWatcherRG" resource group.
NetworkWatcher is automatically created by Azure when VirtualNetwork is created or updated, [as per documentation.](https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-create). This happens eg. when launching a new virtual machine.

## Usage examples
Expand All @@ -40,27 +40,6 @@ NetworkWatcher is automatically created by Azure when VirtualNetwork is created
| null | >= 2.1.2 |
| external | >= 2.0.0 |

## Python and dependencies

This module uses Python script to list all Network Security Groups in specified Resource Groups and exposes the list to Terraform as external data source.
To install Python and required packages:
* [Install Python and PIP](https://docs.python.org/3/using/index.html)
* Install packages - in module directory, execute:
PowerShell:
```powershell
pip install virtualenv
virtualenv venv
.\venv\Scripts\activate
pip install -r requirements.txt
```
or Bash:
```bash
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```
## Inputs

| Name | Description | Type | Default | Required |
Expand All @@ -75,7 +54,7 @@ To install Python and required packages:
| enabled | Defines if cloud export to Kentik is enabled | `bool` | true | no |
| description | Cloudexport entry description in Kentik | `string` | `Created using Terraform` | no |
| resource_tag | Azure Tag value to apply to created resources | `string` | `flow_log_exporter` | no |
| flow_exporter_application_id | Kentik NSG Flow Exporter application ID | `string` | `a20ce222-63c0-46db-86d5-58551eeee89f` | no |
| flow_exporter_application_id | Kentik VNet Flow Exporter application ID | `string` | `a20ce222-63c0-46db-86d5-58551eeee89f` | no |
| storage_account_names | Names of Storage Accounts for storing flow logs. Names must meet Azure Storage Account naming restrictions.<br>The list should either contain 1 Storage Account name for each Resource Group, or be empty, in which case names will be generated automatically. | `list of strings` | `[]` | no |


Expand All @@ -87,4 +66,4 @@ To install Python and required packages:
| subscription_id | Azure subscription ID |
| resource_group_names | Names of Resource Groups from which to collect flow logs |
| storage_accounts | Storage Account names where flow logs will be collected |
| principal_id | Service Principal ID created for Kentik NSG Flow Exporter application |
| principal_id | Service Principal ID created for Kentik VNet Flow Exporter application |
2 changes: 1 addition & 1 deletion cloud_Azure/terraform/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ variable "enabled" {
variable "flow_exporter_application_id" {
type = string
default = "a20ce222-63c0-46db-86d5-58551eeee89f"
description = "Kentik NSG Flow Exporter application ID"
description = "Kentik VNet Flow Exporter application ID"
}

0 comments on commit 906dcbe

Please sign in to comment.