-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
50 lines (42 loc) · 1.03 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 2.26"
}
}
backend "azurerm" {
resource_group_name = "tf_rg_blobstore"
storage_account_name = "tfdevopslabstorage1"
container_name = "tfstate"
key = "terraform.tfstate"
}
}
provider "azurerm" {
features {}
}
variable "imagebuild" {
description = "Latest Image Build Number"
}
resource "azurerm_resource_group" "tf_test_rg" {
name = "tfmainrg"
location = "eastus"
}
resource "azurerm_container_group" "tfcg_test" {
name = "weatherapi"
location = azurerm_resource_group.tf_test_rg.location
resource_group_name = azurerm_resource_group.tf_test_rg.name
ip_address_type = "public"
dns_name_label = "joshmurariweatherapp"
os_type = "Linux"
container {
name = "weatherapi"
image = "joshmurari/weatherapi:${var.imagebuild}"
cpu = "1"
memory = "1"
ports {
port = 80
protocol = "TCP"
}
}
}