SlideShare a Scribd company logo
1 of 24
Download to read offline
Infrastructure as Code for Azure:
ARM or Terraform?
• What is “Infrastructure as Code”
• Resource group patterns
• ARM template structure
• Demo: Deploying Infrastructure using ARM + PowerShell
• What is terraform
• Terraform code lifecycle
• Demo: Plan and apply terraform configuration
• Q+A
Agenda
Infrastructure as Code evolved to solve the problem of environment
drift in the release pipeline. Without IaC, teams must maintain the settings
of individual deployment environments. Over time, each environment
becomes a snowflake, that is, a unique configuration that cannot be
reproduced automatically. Inconsistency among environments leads to
issues during deployments. With snowflakes, administration and
maintenance of infrastructure involves manual processes which were hard
to track and contributed to errors.
Infrastructure as Code
• Azure Portal
• ARM Templates + Powershell/Azure CLI
• Custom usage of REST API (use any type of sdk)
• Terraform
Deploying Infrastructure to Azure
• Resource Group – logically grouped collection of entities that usually share a common lifecycle
• Resource Manager Template - declarative JSON file that defines the goal state of a deployment
• Deployment - operation which tracks execution of a Resource Manager template
• Parameters - values provided by the user executing the deployment to customize deployed resources
• Parameter file - JSON file that stores parameter names and values
• API Version – used for versioning and backward compatibility
CONCEPTS
AZURE RESOURCE MANAGEMENT (ARM)
• Resources can be organized in a Resource Group, a logical container.
• Resource can belong to only one Resource Group. Nested resource groups are not supported.
• All Azure Services belongs to certain Resource Type.
• Resource has common fields and provider specific properties.
• Work with Azure Services as with REST Web Services Resources (CRUD).
• You can clarify billing for your organization by viewing the rolled-up costs for the entire group.
CLOUD SERVICES AS REST RESOURCE
AZURE RESOURCE MANAGEMENT (ARM) API
RESOURCE GROUP PATTERNS - APPLICATION
Resource Group
as
Container for
Application Resources
Backend Server 01 Backend Server 02
VHD
VHD
Backend Subnet
Backend Resource Group Frontend Resource Group
Frontend Server 01 Frontend Server 02
VHD
VHD
Frontend Subnet
RESOURCE GROUP PATTERNS - ENVIRONMENT
Resource Group
as
Container for
System Environment
Backend Servers
VHD VHD
Virtual Network
Development Environment
Virtual Network
Frontend Servers Backend Servers
VHD VHD
QA Environment
Frontend Servers
Element Required Description
$schema Yes Location of the JSON schema file.
contentVersion Yes Version of the template.
parameters No Values provided during deployment execution.
variables No Internal variables
resources Yes Azure services deployed or updated in a resource group
outputs No Values that are returned after deployment
EASY PROVISIONING - RESOURCE TEMPLATE
Function Syntax
concat concat (arg1, arg2, arg3, ...)
replace replace(originalString, oldCharacter, newCharacter)
base64 base64 (inputString)
padLeft padLeft(stringToPad, totalLength, paddingCharacter)
toLower toLower(stringToChange)
toUpper toUpper(stringToChange)
TEMPLATE EXPRESSION AND FUNCTIONS - STRINGS
Function Description Syntax
listKeys Returns the keys of a
storage account.
listKeys (resourceName or
resourceIdentifier, [apiVersion])
reference Used in depends on
section of resource
reference (resourceName or
resourceIdentifier, [apiVersion])
resourceGroup Returns current resource
group
resourceGroup()
resourceId Returns the unique
identifier of a resource
resourceId ([resourceGroupName],
resourceType, resourceName1,
[resourceName2]...)
subscription Returns subscription
details
subscription()
TEMPLATE EXPRESSION AND FUNCTIONS - OTHER
Deploying Infrastructure using ARM
Demo
https://bit.ly/2EZch0b
https://github.com/serhiiabanichev/GAB2018
Git URL
What is terraform
Terraform is a tool for building, changing, and versioning
infrastructure safely and efficiently. Terraform can manage existing and
popular service providers as well as custom in-house solutions.
Configuration files describe to Terraform the components needed to
run a single application or your entire datacenter. Terraform generates an
execution plan describing what it will do to reach the desired state, and
then executes it to build the described infrastructure. As the configuration
changes, Terraform is able to determine what changed and create
incremental execution plans which can be applied.
Terraform lifecycle
Azure Azure
Configuration
HCL (HashiCorp Configuration Language) is a configuration language built by
HashiCorp. The goal of HCL is to build a structured configuration language that is both human
and machine friendly for use with command-line tools, but specifically targeted towards
DevOps tools, servers, etc.
The set of files used to describe infrastructure in Terraform is simply known as a
Terraform configuration.
provider "azurerm" {
subscription_id = "f7424aaf-****-****-****-*********"
client_id = "c404e1a2-****-****-****-*********"
client_secret = "************"
tenant_id = "b41b72d-****-****-****-*********"
}
# Create a Resource Group
resource "azurerm_resource_group" "main" {
name = "${var.resource_group}"
location = "${var.location}"
}
Initialization
The first command to run for a new configuration - or after checking out an existing
configuration from version control - is terraform init, which initializes various local
settings and data that will be used by subsequent commands.
Terraform uses a plugin based architecture to support the numerous infrastructure and
service providers available. As of Terraform version 0.10.0, each "Provider" is its own
encapsulated binary distributed separately from Terraform itself. The terraform
init command will automatically download and install any Provider binary for the providers
in use within the configuration, which in this case is just the azurerm provider:
c:GAB2018TF> terraform init
Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
- Downloading plugin for provider "azurerm" (1.3.3)...
The following providers do not have any version constraints in configuration,
so the latest version was installed.
* provider.azurerm: version = "~> 1.3"
Terraform has been successfully initialized!
Plan changes
c:GAB2018TF> terraform plan -out=GAB
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
<= read (data resources)
Terraform will perform the following actions:…….
The terraform plan command is used to create an execution plan. Terraform
performs a refresh, unless explicitly disabled, and then determines what actions are necessary to
achieve the desired state specified in the configuration files.
This command is a convenient way to check whether the execution plan for a set of
changes matches your expectations without making any changes to real resources or to the
state. For example, terraform plan might be run before committing a change to version control,
to create confidence that it will behave as expected.
Apply configuration
c:GAB2018TF>terraform apply "GAB„
azurerm_resource_group.main: Creating...
location: "" => "eastus"
name: "" => "GAB-TF"
tags.%: "" => "<computed>"
azurerm_resource_group.main: Creation complete after 2s (ID: /subscriptions/f7424*********)
azurerm_virtual_network.main: Creating...
address_space.#: "" => "1"
address_space.0: "" => "12.0.0.0/24"
location: "" => "eastus"
name: "" => "GAB-TF-vnet"
resource_group_name: "" => "GAB-TF"
subnet.#: "" => "<computed>"
tags.%: "" => "<computed>"
azurerm_public_ip.main: Creating...
The terraform apply command is used to apply the changes required to reach the
desired state of the configuration, or the pre-determined set of actions generated by
a terraform plan execution plan.
Apply configuration
c:GAB2018TF>terraform apply "GAB„
azurerm_resource_group.main: Creating...
location: "" => "eastus"
name: "" => "GAB-TF"
tags.%: "" => "<computed>"
azurerm_resource_group.main: Creation complete after 2s (ID: /subscriptions/f7424*********)
azurerm_virtual_network.main: Creating...
address_space.#: "" => "1"
address_space.0: "" => "12.0.0.0/24"
location: "" => "eastus"
name: "" => "GAB-TF-vnet"
resource_group_name: "" => "GAB-TF"
subnet.#: "" => "<computed>"
tags.%: "" => "<computed>"
azurerm_public_ip.main: Creating...
The terraform apply command is used to apply the changes required to reach the
desired state of the configuration, or the pre-determined set of actions generated by
a terraform plan execution plan.
Plan and apply terraform configuration
Demo
Pros and Cons
Great implementation of Infrastructure
as Code concept.
Declarative syntax
Ability to "plan" and "apply" configs.
Apply actually executes the changes.
Supports various cloud providers
Uses it's own DSL called the Hashicorp
Configuration Language
State files store secrets in plain text which is a
bad idea when you push it to version-control.
Product is still maturing and there are some
design limitation
CONTACT ME
serhii_abanichev@epam.com
serhii_abanichev
serhii_abanichev
sergej.abanichev

