-
Notifications
You must be signed in to change notification settings - Fork 1
feat: TT-509 Use terraform to provision ui infraestructure #819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
62d569b
72cf8f7
a458f98
bf8977e
3fe4e5e
6cc64e6
4ee7c37
482bfb1
3e614fd
483cf6a
a4b8426
429c008
24d7f40
3bee7e3
4c48be4
98d092c
454b7f9
ac17c44
0b48625
da50b7a
82e6dea
97b6435
8993fbc
9c33cee
33096b5
37e64ee
e0dc5f7
df9071c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,3 +55,6 @@ Thumbs.db | |
|
|
||
| #ENV VARIABLES | ||
| .env | ||
|
|
||
| # Terraform files | ||
| **/.terraform** | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| terraform { | ||
| required_version = "~> 1.1.2" | ||
| required_providers { | ||
| azurerm = { | ||
| source = "hashicorp/azurerm" | ||
| version = "~> 2.90" | ||
| } | ||
| } | ||
|
|
||
| backend "azurerm" { | ||
| resource_group_name = "ioet-infra-tf-state" | ||
| storage_account_name = "timetrackertfstate" | ||
| container_name = "time-tracker-tf-state" | ||
| key = "time-tracker-ui.tfstate" | ||
| } | ||
|
|
||
| } | ||
|
|
||
| provider "azurerm" { | ||
| features {} | ||
| skip_provider_registration = true | ||
| } | ||
|
|
||
| data "terraform_remote_state" "service" { | ||
| backend = "azurerm" | ||
| workspace = terraform.workspace | ||
| config = { | ||
| resource_group_name = "ioet-infra-tf-state" | ||
| storage_account_name = "timetrackertfstate" | ||
| container_name = "time-tracker-tf-state" | ||
| key = "this.tfstate" | ||
| } | ||
| } | ||
|
|
||
| data "azurerm_container_registry" "registry" { | ||
|
||
| name = data.terraform_remote_state.service.outputs.container_registry_name | ||
| resource_group_name = data.terraform_remote_state.service.outputs.resource_group_name | ||
| } | ||
|
|
||
| data "azurerm_resource_group" "root" { | ||
| name = data.terraform_remote_state.service.outputs.resource_group_name | ||
|
||
| } | ||
|
|
||
| locals { | ||
| common_name = "time-tracker-ui" | ||
| environment = terraform.workspace | ||
| service_name = "${local.common_name}-${local.environment}" | ||
| create_app_service_plan = true | ||
faustocv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| service_plan_kind = "Linux" | ||
| } | ||
|
|
||
| module "ui" { | ||
faustocv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| source = "[email protected]:ioet/infra-terraform-modules.git//azure-app-service?ref=tags/v0.0.5" | ||
| app_service_name = local.service_name | ||
| create_app_service_plan = local.create_app_service_plan | ||
| docker_image_name = var.docker_image_name | ||
| docker_image_namespace = data.azurerm_container_registry.registry.login_server | ||
| docker_registry_password = data.azurerm_container_registry.registry.admin_password | ||
| docker_registry_url = data.azurerm_container_registry.registry.login_server | ||
| docker_registry_username = data.azurerm_container_registry.registry.admin_username | ||
| location = data.azurerm_resource_group.root.location | ||
| resource_group_name = data.azurerm_resource_group.root.name | ||
| service_plan_kind = local.service_plan_kind | ||
| service_plan_name = local.service_name | ||
| service_plan_size = var.service_plan_size | ||
| service_plan_tier = var.service_plan_tier | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| service_plan_size = "S1" | ||
| service_plan_tier = "Standard" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| service_plan_size = "S1" | ||
| service_plan_tier = "Standard" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| variable "docker_image_name" { | ||
|
||
| type = string | ||
| description = "Specifies the docker image name that is stored in a private container registry like ACR (Azure Container Registry)." | ||
| sensitive = true | ||
| } | ||
|
|
||
| variable "service_plan_size" { | ||
| default = "S1" | ||
| type = string | ||
| description = "Specifies the size of the service plan. This variable format is: Tier (letter) + Size (number). Size could be: 1 = Small (1 Core 1.75GB RAM), 2 = Medium (2 Core 3.5 GB RAM), 3 = Large (4 Core 7GB RAM)" | ||
| } | ||
|
|
||
| variable "service_plan_tier" { | ||
| default = "Standard" | ||
| type = string | ||
| description = "Specifies the tier of the service plan. Tier is the pricing plan of the service plan resource." | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is not needed anymore you can delete it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Could your add a FIXME statement explaining why this has been commented out?