-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure_account_onboarding.tf
59 lines (50 loc) · 1.43 KB
/
azure_account_onboarding.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Azure Cloud Account Onboarding
terraform {
required_providers {
prismacloud = {
source = "PaloAltoNetworks/prismacloud"
version = "1.2.10"
}
}
}
provider "prismacloud" {
url = var.url
username = var.username
password = var.password
}
# Single Azure account type.
# resource "prismacloud_cloud_account" "rehan_azure_account" {
# #disable_on_destroy = true
# azure {
# account_id = "<account id>"
# enabled = true
# group_ids = [
# prismacloud_account_group.rehan-azure-accountgroup.group_id,
# ]
# name = "rehan-azure"
# client_id = "<client id>"
# key = "<key>"
# tenant_id = "<tenant id>"
# service_principal_id = "<service principal id>"
# protection_mode = "MONITOR"
# }
# }
resource "prismacloud_account_group" "rehan-azure-accountgroup" {
name = "rehan-azure-account-group"
}
# Multiple Azure accounts onboarding via csv.
locals {
azureinstances = csvdecode(file("azure.csv"))
}
resource "prismacloud_cloud_account" "csv" {
for_each = { for inst in local.azureinstances : inst.name => inst }
azure {
account_id = each.value.accountid
group_ids = split ("||", each.value.groupids)
name = each.value.name
client_id = each.value.clientid
key = each.value.key
tenant_id = each.value.tenantid
service_principal_id = each.value.serviceprincipalid
}
}