Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Nov 9, 2023
1 parent 629b0b2 commit ef32658
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 1 deletion.
5 changes: 5 additions & 0 deletions aks/terraform/infrastructure/_providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ provider "azurerm" {
tenant_id = "9c1de352-64a4-4509-b3fc-4ef2df8db9b8"
subscription_id = "1988b893-553c-4652-bd9b-52f089b21ead"
}

provider "azapi" {
tenant_id = "9c1de352-64a4-4509-b3fc-4ef2df8db9b8"
subscription_id = "1988b893-553c-4652-bd9b-52f089b21ead"
}
6 changes: 5 additions & 1 deletion aks/terraform/infrastructure/az_aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ resource "azurerm_kubernetes_cluster" "jok" {
image_cleaner_interval_hours = 48

maintenance_window_auto_upgrade {
utc_offset = "+00:00"
frequency = "Weekly"
duration = 6
interval = 1
Expand All @@ -97,6 +98,7 @@ resource "azurerm_kubernetes_cluster" "jok" {
}

maintenance_window_node_os {
utc_offset = "+00:00"
frequency = "Daily"
duration = 6
interval = 1
Expand All @@ -108,7 +110,7 @@ resource "azurerm_kubernetes_cluster" "jok" {
ebpf_data_plane = "cilium"
network_mode = "transparent"
network_policy = "cilium"
network_plugin_mode = "Overlay"
network_plugin_mode = "overlay"

outbound_type = "loadBalancer"
load_balancer_sku = "standard"
Expand Down Expand Up @@ -151,6 +153,8 @@ resource "azurerm_role_assignment" "jok" {
}

resource "azurerm_kubernetes_cluster_node_pool" "win" {
count = 0

kubernetes_cluster_id = azurerm_kubernetes_cluster.jok.id
name = "win"
vm_size = "Standard_A2_v2"
Expand Down
82 changes: 82 additions & 0 deletions aks/terraform/infrastructure/az_mail.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
resource "azurerm_communication_service" "this" {
name = "cm-jok"
resource_group_name = azurerm_resource_group.jok-default.name
data_location = "Europe"
}
*/




resource "azapi_resource" "communication_services" {
type = "Microsoft.Communication/communicationServices@2023-03-31"
name = "cm-jok"
location = "global"
parent_id = azurerm_resource_group.jok-default.id
tags = {}
body = jsonencode({
properties = {
dataLocation = "europe"
linkedDomains = [
azapi_resource.this.id
]
}
})

response_export_values = ["*"]
}

resource "azurerm_email_communication_service" "this" {
name = "mail-jok"
resource_group_name = azurerm_resource_group.jok-default.name
data_location = "Europe"
}

resource "azapi_resource" "this" {
type = "Microsoft.Communication/emailServices/domains@2023-03-31"
name = "AzureManagedDomain"
location = "global"
parent_id = azurerm_email_communication_service.this.id
tags = {}
body = jsonencode({
properties = {
domainManagement = "AzureManaged"
userEngagementTracking = "Disabled"
}
})

response_export_values = ["properties.mailFromSenderDomain"]
}

resource "azapi_resource" "mail_sender" {
type = "Microsoft.Communication/emailServices/domains/senderUsernames@2023-03-31"
name = "opsstack"
parent_id = azapi_resource.this.id
body = jsonencode({
properties = {
displayName = "Ops.Stack Monitoring"
username = "opsstack"
}
})
}

# data "azapi_resource_action" "mail_keys" {
# type = "Microsoft.Communication/CommunicationServices@2023-03-31"
# resource_id = azapi_resource.communication_services.id
# action = "listKeys"
# response_export_values = ["*"]
# }

output "domain" {
value = jsondecode(azapi_resource.this.output)
}

output "communication_services" {
value = jsondecode(azapi_resource.communication_services.output)
}

# output "mail_keys" {
# value = jsondecode(data.azapi_resource_action.mail_keys.output)
# }
# smtp.azurecomm.net

0 comments on commit ef32658

Please sign in to comment.