-
Notifications
You must be signed in to change notification settings - Fork 3
/
output.tf
51 lines (42 loc) · 1.66 KB
/
output.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
#
# output created service principals and credentials to a file
#
resource "local_sensitive_file" "cluster_service_principal" {
count = var.cluster_service_principal.create && var.output_as_file ? 1 : 0
content = <<-EOT
ARO_CLUSTER_SP_CLIENT_ID='${azuread_application.cluster[0].client_id}'
ARO_CLUSTER_SP_CLIENT_SECRET='${azuread_application_password.cluster[0].value}'
EOT
filename = "./${var.cluster_name}_cluster-sp-credentials.txt"
file_permission = "0600"
}
resource "local_sensitive_file" "installer_service_principal" {
count = local.installer_user_set ? 0 : ((var.installer_service_principal.create && var.output_as_file) ? 1 : 0)
content = <<-EOT
ARO_INSTALLER_SP_CLIENT_ID='${azuread_application.installer[0].client_id}'
ARO_INSTALLER_SP_CLIENT_SECRET='${azuread_application_password.installer[0].value}'
ARO_TENANT_ID='${data.azuread_client_config.current.tenant_id}'
EOT
filename = "./${var.cluster_name}_installer-sp-credentials.txt"
file_permission = "0600"
}
output "cluster_service_principal_app_id" {
value = local.cluster_service_principal_app_id
}
output "cluster_service_principal_client_id" {
value = local.cluster_service_principal_client_id
}
output "cluster_service_principal_client_secret" {
value = local.cluster_service_principal_client_secret
sensitive = true
}
output "installer_service_principal_app_id" {
value = local.installer_service_principal_app_id
}
output "installer_service_principal_client_id" {
value = local.installer_service_principal_client_id
}
output "installer_service_principal_client_secret" {
value = local.installer_service_principal_client_secret
sensitive = true
}