generated from telekom-mms/terraform-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from telekom-mms/refactoring
Refactoring Module
- Loading branch information
Showing
10 changed files
with
53 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
{ | ||
"repos": { | ||
"description": "A Terraform module that manages the tpl_resources resources from the azurerm provider.", | ||
"description": "A Terraform module that manages the authorization resources from the azurerm provider.", | ||
"visibility": "public", | ||
"default_branch": "main", | ||
"topics": [ | ||
"terraform", | ||
"azure" | ||
"azure", | ||
"role-assignment" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
module "tpl_module" { | ||
source = "tpl_source" | ||
tpl_local_name = { | ||
tpl_name = { | ||
location = "westeurope" | ||
resource_group_name = "rg-mms-github" | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +0,0 @@ | ||
module "tpl_module" { | ||
source = "tpl_source" | ||
tpl_local_name = { | ||
tpl_name = { | ||
location = "westeurope" | ||
resource_group_name = "rg-mms-github" | ||
tags = { | ||
project = "mms-github" | ||
environment = terraform.workspace | ||
managed-by = "terraform" | ||
} | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
module "tpl_module" { | ||
source = "tpl_source" | ||
tpl_local_name = { | ||
tpl_name = { | ||
location = "westeurope" | ||
resource_group_name = "rg-mms-github" | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
/** | ||
* # tpl_module | ||
* # authorization | ||
* | ||
* This module manages the tpl_provider tpl_module resources. | ||
* For more information see https://registry.terraform.io/providers/tpl_provider/latest/docs > tpl_module | ||
* This module manages the azurerm authorization resources. | ||
* For more information see https://registry.terraform.io/providers/azurerm/latest/docs > authorization | ||
* | ||
*/ | ||
|
||
resource "tpl_resource_type" "tpl_local_name" { | ||
for_each = var.tpl_local_name | ||
resource "azurerm_role_assignment" "role_assignment" { | ||
for_each = var.role_assignment | ||
|
||
name = local.tpl_local_name[each.key].name == "" ? each.key : local.tpl_local_name[each.key].name | ||
|
||
tags = local.tpl_local_name[each.key].tags | ||
name = local.role_assignment[each.key].name | ||
scope = local.role_assignment[each.key].scope | ||
role_definition_id = local.role_assignment[each.key].role_definition_id | ||
role_definition_name = local.role_assignment[each.key].role_definition_name | ||
principal_id = local.role_assignment[each.key].principal_id | ||
condition = local.role_assignment[each.key].condition | ||
condition_version = local.role_assignment[each.key].condition_version | ||
delegated_managed_identity_resource_id = local.role_assignment[each.key].delegated_managed_identity_resource_id | ||
description = local.role_assignment[each.key].description | ||
skip_service_principal_aad_check = local.role_assignment[each.key].skip_service_principal_aad_check | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
provider "azurerm" { | ||
features {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# see https://pkg.go.dev/github.com/gruntwork-io/terratest/modules/[package] | ||
functions: [] | ||
options: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "registry.terraform.io/hashicorp/azurerm" | ||
version = ">=3.59.0" | ||
} | ||
} | ||
required_version = ">=1.3" | ||
required_version = ">=1.4" | ||
} |