From 6897321dfb2e59fb103af583ddfe4e084f032207 Mon Sep 17 00:00:00 2001 From: kentikethan <119891787+kentikethan@users.noreply.github.com> Date: Fri, 16 Feb 2024 20:41:31 -0800 Subject: [PATCH] update to use non-deprecated modules and to use python3 (#73) * update to use non-depracated modules and to use python3 * updated the workflow for aws-ansible to only run when changes are made to that directory --- .github/workflows/aws-ansible.yml | 1 + .gitignore | 1 + .../single_account_multiple_resource_groups/terraform.tfvars | 4 ++-- cloud_Azure/terraform/module/network_watcher.tf | 2 +- cloud_Azure/terraform/module/service_principal.tf | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/aws-ansible.yml b/.github/workflows/aws-ansible.yml index 026134c..88fca10 100644 --- a/.github/workflows/aws-ansible.yml +++ b/.github/workflows/aws-ansible.yml @@ -7,6 +7,7 @@ on: paths: 'cloud_AWS/ansible/**' branches: [ master ] pull_request: + paths: 'cloud_AWS/ansible/**' branches: [ master ] jobs: diff --git a/.gitignore b/.gitignore index f880b3a..d71e1b8 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ override.tf override.tf.json *_override.tf *_override.tf.json +*_override.tfvars # Include override files you do wish to add to version control using negated pattern # diff --git a/cloud_Azure/terraform/module/examples/single_account_multiple_resource_groups/terraform.tfvars b/cloud_Azure/terraform/module/examples/single_account_multiple_resource_groups/terraform.tfvars index beb0110..b63846c 100644 --- a/cloud_Azure/terraform/module/examples/single_account_multiple_resource_groups/terraform.tfvars +++ b/cloud_Azure/terraform/module/examples/single_account_multiple_resource_groups/terraform.tfvars @@ -1,8 +1,8 @@ # Azure subscription_id = "" location = "" -resource_group_names = [] -storage_account_names = [] +resource_group_names = [""] +storage_account_names = [""] # Kentik email= "" diff --git a/cloud_Azure/terraform/module/network_watcher.tf b/cloud_Azure/terraform/module/network_watcher.tf index 1a56354..b2dbca0 100644 --- a/cloud_Azure/terraform/module/network_watcher.tf +++ b/cloud_Azure/terraform/module/network_watcher.tf @@ -13,7 +13,7 @@ data "azurerm_network_watcher" "network_watcher" { # "ResourceGroupName2" -> "NetworkSercurityGroupId3,NetworkSecurityGroupId4" # } data "external" "nsg_data_source" { - program = ["python", "${path.module}/get_nsg.py"] + program = ["python3", "${path.module}/get_nsg.py"] query = { resource_group_names = join(",", var.resource_group_names) } diff --git a/cloud_Azure/terraform/module/service_principal.tf b/cloud_Azure/terraform/module/service_principal.tf index da2cf52..d625e84 100644 --- a/cloud_Azure/terraform/module/service_principal.tf +++ b/cloud_Azure/terraform/module/service_principal.tf @@ -1,7 +1,7 @@ data "azuread_client_config" "current" {} data "azuread_service_principals" "existing_nsg_flow_exporter" { - application_ids = [var.flow_exporter_application_id] + client_ids = [var.flow_exporter_application_id] ignore_missing = true } @@ -14,7 +14,7 @@ locals { resource "azuread_service_principal" "new_nsg_flow_exporter" { count = local.nsg_flow_exporter_already_exists ? 0 : 1 - application_id = var.flow_exporter_application_id + client_id = var.flow_exporter_application_id app_role_assignment_required = false owners = [data.azuread_client_config.current.object_id]