SHARE
TWEET

Untitled

a guest Apr 2nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. provider "azurerm" {
  2.     version = "=1.22.0"
  3. }
  4.  
  5. terraform {
  6.   backend "azurerm" {
  7.     resource_group_name = "ListApp-General"
  8.     storage_account_name = "listapptfstatestorage"
  9.     container_name = "tfstate"
  10.     key = "listapp-feedservice"
  11.   }
  12. }
  13.  
  14. variable "container_id" {
  15.   type = "string"
  16. }
  17.  
  18. data "azurerm_resource_group" "general" {
  19.   name = "ListApp-General"
  20. }
  21.  
  22. data "azurerm_container_registry" "general" {
  23.   name = "ListAppRegistry"
  24.   resource_group_name = "${data.azurerm_resource_group.general.name}"
  25. }
  26.  
  27. resource "azurerm_app_service_plan" "general" {
  28.   name = "PreProd_ConsumptionPlan"
  29.   location = "${data.azurerm_resource_group.general.location}"
  30.   resource_group_name = "${data.azurerm_resource_group.general.name}"
  31.   kind = "Linux"
  32.   reserved = true
  33.   sku {
  34.     tier = "Basic"
  35.     size = "B1"
  36.   }
  37. }
  38.  
  39. resource "azurerm_resource_group" "feed" {
  40.     name = "ListApp-FeedService"
  41.     location = "Central  US"
  42. }
  43.  
  44. resource "azurerm_app_service" "feed" {
  45.   name                = "feedservice-dev"
  46.   location            = "${azurerm_resource_group.feed.location}"
  47.   resource_group_name = "${azurerm_resource_group.feed.name}"
  48.   app_service_plan_id = "${azurerm_app_service_plan.general.id}"
  49.  
  50.   app_settings {
  51.     WEBSITES_ENABLE_APP_SERVICE_STORAGE = false
  52.     DOCKER_REGISTRY_SERVER_URL = "${data.azurerm_container_registry.general.login_server}"
  53.     DOCKER_REGISTRY_SERVER_USERNAME = "${data.azurerm_container_registry.general.admin_username}"
  54.     DOCKER_REGISTRY_SERVER_PASSWORD = "${data.azurerm_container_registry.general.admin_password}"
  55.     ASPNETCORE_ENVIRONMENT = "Development"
  56.   }
  57.  
  58.   site_config {
  59.     linux_fx_version = "DOCKER|${data.azurerm_container_registry.general.login_server}/feedservice:${var.container_id}"
  60.     always_on = "true"
  61.   }
  62.  
  63.   identity {
  64.     type = "SystemAssigned"
  65.   }
  66. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top