Skip to content

Commit be85820

Browse files
committed
chore: adding default value for scp deployment
chore: adding default value for scp deployment
1 parent 91ee5a7 commit be85820

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resource "kubernetes_namespace" "meshcloud" {
66
}
77

88
module "replicator_service_principal" {
9-
count = var.replicator_enabled ? 1 : 0
9+
count = var.replicator_enabled || var.service_principal_name != null ? 1 : 0
1010
scope = var.scope
1111
source = "./modules/meshcloud-replicator-service-principal"
1212
service_principal_name = var.service_principal_name

modules/meshcloud-replicator-service-principal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ No modules.
3333
| <a name="input_application_owners"></a> [application\_owners](#input\_application\_owners) | List of user principals that should be added as owners to the replicator service principal. | `list(string)` | `[]` | no |
3434
| <a name="input_create_password"></a> [create\_password](#input\_create\_password) | Create a password for the enterprise application. | `bool` | n/a | yes |
3535
| <a name="input_scope"></a> [scope](#input\_scope) | The scope of the service principal. The scope is usually the id of the aks subscription | `string` | n/a | yes |
36-
| <a name="input_service_principal_name"></a> [service\_principal\_name](#input\_service\_principal\_name) | Display name of the replicator service principal. | `string` | n/a | yes |
36+
| <a name="input_service_principal_name"></a> [service\_principal\_name](#input\_service\_principal\_name) | Display name of the replicator service principal. | `string` | `null` | no |
3737
| <a name="input_workload_identity_federation"></a> [workload\_identity\_federation](#input\_workload\_identity\_federation) | Enable workload identity federation instead of using a password by providing these additional settings. Usually you should receive the required settings when attempting to configure a platform with workload identity federation in meshStack. | `object({ issuer = string, replicator_subject = string })` | `null` | no |
3838

3939
## Outputs

modules/meshcloud-replicator-service-principal/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
variable "service_principal_name" {
22
type = string
3+
default = null
34
description = "Display name of the replicator service principal."
45
}
56

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## METERING
22
output "metering_token" {
3-
value = module.meshcloud-service-account-meshfed-metering.0.token_metering
3+
value = length(module.meshcloud-service-account-meshfed-metering) > 0 ? module.meshcloud-service-account-meshfed-metering[0].token_metering : null
44
sensitive = true
55
}
66

@@ -12,7 +12,7 @@ output "metering_expose_token" {
1212
## REPLICATOR
1313

1414
output "replicator_token" {
15-
value = module.meshcloud-service-account-meshfed-replicator.0.token_replicator
15+
value = length(module.meshcloud-service-account-meshfed-replicator) > 0 ? module.meshcloud-service-account-meshfed-replicator[0].token_replicator : null
1616
sensitive = true
1717
}
1818

0 commit comments

Comments
 (0)