Skip to content

Commit

Permalink
Infra refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
koltyakov committed Mar 5, 2023
1 parent 74f7ce2 commit fd058c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
40 changes: 18 additions & 22 deletions infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,25 @@ make destroy
I tend to believe and prefer serverless options first approach. Also, I'd chose Linux on a server in all cases when it works.

```hcl
## functions.tf
## 03_functions.tf
# Service Plan
resource "azurerm_app_service_plan" "service_plan" {
name = "${var.function_app}_Plan"
# ...
kind = "FunctionApp" # Azure Functions
sku {
tier = "Dynamic" # Dynamic App Service Plan
size = "Y1" # Linux
}
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan
resource "azurerm_service_plan" "service_plan" {
name = var.function_app
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
os_type = "Linux"
sku_name = "Y1"
tags = var.tags
}
# Function App
resource "azurerm_function_app" "functions" {
# Functions App
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_function_app
resource "azurerm_linux_function_app" "functions" {
name = var.function_app
# ...
os_type = "linux" # Currently if omitted might lead to Functions App redeployment on each apply
version = "~3" # Latest Azure Functions version, required for Custom Handler support
app_settings = {
FUNCTIONS_WORKER_RUNTIME = "custom" # Custom Handler runtime
# ...
Expand All @@ -158,9 +154,9 @@ resource "azurerm_function_app" "functions" {
#### SharePoint bindings

```hcl
## functions.tf
## 03_functions.tf
resource "azurerm_function_app" "functions" {
resource "azurerm_linux_function_app" "functions" {
name = var.function_app
# ...
Expand Down Expand Up @@ -188,7 +184,7 @@ variable "sharepoint_clientid" {
variable "sharepoint_clientsecret" {
type = string
description = "SharePoint CLient Secret"
description = "SharePoint Client Secret"
}
## terraform.tfvars
Expand All @@ -201,9 +197,9 @@ sharepoint_clientsecret = "CgnihMbRphqR....7XLlZ/0QCgw="
#### Package deployment

```hcl
## functions.tf
## 03_functions.tf
resource "azurerm_function_app" "functions" {
resource "azurerm_linux_function_app" "functions" {
name = var.function_app
# ...
Expand All @@ -217,7 +213,7 @@ resource "azurerm_function_app" "functions" {
}
}
## storage.tf
## 02_storage.tf
resource "azurerm_storage_container" "deployments" {
# ...
Expand Down
2 changes: 1 addition & 1 deletion infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variable "sharepoint_clientid" {

variable "sharepoint_clientsecret" {
type = string
description = "SharePoint CLient Secret"
description = "SharePoint Client Secret"
}

# Custom handlers package
Expand Down

0 comments on commit fd058c0

Please sign in to comment.