-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Azure vnet flow logs support in tf module (#78)
* Azure vnet flow logs support in tf module * filter rg's without any vnets * access vnet values * fix rg name, key values * fix rg name, key values * name * update provider versions in ci tests * update docs, replace nsg w/ vnet * vnet id outputs * remove local-exec provisioner null resources * retire get_nsg.py and remove unused requirements * cleanup service_principal creation * modify azure sa name generation * fix sa name * index sa's for uniqueness * fix * count with random_id on rg list' * add count index to local._names * more index * comment * add bd team as codeowners * comment --------- Co-authored-by: jksprattler <[email protected]>
- Loading branch information
1 parent
867d757
commit 058b50d
Showing
18 changed files
with
104 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @kentik/bd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ None. | |
location = "eastus" | ||
resource_group_names = ["resource-group-1", "resource-group-2", "resource-group-3"] # groups must exist in selected location | ||
storage_account_names = [] | ||
# Kentik | ||
email = "[email protected]" | ||
token = "dummy_token" | ||
|
@@ -29,8 +29,6 @@ None. | |
1. Execute: | ||
```bash | ||
virtualenv venv && source venv/bin/activate | ||
pip install -r ../../requirements.txt | ||
terraform init | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Provide service principal Contributor role to each storage account | ||
resource "azurerm_role_assignment" "kentic_role_contributor" { | ||
count = length(azurerm_storage_account.logs_storage_account) | ||
resource "azurerm_role_assignment" "kentik_role_contributor" { | ||
for_each = azurerm_storage_account.logs_storage_account | ||
|
||
scope = azurerm_storage_account.logs_storage_account[count.index].id | ||
scope = each.value.id | ||
role_definition_name = "Contributor" | ||
principal_id = local.kentik_nsg_flow_exporter_id | ||
principal_id = local.kentik_vnet_flow_exporter_id | ||
} | ||
|
||
# Provide service principal Reader role to each Resource Group | ||
resource "azurerm_role_assignment" "kentic_role_reader" { | ||
count = length(var.resource_group_names) | ||
resource "azurerm_role_assignment" "kentik_role_reader" { | ||
for_each = toset(var.resource_group_names) | ||
|
||
scope = "/subscriptions/${var.subscription_id}/resourceGroups/${var.resource_group_names[count.index]}" | ||
scope = "/subscriptions/${var.subscription_id}/resourceGroups/${each.value}" | ||
role_definition_name = "Reader" | ||
principal_id = local.kentik_nsg_flow_exporter_id | ||
principal_id = local.kentik_vnet_flow_exporter_id | ||
} |
Oops, something went wrong.