Skip to content

Instantly share code, notes, and snippets.

@dilani14
dilani14 / main.tf
Last active September 29, 2020 14:21
App service slot
##################################
##### App Service Slot ###########
##################################
resource "azurerm_app_service_slot" "azuredemo-as-slot" {
count = var.environment == "prod" ? 1 : 0
name = "staging"
app_service_name = "azuredemo-as.name"
resource_group_name = "resource_group_name"
location = "resource_group_location"
app_service_plan_id = "app_service_plan_id"
@dilani14
dilani14 / main.tf
Last active September 28, 2020 16:53
App Service Plan
locals {
env-dev = var.environment == "dev"
}
#######################################
##### App Service Plan ################
#######################################
resource "azurerm_app_service_plan" "azuredemo-as-asp" {
name = "${var.environment}-${var.service}-asp"
resource_group_name = "resource_group_name"
@dilani14
dilani14 / main.tf
Created June 11, 2020 04:54
add new db
variable "location" {
type = string
default = "eastus"
}
provider "azurerm" {
version = 1.38
}
resource "azurerm_resource_group" "rg" {
@dilani14
dilani14 / main.tf
Last active June 6, 2020 17:15
state config
terraform {
backend "azurerm" {
resource_group_name = "dilani-tf-rg"
storage_account_name = "dilanitfsc"
container_name = "dilanitfcontainer"
key = "qa.tfstate"
}
}
@dilani14
dilani14 / main.tf
Created May 8, 2020 14:39
terraform configuration
variable "location" {
type = string
default = "eastus"
}
provider "azurerm" {
version = 1.38
}
resource "azurerm_resource_group" "rg" {
@dilani14
dilani14 / main.tf
Created April 27, 2020 17:32
deploy app service
resource "azurerm_app_service_plan" "serviceplan" {
name = "diltf-appserviceplan"
location = var.location
resource_group_name = azurerm_resource_group.rg.name
sku {
tier = "Standard"
size = "S1"
}
}
@dilani14
dilani14 / main.tf
Created April 27, 2020 16:11
sql database
resource "azurerm_sql_server" "sqlserver" {
name = "diltfsqlserver"
resource_group_name = azurerm_resource_group.rg.name
location = var.location
version = "12.0"
administrator_login = "diladmin"
administrator_login_password = "1qaz2wsx@"
}
@dilani14
dilani14 / main.tf
Created April 26, 2020 13:39
create rg
variable "location" {
type = string
default = "eastus"
}
provider "azurerm" {
}
resource "azurerm_resource_group" "rg" {
@dilani14
dilani14 / student-nested.js
Created February 4, 2020 07:30
nested destructuring array
let students = ['Bob', 'John', ['Steve', 'Daniel'], 'Philip'];
const [first, second, [third, fourth]] = students;
console.log(`Thrid and Fourth are : ${third} and ${fourth}`);
//output: Thrid and Fourth are : Steve and Daniel
@dilani14
dilani14 / student-rest.js
Created February 4, 2020 07:19
assigning rest of the array
let students = ['Bob', 'John', 'Steve', 'Daniel', 'Gorge', 'Philip'];
const [first, second, third, ...other] = students;
console.log('Students except 1st, 2nd, 3rd:',other);
// output: Students except 1st, 2nd, 3rd: (3) ["Daniel", "Gorge", "Philip"]