More Related Content

What's hot

Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowAnton Babenko
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Amazon Web Services
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as CodePradeep Bhadani
 
Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019Anton Babenko
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To TerraformSasitha Iresh
 
Best Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformBest Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformDevOps.com
 
Microsoft Azure IaaS and Terraform
Microsoft Azure IaaS and TerraformMicrosoft Azure IaaS and Terraform
Microsoft Azure IaaS and TerraformAlex Mags
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices Nebulaworks
 
Terraform infraestructura como código
Terraform infraestructura como códigoTerraform infraestructura como código
Terraform infraestructura como códigoVictor Adsuar
 
Infrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformInfrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformAdin Ermie
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeWinWire Technologies Inc
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Janusz Nowak
 
Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Anton Babenko
 
Azure Infrastructure as Code and Hashicorp Terraform
Azure Infrastructure as Code and Hashicorp TerraformAzure Infrastructure as Code and Hashicorp Terraform
Azure Infrastructure as Code and Hashicorp TerraformAlex Mags
 

What's hot (20)

Terraform
TerraformTerraform
Terraform
 
Building infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps KrakowBuilding infrastructure as code using Terraform - DevOps Krakow
Building infrastructure as code using Terraform - DevOps Krakow
 
Terraform
TerraformTerraform
Terraform
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
Terraform: Infrastructure as Code
Terraform: Infrastructure as CodeTerraform: Infrastructure as Code
Terraform: Infrastructure as Code
 
Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019Terraform Best Practices - DevOps Unicorns 2019
Terraform Best Practices - DevOps Unicorns 2019
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To Terraform
 
