|
| 1 | +terraform { |
| 2 | + required_providers { |
| 3 | + azurerm = { |
| 4 | + source = "hashicorp/azurerm" |
| 5 | + version = "~>3.110.0" |
| 6 | + } |
| 7 | + } |
| 8 | + |
| 9 | + # backend "azurerm" { |
| 10 | + # resource_group_name = "frontendfestival" |
| 11 | + # storage_account_name = "storage-account" |
| 12 | + # container_name = "tfstate" |
| 13 | + # key = "prod.terraform.tfstate" |
| 14 | + # } |
| 15 | +} |
| 16 | + |
| 17 | +provider "azurerm" { |
| 18 | + skip_provider_registration = true |
| 19 | + features {} |
| 20 | +} |
| 21 | + |
| 22 | +resource "azurerm_resource_group" "frontendfestival" { |
| 23 | + name = "frontendfestival" |
| 24 | + location = "westeurope" |
| 25 | + tags = { |
| 26 | + environment = "production" |
| 27 | + source = "Terraform" |
| 28 | + contact = "Roderick Huijgen <roderick.huijgen@ordina.nl>" |
| 29 | + technical-contact = "Robbin Schepers <robbin.schepers@ordina.nl>" |
| 30 | + } |
| 31 | +} |
| 32 | + |
| 33 | +resource "azurerm_service_plan" "frontendfestival" { |
| 34 | + name = "frontendfestival" |
| 35 | + resource_group_name = azurerm_resource_group.frontendfestival.name |
| 36 | + location = azurerm_resource_group.frontendfestival.location |
| 37 | + os_type = "Linux" |
| 38 | + sku_name = "P0v3" |
| 39 | +} |
| 40 | + |
| 41 | +resource "azurerm_linux_web_app" "frontendfestival" { |
| 42 | + name = "frontendfestival" |
| 43 | + resource_group_name = azurerm_resource_group.frontendfestival.name |
| 44 | + location = azurerm_service_plan.frontendfestival.location |
| 45 | + service_plan_id = azurerm_service_plan.frontendfestival.id |
| 46 | + |
| 47 | + https_only = true |
| 48 | + |
| 49 | + site_config { |
| 50 | + always_on = false |
| 51 | + http2_enabled = true |
| 52 | + |
| 53 | + application_stack { |
| 54 | + node_version = "20-lts" |
| 55 | + } |
| 56 | + } |
| 57 | +} |
| 58 | + |
| 59 | +resource "azurerm_app_service_custom_hostname_binding" "frontendfestival" { |
| 60 | + hostname = "frontendfestival.nl" |
| 61 | + app_service_name = azurerm_linux_web_app.frontendfestival.name |
| 62 | + resource_group_name = azurerm_resource_group.frontendfestival.name |
| 63 | +} |
| 64 | + |
| 65 | +resource "azurerm_app_service_managed_certificate" "frontendfestival" { |
| 66 | + custom_hostname_binding_id = azurerm_app_service_custom_hostname_binding.frontendfestival.id |
| 67 | +} |
| 68 | + |
| 69 | +resource "azurerm_app_service_certificate_binding" "frontendfestival" { |
| 70 | + hostname_binding_id = azurerm_app_service_custom_hostname_binding.frontendfestival.id |
| 71 | + certificate_id = azurerm_app_service_managed_certificate.frontendfestival.id |
| 72 | + ssl_state = "SniEnabled" |
| 73 | +} |
| 74 | + |
| 75 | +resource "azurerm_app_service_source_control" "frontendfestival" { |
| 76 | + app_id = azurerm_linux_web_app.frontendfestival.id |
| 77 | + repo_url = "https://github.com/Ordina-Group/frontendfestival.nl" |
| 78 | + branch = "main" |
| 79 | +} |
0 commit comments