From 89d85caddf9fd5d631cc47fe825c4dad22c91e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Le=20Meur?= Date: Sun, 16 Jun 2024 22:16:18 +0200 Subject: [PATCH] feat: add `stats.jenkins.io` storage account and file share --- stats.jenkins.io.tf | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 stats.jenkins.io.tf diff --git a/stats.jenkins.io.tf b/stats.jenkins.io.tf new file mode 100644 index 00000000..f442da7f --- /dev/null +++ b/stats.jenkins.io.tf @@ -0,0 +1,37 @@ +resource "azurerm_resource_group" "stats_jenkins_io" { + name = "stats-jenkins-io" + location = var.location + tags = local.default_tags +} + +resource "azurerm_storage_account" "stats_jenkins_io" { + name = "statsjenkinsio" + resource_group_name = azurerm_resource_group.stats_jenkins_io.name + location = azurerm_resource_group.stats_jenkins_io.location + account_tier = "Standard" + account_replication_type = "ZRS" + account_kind = "StorageV2" + enable_https_traffic_only = true + min_tls_version = "TLS1_2" + + network_rules { + default_action = "Deny" + ip_rules = flatten(concat( + [for key, value in module.jenkins_infra_shared_data.admin_public_ips : value] + )) + virtual_network_subnet_ids = [ + data.azurerm_subnet.publick8s_tier.id, + data.azurerm_subnet.privatek8s_tier.id, # required for management from infra.ci (terraform) + data.azurerm_subnet.infra_ci_jenkins_io_sponsorship_ephemeral_agents.id, # infra.ci Azure VM agents + ] + bypass = ["AzureServices"] + } + + tags = local.default_tags +} + +resource "azurerm_storage_share" "stats_jenkins_io" { + name = "stats-jenkins-io" + storage_account_name = azurerm_storage_account.stats_jenkins_io.name + quota = 5 +}