Best Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with TerraformBest Practices of Infrastructure as Code with Terraform
Best Practices of Infrastructure as Code with Terraform
 
Microsoft Azure IaaS and Terraform
Microsoft Azure IaaS and TerraformMicrosoft Azure IaaS and Terraform
Microsoft Azure IaaS and Terraform
 
Terraform
TerraformTerraform
Terraform
 
A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices A Hands-on Introduction on Terraform Best Concepts and Best Practices
A Hands-on Introduction on Terraform Best Concepts and Best Practices
 
Terraform infraestructura como código
Terraform infraestructura como códigoTerraform infraestructura como código
Terraform infraestructura como código
 
Terraform Basics
Terraform BasicsTerraform Basics
Terraform Basics
 
Infrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using TerraformInfrastructure-as-Code (IaC) using Terraform
Infrastructure-as-Code (IaC) using Terraform
 
Getting Started with Infrastructure as Code
Getting Started with Infrastructure as CodeGetting Started with Infrastructure as Code
Getting Started with Infrastructure as Code
 
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
Continues Integration and Continuous Delivery with Azure DevOps - Deploy Anyt...
 
Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018Terraform modules and best-practices - September 2018
Terraform modules and best-practices - September 2018
 
Azure Infrastructure as Code and Hashicorp Terraform
Azure Infrastructure as Code and Hashicorp TerraformAzure Infrastructure as Code and Hashicorp Terraform
Azure Infrastructure as Code and Hashicorp Terraform
 
Introduce to Terraform
Introduce to TerraformIntroduce to Terraform
Introduce to Terraform
 

Similar to Infrastructure as Code for Azure: ARM or Terraform?

Deploy resources on Azure using IaC (Azure Terraform)
Deploy  resources on Azure using IaC (Azure Terraform)Deploy  resources on Azure using IaC (Azure Terraform)
Deploy resources on Azure using IaC (Azure Terraform)George Grammatikos
 
RIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxRIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxMrJustbis
 
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)Adin Ermie
 
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfTamir Dresher
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your TeamGR8Conf
 
Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Giulio Vian
 
Practical advice on deployment and management of enterprise workloads
Practical advice on deployment and management of enterprise workloadsPractical advice on deployment and management of enterprise workloads
Practical advice on deployment and management of enterprise workloadsJarek Miszczyk
 
Terraform vs Pulumi
Terraform vs PulumiTerraform vs Pulumi
Terraform vs PulumiHoaiNam307
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source Nitesh Jadhav
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformPedro J. Molina
 
TechnicalTerraformLandingZones121120229238.pdf
TechnicalTerraformLandingZones121120229238.pdfTechnicalTerraformLandingZones121120229238.pdf
TechnicalTerraformLandingZones121120229238.pdfMIlton788007
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformTim Berry
 
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime FabricSurat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime FabricJitendra Bafna
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015Oro Inc.
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Joel W. King
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platformnirajrules
 
Debasihish da final.ppt
Debasihish da final.pptDebasihish da final.ppt
Debasihish da final.pptKalkey
 

Similar to Infrastructure as Code for Azure: ARM or Terraform? (20)

Deploy resources on Azure using IaC (Azure Terraform)
Deploy  resources on Azure using IaC (Azure Terraform)Deploy  resources on Azure using IaC (Azure Terraform)
Deploy resources on Azure using IaC (Azure Terraform)
 
RIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptxRIMA-Infrastructure as a code with Terraform.pptx
RIMA-Infrastructure as a code with Terraform.pptx
 
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdfNET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
NET Aspire - NET Conf IL 2024 - Tamir Dresher.pdf
 
Introduction to IAC and Terraform
Introduction to IAC and Terraform Introduction to IAC and Terraform
Introduction to IAC and Terraform
 
Effective terraform
Effective terraformEffective terraform
Effective terraform
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly - Terraform for azure: the good, the bad and the ugly -
Terraform for azure: the good, the bad and the ugly -
 
Practical advice on deployment and management of enterprise workloads
Practical advice on deployment and management of enterprise workloadsPractical advice on deployment and management of enterprise workloads
Practical advice on deployment and management of enterprise workloads
 
Terraform vs Pulumi
Terraform vs PulumiTerraform vs Pulumi
Terraform vs Pulumi
 
Build cloud native solution using open source
Build cloud native solution using open source Build cloud native solution using open source
Build cloud native solution using open source
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
TechnicalTerraformLandingZones121120229238.pdf
TechnicalTerraformLandingZones121120229238.pdfTechnicalTerraformLandingZones121120229238.pdf
TechnicalTerraformLandingZones121120229238.pdf
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime FabricSurat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.Using Terraform to manage the configuration of a Cisco ACI fabric.
Using Terraform to manage the configuration of a Cisco ACI fabric.
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Debasihish da final.ppt
Debasihish da final.pptDebasihish da final.ppt
Debasihish da final.ppt
 

More from Katherine Golovinova

Contract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift LefContract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift LefKatherine Golovinova
 
Speed up application testing with azure container instances
Speed up application testing with azure container instancesSpeed up application testing with azure container instances
Speed up application testing with azure container instancesKatherine Golovinova
 
Analyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and ElasticsearchAnalyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and ElasticsearchKatherine Golovinova
 
Testing Big Data solutions fast and furiously
Testing Big Data solutions fast and furiouslyTesting Big Data solutions fast and furiously
Testing Big Data solutions fast and furiouslyKatherine Golovinova
 
"Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps""Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps"Katherine Golovinova
 
Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?Katherine Golovinova
 
COSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyoneCOSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyoneKatherine Golovinova
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Katherine Golovinova
 
Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Katherine Golovinova
 
Gatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testingGatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testingKatherine Golovinova
 
