Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 5959 add global parameter #45

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions azurerm/modules/azurerm-adf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ terraform init -backend-config=./backend.local.tfvars

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 3.0 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.51.0 |

## Modules

Expand All @@ -88,18 +88,19 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_adf_idenity"></a> [adf\_idenity](#input\_adf\_idenity) | Enable identity block in module. | `bool` | `true` | no |
| <a name="input_branch_name"></a> [branch\_name](#input\_branch\_name) | Specifies repository branch to use as the collaboration branch. | `string` | `"main"` | no |
| <a name="input_create_adf"></a> [create\_adf](#input\_create\_adf) | set value Whether to create a adf or not | `bool` | `true` | no |
| <a name="input_create_adf"></a> [create\_adf](#input\_create\_adf) | Set value whether to create a Data Factory or not. | `bool` | `true` | no |
| <a name="input_git_integration"></a> [git\_integration](#input\_git\_integration) | Integrate a git repository with ADF. Can be null, github or vsts (use vsts for Azure DevOps Repos). | `string` | `"null"` | no |
| <a name="input_github_account_name"></a> [github\_account\_name](#input\_github\_account\_name) | Specifies the GitHub account name. | `string` | `"amido"` | no |
| <a name="input_github_url"></a> [github\_url](#input\_github\_url) | Specifies the GitHub Enterprise host name. For example: https://github.mydomain.com. Use https://github.com for open source repositories. | `string` | `"https://github.com"` | no |
| <a name="input_global_parameter"></a> [global\_parameter](#input\_global\_parameter) | Specifies whether to add global parameters to ADF | <pre>list(object({<br> name = string<br> type = string<br> value = string<br> }))</pre> | <pre>[<br> {<br> "name": "environment",<br> "type": "String",<br> "value": "nonprod"<br> }<br>]</pre> | no |
| <a name="input_identity_ids"></a> [identity\_ids](#input\_identity\_ids) | Specifies a list of User Assigned Managed Identity IDs to be assigned to this Data Factory. | `list(string)` | `[]` | no |
| <a name="input_identity_type"></a> [identity\_type](#input\_identity\_type) | Specifies the type of Managed Service Identity that should be configured on this Data Factory. Possible values are SystemAssigned, UserAssigned, SystemAssigned,UserAssigned (to enable both). | `string` | `"SystemAssigned"` | no |
| <a name="input_managed_virtual_network_enabled"></a> [managed\_virtual\_network\_enabled](#input\_managed\_virtual\_network\_enabled) | Is Managed Virtual Network enabled? | `bool` | `false` | no |
| <a name="input_name_component"></a> [name\_component](#input\_name\_component) | Component Name - should/will be used in conventional resource naming. Typically this will be a logical name for this part of the system i.e. `API` \|\| `middleware` or more generic like `Billing` | `string` | `"adf"` | no |
| <a name="input_public_network_enabled"></a> [public\_network\_enabled](#input\_public\_network\_enabled) | Is the Data Factory visible to the public network? Defaults to true | `bool` | `true` | no |
| <a name="input_repository_name"></a> [repository\_name](#input\_repository\_name) | Specifies the name of the git repository. | `string` | `"stacks-data-infrastructure"` | no |
| <a name="input_resource_group_location"></a> [resource\_group\_location](#input\_resource\_group\_location) | Location of Resource group | `string` | `"uksouth"` | no |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | name of resource group | `string` | n/a | yes |
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Name of resource group | `string` | n/a | yes |
| <a name="input_resource_namer"></a> [resource\_namer](#input\_resource\_namer) | User defined naming convention applied to all resources created as part of this module | `string` | n/a | yes |
| <a name="input_resource_tags"></a> [resource\_tags](#input\_resource\_tags) | Map of tags to be applied to all resources created as part of this module | `map(string)` | `{}` | no |
| <a name="input_root_folder"></a> [root\_folder](#input\_root\_folder) | Specifies the root folder within the repository. Set to / for the top level. | `string` | `"/adf_managed"` | no |
Expand Down
2 changes: 1 addition & 1 deletion azurerm/modules/azurerm-adf/example/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
resource_group_name = "tfstateresourcegroup"
storage_account_name = "tfstate"
container_name = "tfstate"
key = "newadf.terraform.tfstate"
key = "lates.terraform.tfstate"
}
}

Expand Down
12 changes: 12 additions & 0 deletions azurerm/modules/azurerm-adf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ resource "azurerm_data_factory" "example" {
}
}


#global parameter configuration
dynamic "global_parameter" {

for_each = { for i in var.global_parameter : i.name => i }
content {
name = global_parameter.key
type = global_parameter.value.type
value = global_parameter.value.value
}
}

tags = var.resource_tags
lifecycle {
ignore_changes = [
Expand Down
19 changes: 19 additions & 0 deletions azurerm/modules/azurerm-adf/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ variable "managed_virtual_network_enabled" {
description = "Is Managed Virtual Network enabled?"
}

###########################
# Global parameter for ADF SETTINGS
##########################


variable "global_parameter" {
type = list(object({
name = string
type = string
value = string
}))
description = "Specifies whether to add global parameters to ADF"
default = [{
name = "environment"
type = "String"
value = "nonprod"
}
]
}
###########################
# ADF GIT INTEGRATION SETTINGS
##########################
Expand Down