Skip to content

Commit e37264c

Browse files
committed
Add Azure modules: introduce log analytics workspace ID input and output specifications in AKS and base modules, enhance key vault configurations, and implement PostgreSQL logging configurations for improved monitoring and security.
1 parent 7805594 commit e37264c

File tree

21 files changed

+223
-116
lines changed

21 files changed

+223
-116
lines changed

docs/references/modules/azure_aks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ No modules.
4040
| <a name="input_env_name"></a> [env\_name](#input\_env\_name) | Env name | `string` | n/a | yes |
4141
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | n/a | `string` | `"1.21.9"` | no |
4242
| <a name="input_layer_name"></a> [layer\_name](#input\_layer\_name) | Layer name | `string` | n/a | yes |
43+
| <a name="input_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#input\_log\_analytics\_workspace\_id) | n/a | `string` | n/a | yes |
4344
| <a name="input_max_nodes"></a> [max\_nodes](#input\_max\_nodes) | n/a | `number` | `5` | no |
4445
| <a name="input_min_nodes"></a> [min\_nodes](#input\_min\_nodes) | n/a | `number` | `1` | no |
4546
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | Module name | `string` | n/a | yes |

docs/references/modules/azure_base.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,42 @@ No modules.
1919
| Name | Type |
2020
|------|------|
2121
| [azurerm_container_registry.acr](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/container_registry) | resource |
22-
| [azurerm_key_vault.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault) | resource |
22+
| [azurerm_key_vault.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault) | resource |
2323
| [azurerm_key_vault_key.acr](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key) | resource |
2424
| [azurerm_log_analytics_workspace.watcher](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/log_analytics_workspace) | resource |
2525
| [azurerm_monitor_diagnostic_setting.infra_logging](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_diagnostic_setting) | resource |
26-
| [azurerm_nat_gateway.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway) | resource |
27-
| [azurerm_nat_gateway_public_ip_association.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway_public_ip_association) | resource |
28-
| [azurerm_nat_gateway_public_ip_prefix_association.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway_public_ip_prefix_association) | resource |
29-
| [azurerm_network_security_group.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | resource |
26+
| [azurerm_nat_gateway.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway) | resource |
27+
| [azurerm_nat_gateway_public_ip_association.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway_public_ip_association) | resource |
28+
| [azurerm_nat_gateway_public_ip_prefix_association.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/nat_gateway_public_ip_prefix_association) | resource |
29+
| [azurerm_network_security_group.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) | resource |
3030
| [azurerm_network_security_rule.allowoutbound](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | resource |
3131
| [azurerm_network_security_rule.internal](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_rule) | resource |
3232
| [azurerm_network_watcher_flow_log.vpc_flow_log](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_watcher_flow_log) | resource |
33-
| [azurerm_public_ip.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip) | resource |
34-
| [azurerm_public_ip_prefix.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip_prefix) | resource |
33+
| [azurerm_public_ip.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip) | resource |
34+
| [azurerm_public_ip_prefix.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/public_ip_prefix) | resource |
3535
| [azurerm_role_assignment.acr_encryption](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment) | resource |
3636
| [azurerm_storage_account.infra_logging](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/storage_account) | resource |
37-
| [azurerm_subnet.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource |
38-
| [azurerm_subnet_nat_gateway_association.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_nat_gateway_association) | resource |
39-
| [azurerm_subnet_network_security_group_association.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_network_security_group_association) | resource |
37+
| [azurerm_subnet.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource |
38+
| [azurerm_subnet_nat_gateway_association.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_nat_gateway_association) | resource |
39+
| [azurerm_subnet_network_security_group_association.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_network_security_group_association) | resource |
4040
| [azurerm_user_assigned_identity.acr_uai](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/user_assigned_identity) | resource |
41-
| [azurerm_virtual_network.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) | resource |
41+
| [azurerm_virtual_network.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) | resource |
4242
| [random_id.acr_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
4343
| [random_id.key_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
4444
| [random_id.logging_suffix](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
4545
| [azurerm_network_watcher.default](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/network_watcher) | data source |
46-
| [azurerm_resource_group.opta](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
46+
| [azurerm_resource_group.pltf](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source |
4747
| [azurerm_subscription.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subscription) | data source |
4848

4949
## Inputs
5050

5151
| Name | Description | Type | Default | Required |
5252
|------|-------------|------|---------|:--------:|
5353
| <a name="input_env_name"></a> [env\_name](#input\_env\_name) | Env name | `string` | n/a | yes |
54+
| <a name="input_key_vault_ip_rules"></a> [key\_vault\_ip\_rules](#input\_key\_vault\_ip\_rules) | n/a | `list(string)` | `[]` | no |
55+
| <a name="input_key_vault_key_expiration_date"></a> [key\_vault\_key\_expiration\_date](#input\_key\_vault\_key\_expiration\_date) | n/a | `string` | `"2035-01-01T00:00:00Z"` | no |
56+
| <a name="input_key_vault_soft_delete_retention_days"></a> [key\_vault\_soft\_delete\_retention\_days](#input\_key\_vault\_soft\_delete\_retention\_days) | n/a | `number` | `90` | no |
57+
| <a name="input_key_vault_subnet_ids"></a> [key\_vault\_subnet\_ids](#input\_key\_vault\_subnet\_ids) | n/a | `list(string)` | `[]` | no |
5458
| <a name="input_layer_name"></a> [layer\_name](#input\_layer\_name) | Layer name | `string` | n/a | yes |
5559
| <a name="input_location"></a> [location](#input\_location) | n/a | `string` | n/a | yes |
5660
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | Module name | `string` | n/a | yes |
@@ -64,6 +68,7 @@ No modules.
6468
| <a name="output_acr_id"></a> [acr\_id](#output\_acr\_id) | n/a |
6569
| <a name="output_acr_login_url"></a> [acr\_login\_url](#output\_acr\_login\_url) | n/a |
6670
| <a name="output_acr_name"></a> [acr\_name](#output\_acr\_name) | n/a |
71+
| <a name="output_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#output\_log\_analytics\_workspace\_id) | n/a |
6772
| <a name="output_private_subnet_id"></a> [private\_subnet\_id](#output\_private\_subnet\_id) | n/a |
6873
| <a name="output_private_subnet_name"></a> [private\_subnet\_name](#output\_private\_subnet\_name) | n/a |
6974
| <a name="output_public_nat_ips"></a> [public\_nat\_ips](#output\_public\_nat\_ips) | n/a |

docs/references/modules/azure_postgres.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ No modules.
1818

1919
| Name | Type |
2020
|------|------|
21+
| [azurerm_postgresql_configuration.connection_throttling](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |
22+
| [azurerm_postgresql_configuration.log_checkpoints](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |
23+
| [azurerm_postgresql_configuration.log_connections](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |
2124
| [azurerm_postgresql_configuration.log_disconnections](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |
2225
| [azurerm_postgresql_configuration.log_duration](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |
2326
| [azurerm_postgresql_configuration.log_retention_days](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/postgresql_configuration) | resource |

modules/azure_aks/aks.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ resource "azurerm_kubernetes_cluster" "main" {
6262
dns_prefix = "pltf"
6363
// disk_encryption_set_id = azurerm_disk_encryption_set.pltf.id
6464
kubernetes_version = var.kubernetes_version
65+
role_based_access_control_enabled = true
6566

6667
network_profile {
6768
network_plugin = "azure"
@@ -78,6 +79,10 @@ resource "azurerm_kubernetes_cluster" "main" {
7879
admin_group_object_ids = var.admin_group_object_ids
7980
}
8081

82+
oms_agent {
83+
log_analytics_workspace_id = var.log_analytics_workspace_id
84+
}
85+
8186
default_node_pool {
8287
name = "default"
8388
node_count = var.min_nodes
@@ -113,4 +118,4 @@ resource "azurerm_kubernetes_cluster" "main" {
113118
azurerm_role_assignment.k8s_assign_identities,
114119
azurerm_role_assignment.azurerm_container_registry_agent_pool
115120
]
116-
}
121+
}

modules/azure_aks/azure_aks.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ No modules.
4040
| <a name="input_env_name"></a> [env\_name](#input\_env\_name) | Env name | `string` | n/a | yes |
4141
| <a name="input_kubernetes_version"></a> [kubernetes\_version](#input\_kubernetes\_version) | n/a | `string` | `"1.21.9"` | no |
4242
| <a name="input_layer_name"></a> [layer\_name](#input\_layer\_name) | Layer name | `string` | n/a | yes |
43+
| <a name="input_log_analytics_workspace_id"></a> [log\_analytics\_workspace\_id](#input\_log\_analytics\_workspace\_id) | n/a | `string` | n/a | yes |
4344
| <a name="input_max_nodes"></a> [max\_nodes](#input\_max\_nodes) | n/a | `number` | `5` | no |
4445
| <a name="input_min_nodes"></a> [min\_nodes](#input\_min\_nodes) | n/a | `number` | `1` | no |
4546
| <a name="input_module_name"></a> [module\_name](#input\_module\_name) | Module name | `string` | n/a | yes |

modules/azure_aks/module.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ inputs:
4040
name: layer_name
4141
required: true
4242
type: string
43+
- name: log_analytics_workspace_id
44+
required: true
45+
type: string
4346
- default: 5
4447
name: max_nodes
4548
required: false

modules/azure_aks/variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ variable "admin_group_object_ids" {
6363
default = []
6464
}
6565

66+
variable "log_analytics_workspace_id" {
67+
type = string
68+
}
69+
6670
variable "node_instance_type" {
6771
type = string
6872
default = "Standard_D2_v2"
@@ -76,4 +80,4 @@ variable "service_cidr" {
7680
variable "dns_service_ip" {
7781
type = string
7882
default = "10.0.128.10"
79-
}
83+
}

modules/azure_base/acr.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ resource "random_id" "acr_suffix" {
33
}
44

55
resource "azurerm_container_registry" "acr" {
6-
name = "opta${random_id.acr_suffix.hex}"
7-
location = data.azurerm_resource_group.opta.location
8-
resource_group_name = data.azurerm_resource_group.opta.name
6+
name = "pltf${random_id.acr_suffix.hex}"
7+
location = data.azurerm_resource_group.pltf.location
8+
resource_group_name = data.azurerm_resource_group.pltf.name
99
sku = "Premium"
1010

1111
identity {
@@ -26,13 +26,13 @@ resource "azurerm_container_registry" "acr" {
2626
}
2727

2828
resource "azurerm_user_assigned_identity" "acr_uai" {
29-
location = data.azurerm_resource_group.opta.location
30-
resource_group_name = data.azurerm_resource_group.opta.name
29+
location = data.azurerm_resource_group.pltf.location
30+
resource_group_name = data.azurerm_resource_group.pltf.name
3131
name = "registry-uai"
3232
}
3333

3434
resource "azurerm_role_assignment" "acr_encryption" {
35-
scope = azurerm_key_vault.opta.id
35+
scope = azurerm_key_vault.pltf.id
3636
role_definition_name = "Key Vault Crypto Service Encryption User"
3737
principal_id = azurerm_user_assigned_identity.acr_uai.principal_id
3838
}

0 commit comments

Comments
 (0)