Automation of Security scanning easy or cheese
Automation of Security scanning easy or cheeseAutomation of Security scanning easy or cheese
Automation of Security scanning easy or cheeseKatherine Golovinova
 
Gradle plugins for Test Automation
Gradle plugins for Test AutomationGradle plugins for Test Automation
Gradle plugins for Test AutomationKatherine Golovinova
 
Automation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrellaAutomation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrellaKatherine Golovinova
 
"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor Kocherha"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor KocherhaKatherine Golovinova
 
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii FedenishinKatherine Golovinova
 
"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro Batiievskyi"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro BatiievskyiKatherine Golovinova
 
EPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architectureEPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architectureKatherine Golovinova
 
EPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clustersEPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clustersKatherine Golovinova
 
Hosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft AzureHosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft AzureKatherine Golovinova
 
Azure IoT Hub: what is it and why we select other solution (production projec...
Azure IoT Hub: what is it and why we select other solution (production projec...Azure IoT Hub: what is it and why we select other solution (production projec...
Azure IoT Hub: what is it and why we select other solution (production projec...Katherine Golovinova
 

More from Katherine Golovinova (20)

Contract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift LefContract-based Testing Approach as a Tool for Shift Lef
Contract-based Testing Approach as a Tool for Shift Lef
 
Speed up application testing with azure container instances
Speed up application testing with azure container instancesSpeed up application testing with azure container instances
Speed up application testing with azure container instances
 
Analyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and ElasticsearchAnalyzing application activities with KSQL and Elasticsearch
Analyzing application activities with KSQL and Elasticsearch
 
Testing Big Data solutions fast and furiously
Testing Big Data solutions fast and furiouslyTesting Big Data solutions fast and furiously
Testing Big Data solutions fast and furiously
 
"Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps""Fast & Fail in real life of DevTestSecOps"
"Fast & Fail in real life of DevTestSecOps"
 
Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?Geodistributed databases - what, how, and why?
Geodistributed databases - what, how, and why?
 
COSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyoneCOSMOS DB - geodistributed database for anyone
COSMOS DB - geodistributed database for anyone
 
Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?Migrating from a monolith to microservices – is it worth it?
Migrating from a monolith to microservices – is it worth it?
 
Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...Azure Functions - the evolution of microservices platform or marketing gibber...
Azure Functions - the evolution of microservices platform or marketing gibber...
 
Gatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testingGatling and Page Object: a way to performance testing
Gatling and Page Object: a way to performance testing
 
Automation of Security scanning easy or cheese
Automation of Security scanning easy or cheeseAutomation of Security scanning easy or cheese
Automation of Security scanning easy or cheese
 
Gradle plugins for Test Automation
Gradle plugins for Test AutomationGradle plugins for Test Automation
Gradle plugins for Test Automation
 
Automation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrellaAutomation world under the DevTestSecOps umbrella
Automation world under the DevTestSecOps umbrella
 
"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor Kocherha"Disaster Recovery in Azure" by Viktor Kocherha
"Disaster Recovery in Azure" by Viktor Kocherha
 
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
"Certified Kubernetes Administrator Exam – how it was" by Andrii Fedenishin
 
"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro Batiievskyi"Modern CI/CD" by Dmytro Batiievskyi
"Modern CI/CD" by Dmytro Batiievskyi
 
EPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architectureEPAM DevOps community meetup: Building CI/CD for microservice architecture
EPAM DevOps community meetup: Building CI/CD for microservice architecture
 
EPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clustersEPAM DevOps community meetup: Designing bare metal Kubernetes clusters
EPAM DevOps community meetup: Designing bare metal Kubernetes clusters
 
Hosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft AzureHosting Microservices in Microsoft Azure
Hosting Microservices in Microsoft Azure
 
Azure IoT Hub: what is it and why we select other solution (production projec...
Azure IoT Hub: what is it and why we select other solution (production projec...Azure IoT Hub: what is it and why we select other solution (production projec...
Azure IoT Hub: what is it and why we select other solution (production projec...
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 

Infrastructure as Code for Azure: ARM or Terraform?

  • 1. Infrastructure as Code for Azure: ARM or Terraform?
  • 2. • What is “Infrastructure as Code” • Resource group patterns • ARM template structure • Demo: Deploying Infrastructure using ARM + PowerShell • What is terraform • Terraform code lifecycle • Demo: Plan and apply terraform configuration • Q+A Agenda
  • 3. Infrastructure as Code evolved to solve the problem of environment drift in the release pipeline. Without IaC, teams must maintain the settings of individual deployment environments. Over time, each environment becomes a snowflake, that is, a unique configuration that cannot be reproduced automatically. Inconsistency among environments leads to issues during deployments. With snowflakes, administration and maintenance of infrastructure involves manual processes which were hard to track and contributed to errors. Infrastructure as Code
  • 4.
  • 5. • Azure Portal • ARM Templates + Powershell/Azure CLI • Custom usage of REST API (use any type of sdk) • Terraform Deploying Infrastructure to Azure
  • 6. • Resource Group – logically grouped collection of entities that usually share a common lifecycle • Resource Manager Template - declarative JSON file that defines the goal state of a deployment • Deployment - operation which tracks execution of a Resource Manager template • Parameters - values provided by the user executing the deployment to customize deployed resources • Parameter file - JSON file that stores parameter names and values • API Version – used for versioning and backward compatibility CONCEPTS AZURE RESOURCE MANAGEMENT (ARM)
  • 7. • Resources can be organized in a Resource Group, a logical container. • Resource can belong to only one Resource Group. Nested resource groups are not supported. • All Azure Services belongs to certain Resource Type. • Resource has common fields and provider specific properties. • Work with Azure Services as with REST Web Services Resources (CRUD). • You can clarify billing for your organization by viewing the rolled-up costs for the entire group. CLOUD SERVICES AS REST RESOURCE AZURE RESOURCE MANAGEMENT (ARM) API
  • 8. RESOURCE GROUP PATTERNS - APPLICATION Resource Group as Container for Application Resources Backend Server 01 Backend Server 02 VHD VHD Backend Subnet Backend Resource Group Frontend Resource Group Frontend Server 01 Frontend Server 02 VHD VHD Frontend Subnet
  • 9. RESOURCE GROUP PATTERNS - ENVIRONMENT Resource Group as Container for System Environment Backend Servers VHD VHD Virtual Network Development Environment Virtual Network Frontend Servers Backend Servers VHD VHD QA Environment Frontend Servers
  • 10. Element Required Description $schema Yes Location of the JSON schema file. contentVersion Yes Version of the template. parameters No Values provided during deployment execution. variables No Internal variables resources Yes Azure services deployed or updated in a resource group outputs No Values that are returned after deployment EASY PROVISIONING - RESOURCE TEMPLATE
  • 11. Function Syntax concat concat (arg1, arg2, arg3, ...) replace replace(originalString, oldCharacter, newCharacter) base64 base64 (inputString) padLeft padLeft(stringToPad, totalLength, paddingCharacter) toLower toLower(stringToChange) toUpper toUpper(stringToChange) TEMPLATE EXPRESSION AND FUNCTIONS - STRINGS
  • 12. Function Description Syntax listKeys Returns the keys of a storage account. listKeys (resourceName or resourceIdentifier, [apiVersion]) reference Used in depends on section of resource reference (resourceName or resourceIdentifier, [apiVersion]) resourceGroup Returns current resource group resourceGroup() resourceId Returns the unique identifier of a resource resourceId ([resourceGroupName], resourceType, resourceName1, [resourceName2]...) subscription Returns subscription details subscription() TEMPLATE EXPRESSION AND FUNCTIONS - OTHER
  • 13. Deploying Infrastructure using ARM Demo https://bit.ly/2EZch0b https://github.com/serhiiabanichev/GAB2018 Git URL
  • 14. What is terraform Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. Configuration files describe to Terraform the components needed to run a single application or your entire datacenter. Terraform generates an execution plan describing what it will do to reach the desired state, and then executes it to build the described infrastructure. As the configuration changes, Terraform is able to determine what changed and create incremental execution plans which can be applied.
  • 16. Configuration HCL (HashiCorp Configuration Language) is a configuration language built by HashiCorp. The goal of HCL is to build a structured configuration language that is both human and machine friendly for use with command-line tools, but specifically targeted towards DevOps tools, servers, etc. The set of files used to describe infrastructure in Terraform is simply known as a Terraform configuration. provider "azurerm" { subscription_id = "f7424aaf-****-****-****-*********" client_id = "c404e1a2-****-****-****-*********" client_secret = "************" tenant_id = "b41b72d-****-****-****-*********" } # Create a Resource Group resource "azurerm_resource_group" "main" { name = "${var.resource_group}" location = "${var.location}" }
  • 17. Initialization The first command to run for a new configuration - or after checking out an existing configuration from version control - is terraform init, which initializes various local settings and data that will be used by subsequent commands. Terraform uses a plugin based architecture to support the numerous infrastructure and service providers available. As of Terraform version 0.10.0, each "Provider" is its own encapsulated binary distributed separately from Terraform itself. The terraform init command will automatically download and install any Provider binary for the providers in use within the configuration, which in this case is just the azurerm provider: c:GAB2018TF> terraform init Initializing provider plugins... - Checking for available provider plugins on https://releases.hashicorp.com... - Downloading plugin for provider "azurerm" (1.3.3)... The following providers do not have any version constraints in configuration, so the latest version was installed. * provider.azurerm: version = "~> 1.3" Terraform has been successfully initialized!
  • 18. Plan changes c:GAB2018TF> terraform plan -out=GAB Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. ------------------------------------------------------------------------ An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: + create <= read (data resources) Terraform will perform the following actions:……. The terraform plan command is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files. This command is a convenient way to check whether the execution plan for a set of changes matches your expectations without making any changes to real resources or to the state. For example, terraform plan might be run before committing a change to version control, to create confidence that it will behave as expected.
  • 19. Apply configuration c:GAB2018TF>terraform apply "GAB„ azurerm_resource_group.main: Creating... location: "" => "eastus" name: "" => "GAB-TF" tags.%: "" => "<computed>" azurerm_resource_group.main: Creation complete after 2s (ID: /subscriptions/f7424*********) azurerm_virtual_network.main: Creating... address_space.#: "" => "1" address_space.0: "" => "12.0.0.0/24" location: "" => "eastus" name: "" => "GAB-TF-vnet" resource_group_name: "" => "GAB-TF" subnet.#: "" => "<computed>" tags.%: "" => "<computed>" azurerm_public_ip.main: Creating... The terraform apply command is used to apply the changes required to reach the desired state of the configuration, or the pre-determined set of actions generated by a terraform plan execution plan.
  • 20. Apply configuration c:GAB2018TF>terraform apply "GAB„ azurerm_resource_group.main: Creating... location: "" => "eastus" name: "" => "GAB-TF" tags.%: "" => "<computed>" azurerm_resource_group.main: Creation complete after 2s (ID: /subscriptions/f7424*********) azurerm_virtual_network.main: Creating... address_space.#: "" => "1" address_space.0: "" => "12.0.0.0/24" location: "" => "eastus" name: "" => "GAB-TF-vnet" resource_group_name: "" => "GAB-TF" subnet.#: "" => "<computed>" tags.%: "" => "<computed>" azurerm_public_ip.main: Creating... The terraform apply command is used to apply the changes required to reach the desired state of the configuration, or the pre-determined set of actions generated by a terraform plan execution plan.
  • 21. Plan and apply terraform configuration Demo
  • 22. Pros and Cons Great implementation of Infrastructure as Code concept. Declarative syntax Ability to "plan" and "apply" configs. Apply actually executes the changes. Supports various cloud providers Uses it's own DSL called the Hashicorp Configuration Language State files store secrets in plain text which is a bad idea when you push it to version-control. Product is still maturing and there are some design limitation
  • 23.