Skip to content

Commit c9ed4cc

Browse files
committed
feat: include more examples with different use cases
1 parent fc66d8b commit c9ed4cc

File tree

16 files changed

+141
-38
lines changed

16 files changed

+141
-38
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ module "meshplatform" {
152152
153153
| Name | Description | Type | Default | Required |
154154
|------|-------------|------|---------|:--------:|
155-
| <a name="input_additional_permissions"></a> [additional\_permissions](#input\_additional\_permissions) | Additional Subscription-Level Permissions that the SPP needs | `list(string)` | `[]` | no |
156-
| <a name="input_additional_required_resource_accesses"></a> [additional\_required\_resource\_accesses](#input\_additional\_required\_resource\_accesses) | Additional AAD-Level Resource Accesses the customer needs | `list(object({ resource_app_id = string, resource_accesses = list(object({ id = string, type = string })) }))` | `[]` | no |
155+
| <a name="input_additional_permissions"></a> [additional\_permissions](#input\_additional\_permissions) | Additional Subscription-Level Permissions the SPP needs. | `list(string)` | `[]` | no |
156+
| <a name="input_additional_required_resource_accesses"></a> [additional\_required\_resource\_accesses](#input\_additional\_required\_resource\_accesses) | Additional AAD-Level Resource Accesses the replicator SPP needs. | `list(object({ resource_app_id = string, resource_accesses = list(object({ id = string, type = string })) }))` | `[]` | no |
157157
| <a name="input_idplookup_enabled"></a> [idplookup\_enabled](#input\_idplookup\_enabled) | Whether to create idplookup SPP or not. | `bool` | `true` | no |
158158
| <a name="input_kraken_enabled"></a> [kraken\_enabled](#input\_kraken\_enabled) | Whether to create kraken SPP or not. | `bool` | `true` | no |
159159
| <a name="input_mgmt_group_name"></a> [mgmt\_group\_name](#input\_mgmt\_group\_name) | The name or UUID of the Management Group. | `string` | n/a | yes |
160160
| <a name="input_replicator_enabled"></a> [replicator\_enabled](#input\_replicator\_enabled) | Whether to create replicator SPP or not. | `bool` | `true` | no |
161-
| <a name="input_spp_name_suffix"></a> [spp\_name\_suffix](#input\_spp\_name\_suffix) | Service principal name suffix. | `string` | n/a | yes |
161+
| <a name="input_spp_name_suffix"></a> [spp\_name\_suffix](#input\_spp\_name\_suffix) | Service principal name suffix. Make sure this is unique. | `string` | n/a | yes |
162162
| <a name="input_subscriptions"></a> [subscriptions](#input\_subscriptions) | The scope to which UAMI blueprint service principal role assignment is applied. | `list(any)` | `[]` | no |
163163
164164
## Outputs
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# It is recommended to setup a backend to store the terraform state file
2+
# Removing the backend leads to terraform state output stored in the local filesystem.
3+
# See https://www.terraform.io/language/settings/backends for more details
4+
terraform {
5+
backend "gcs" {
6+
prefix = "meshplatforms/azure"
7+
bucket = "my-terraform-states"
8+
}
9+
}
10+
11+
module "meshplatform" {
12+
source = "git@github.com:meshcloud/terraform-azure-meshplatform.git"
13+
14+
spp_name_suffix = "<UNIQUE_NAME>"
15+
mgmt_group_name = "<MANAGEMENT_GROUP_NAME>|<MANAGEMENT_GROUP_UUID>"
16+
17+
additional_required_resource_accesses = [
18+
# The block below configures replicator access
19+
# to the app with id `fe81736c-99c6-4fca-8cc2-2818a2365451` with the appRole with id `e29066a1-ecb1-4a8e-af2d-1627fae35711`
20+
#
21+
# This example configures access to an azure function
22+
{
23+
resource_app_id = "fe81736c-99c6-4fca-8cc2-2818a2365451" # https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application#resource_app_id
24+
resource_accesses = [
25+
# https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application#resource_access
26+
{
27+
id = "e29066a1-ecb1-4a8e-af2d-1627fae35711"
28+
type = "Role"
29+
},
30+
]
31+
},
32+
]
33+
34+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
output "replicator_spp" {
3+
description = "Replicator Service Principal."
4+
value = module.meshplatform.replicator_spp
5+
}
6+
7+
output "replicator_spp_password" {
8+
description = "Password for Replicator Service Principal."
9+
value = module.meshplatform.replicator_spp_password
10+
sensitive = true
11+
}
12+
13+
output "kraken_spp" {
14+
description = "Kraken Service Principal."
15+
value = module.meshplatform.kraken_spp
16+
}
17+
18+
output "kraken_spp_password" {
19+
description = "Password for Kraken Service Principal."
20+
value = module.meshplatform.kraken_spp_password
21+
sensitive = true
22+
}
23+
24+
output "uami_blueprint_user_principal" {
25+
description = "UAMI Blueprint Assignment Service Principal."
26+
value = module.meshplatform.uami_blueprint_user_principal
27+
}
28+
29+
output "uami_blueprint_user_principal_password" {
30+
description = "Password for UAMI Blueprint Assignment Service Principal."
31+
value = module.meshplatform.uami_blueprint_user_principal_password
32+
sensitive = true
33+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# It is recommended to setup a backend to store the terraform state file
2+
# Removing the backend leads to terraform state output stored in the local filesystem.
3+
# See https://www.terraform.io/language/settings/backends for more details
4+
terraform {
5+
backend "gcs" {
6+
prefix = "meshplatforms/azure"
7+
bucket = "my-terraform-states"
8+
}
9+
}
10+
11+
module "meshplatform" {
12+
source = "git@github.com:meshcloud/terraform-azure-meshplatform.git"
13+
14+
spp_name_suffix = "<UNIQUE_NAME>"
15+
mgmt_group_name = "<MANAGEMENT_GROUP_NAME>|<MANAGEMENT_GROUP_UUID>"
16+
17+
subscriptions = ["<SUBSCRIPTION_ID>"]
18+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
output "replicator_spp" {
2+
description = "Replicator Service Principal."
3+
value = module.meshplatform.replicator_spp
4+
}
5+
6+
output "replicator_spp_password" {
7+
description = "Password for Replicator Service Principal."
8+
value = module.meshplatform.replicator_spp_password
9+
sensitive = true
10+
}
11+
12+
output "kraken_spp" {
13+
description = "Kraken Service Principal."
14+
value = module.meshplatform.kraken_spp
15+
}
16+
17+
output "kraken_spp_password" {
18+
description = "Password for Kraken Service Principal."
19+
value = module.meshplatform.kraken_spp_password
20+
sensitive = true
21+
}
22+
23+
output "uami_blueprint_user_principal" {
24+
description = "UAMI Blueprint Assignment Service Principal."
25+
value = module.meshplatform.uami_blueprint_user_principal
26+
}
27+
28+
output "uami_blueprint_user_principal_password" {
29+
description = "Password for UAMI Blueprint Assignment Service Principal."
30+
value = module.meshplatform.uami_blueprint_user_principal_password
31+
sensitive = true
32+
}

examples/basic-azure-integration/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ terraform {
1111
module "meshplatform" {
1212
source = "git@github.com:meshcloud/terraform-azure-meshplatform.git"
1313

14-
spp_name_suffix = "UNIQUE_NAME"
15-
mgmt_group_name = "MANAGEMENT_GROUP_NAME|MANAGEMENT_GROUP_UUID"
14+
spp_name_suffix = "<UNIQUE_NAME>"
15+
mgmt_group_name = "<MANAGEMENT_GROUP_NAME>|<MANAGEMENT_GROUP_UUID>"
16+
1617
}

examples/basic-azure-integration/outputs.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
output "replicator_spp" {
32
description = "Replicator Service Principal."
43
value = module.meshplatform.replicator_spp

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ module "replicator_spp" {
3131
spp_name_suffix = var.spp_name_suffix
3232
scope = data.azurerm_management_group.root.id
3333

34-
additional_required_resource_accesses = []
35-
additional_permissions = []
34+
additional_required_resource_accesses = var.additional_required_resource_accesses
35+
additional_permissions = var.additional_permissions
3636
}
3737

3838
module "kraken_spp" {

modules/meshcloud-idp-lookup-spp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ No modules.
2929

3030
| Name | Description | Type | Default | Required |
3131
|------|-------------|------|---------|:--------:|
32-
| <a name="input_scope"></a> [scope](#input\_scope) | The scope to which SPP permissions should be assigned to. Usually this is a management group that sits atop the subscriptions | `string` | n/a | yes |
32+
| <a name="input_scope"></a> [scope](#input\_scope) | The scope to which SPP permissions should be assigned to. Usually this is a management group that sits atop the subscriptions. | `string` | n/a | yes |
3333
| <a name="input_spp_name_suffix"></a> [spp\_name\_suffix](#input\_spp\_name\_suffix) | Service principal name suffix. | `string` | n/a | yes |
3434

3535
## Outputs

modules/meshcloud-idp-lookup-spp/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ variable "spp_name_suffix" {
55

66
variable "scope" {
77
type = string
8-
description = "The scope to which SPP permissions should be assigned to. Usually this is a management group that sits atop the subscriptions"
8+
description = "The scope to which SPP permissions should be assigned to. Usually this is a management group that sits atop the subscriptions."
99
}

0 commit comments

Comments
 (0)