Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Taming Infrastructure Workflow at Scale (RootConf Hyderabad)

Anubhav Mishra
November 16, 2019

Taming Infrastructure Workflow at Scale (RootConf Hyderabad)

# Description

As more operations choices are added to your data center, whether through company acquisitions, a growing development team, or general technical debt, managing infrastructure complexity becomes a nightmare. Yet the end goal is still the same — safely deploy your application to your infrastructure. We need to tame our data centers by managing change across systems, enforcing policies, and by establishing a workflow for both developers and operations engineers to build in a collaborative environment.

This talk will discuss the problems faced in managing a modern cloud infrastructure, and how a set of innovative open source tools like Terraform can be used to tame the rising complexity curve.

Join me as I take you on a journey of exploring Infrastructure as Code techniques as we take control of our cloud infrastructure. This goal of this demo driven talk is to showcase how you can build multi-tier application infrastructure supporting multiple cloud platforms and services using IAC.

RootConf Hyderabad talk schedule link: https://hasgeek.com/rootconf/2019-hyderabad/schedule/taming-infrastructure-workflow-at-scale-LJSyh9DPfxq7p8zM23hbzn

Anubhav Mishra

November 16, 2019
Tweet

More Decks by Anubhav Mishra

Other Decks in Technology

Transcript

  1. Taming Infrastructure Workflow at Scale
    https://unsplash.com/photos/-a4tzI2fNW8 Photo by Rita Morais
    @build1point0

    View Slide

  2. $ whoami
    @build1point0
    Anubhav Mishra
    Technical Advisor to the CTO, HashiCorp

    View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. Open Source

    View Slide

  8. Atlan&s
    Open Source

    View Slide

  9. Vault in Action Book

    View Slide

  10. Gopher Artwork by Ashley McNamara

    View Slide

  11. View Slide

  12. PRIVATE
    CLOUD
    AWS AZURE GCP
    Run
    Development
    Connect
    Networking
    Secure 

    Security
    Provision
    Operations
    HashiCorp Suite

    View Slide

  13. Evolution

    View Slide

  14. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !11
    ~30 years ago

    View Slide

  15. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !12
    ~20 years ago

    View Slide

  16. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !13
    ~15-20 years ago

    View Slide

  17. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !14
    ~10 years ago

    View Slide

  18. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !15
    VIRTUAL MACHINES
    ~10 years ago

    View Slide

  19. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !16
    CONTAINERS
    VIRTUAL MACHINES
    ~5 years ago

    View Slide

  20. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !17
    CONTAINERS
    VIRTUAL MACHINES
    ~5 years ago

    View Slide

  21. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    Evolution
    !18
    CONTAINERS
    VIRTUAL MACHINES
    ~5 years ago

    View Slide

  22. Copyright © 2019 HashiCorp
    @build1point0

    DATACENTER
    DNS
    Evolution
    !19
    DATABASE
    Presently
    SERVERLESS

    View Slide

  23. Copyright © 2019 HashiCorp
    @build1point0

    DC 1
    Evolution
    !20
    DC 2
    Presently

    View Slide

  24. Copyright © 2019 HashiCorp
    @build1point0

    Evolution
    !21
    Rise in Complexity

    View Slide

  25. Workflow
    Photo by Daniel Apodaca on Unsplash

    View Slide

  26. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !23
    Previously

    View Slide

  27. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !23
    BUY
    Previously

    View Slide

  28. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !23
    BUY PROVISION
    Previously

    View Slide

  29. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !23
    BUY PROVISION UPDATE/DESTROY
    -/+
    Previously

    View Slide

  30. Copyright © 2019 HashiCorp
    @build1point0

    BUY
    Workflow
    !24
    PROVISION UPDATE/DESTROY
    -/+
    Previously

    View Slide

  31. Copyright © 2019 HashiCorp
    @build1point0

    BUY
    Workflow
    !24
    Previously

    View Slide

  32. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !25
    BUY
    Presently

    View Slide

  33. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !25
    BUY
    Presently

    View Slide

  34. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !26
    PROVISION UPDATE/DESTROY
    -/+
    BUY
    Presently

    View Slide

  35. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !26
    PROVISION
    BUY
    Presently

    View Slide

  36. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !26
    PROVISION
    Presently

    View Slide

  37. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !26
    PROVISION
    Presently

    View Slide

  38. Copyright © 2019 HashiCorp
    @build1point0

    PROVISION
    Workflow
    !27
    Presently

    View Slide

  39. Copyright © 2019 HashiCorp
    @build1point0

    PROVISION
    Workflow
    !27
    Presently

    View Slide

  40. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !28
    BUY PROVISION UPDATE/DESTROY
    -/+
    Presently

    View Slide

  41. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !28
    UPDATE/DESTROY
    -/+
    Presently

    View Slide

  42. Copyright © 2019 HashiCorp
    @build1point0

    Workflow
    !29
    UPDATE/DESTROY
    -/+
    CLOUD PROVIDER API
    Presently

    View Slide

  43. Copyright © 2019 HashiCorp
    @build1point0

    Complete Workflow
    !30
    Presently

    View Slide

  44. Copyright © 2019 HashiCorp
    @build1point0
     !31
    CDW

    View Slide

  45. Copyright © 2019 HashiCorp
    @build1point0
     !31
    CDW

    View Slide

  46. Copyright © 2019 HashiCorp
    @build1point0
     !31
    CDW

    View Slide

  47. Copyright © 2019 HashiCorp
    @build1point0
     !32
    CDW

    View Slide

  48. View Slide

  49. $ ssh [email protected]
    $ sudo apt-get install default-jre
    $ echo “the oracle way”
    $ sudo add-apt-repository ppa:webupd8team/java
    $ sudo apt-get update
    $ sudo apt-get install oracle-java8-installer
    $ ./setup-java.sh
    Terminal

    View Slide

  50. View Slide

  51. View Slide

  52. $ aws
    usage: aws [options]
    [ ...] [parameters]
    To see help text, you can run:
    aws help
    aws help
    aws help
    Terminal
    Terminal
    $ az
    /\
    / \ _____ _ _ ___ _
    / /\ \ |_ / | | | \'__/ _\
    / ____ \ / /| |_| | | | __/
    /_/ \_\/___|\__,_|_| \___|

    View Slide

  53. View Slide

  54. View Slide

  55. Why Did We Change?
    Photo by Maxime Rossignol on Unsplash

    View Slide

  56. Copyright © 2019 HashiCorp
    @build1point0
     !40
    Deliver Applications at a Rapid Pace

    View Slide

  57. Copyright © 2019 HashiCorp
    @build1point0
     !41
    Deliver Applications at Scale

    View Slide

  58. What could be an ideal workflow?
    Photo by Alvaro Reyes on Unsplash

    View Slide

  59. Copyright © 2019 HashiCorp
    @build1point0
     !43
    • Describe your infrastructure in code
    • Version control
    • Share infrastructure code
    • Make safe and predictable changes
    • Fast provisioning

    View Slide

  60. Copyright © 2019 HashiCorp
    @build1point0

    Questions
    !44
    How Do We Provision Resources?
    • Compute (Cloud Servers)
    • Network (VPCs, ACLs, Firewalls)
    • Storage (Databases, Object Stores)

    View Slide

  61. Copyright © 2019 HashiCorp
    @build1point0

    Questions
    !45
    How Do We Manage the Lifecycle of Resources?
    • Compute (Cloud Servers)
    • Network (VPCs, ACLs, Firewalls)
    • Storage (Databases, Object Stores)

    View Slide

  62. Copyright © 2019 HashiCorp
    @build1point0

    Questions
    !46
    How Do We Enforce Policies Across the Resources?
    • Compute (Cloud Servers)
    • Network (VPCs, ACLs, Firewalls)
    • Storage (Databases, Object Stores)

    View Slide

  63. Copyright © 2019 HashiCorp
    @build1point0

    Questions
    !47
    How Do We Automate and Share the Configurations?
    • Compute (Cloud Servers)
    • Network (VPCs, ACLs, Firewalls)
    • Storage (Databases, Object Stores)

    View Slide

  64. View Slide

  65. Goal

    View Slide

  66. Copyright © 2019 HashiCorp
    @build1point0

    Goal
    !50
    Provide a Unified Workflow Using Infrastructure as Code
    to Iterate Over Infrastructure Safely
    that is Capable of Provisioning Anything Anywhere.

    View Slide

  67. Copyright © 2019 HashiCorp
    @build1point0
     !51
    Terminal
    resource "TYPE" "NAME" {
    ATTRIBUTES
    }

    View Slide

  68. Copyright © 2019 HashiCorp
    @build1point0
     !52
    Terminal
    resource "azurerm_virtual_machine" "web" {
    storage_image_reference {
    publisher = "Canonical"
    offer = "UbuntuServer"
    sku = "16.04-LTS"
    version = "latest"
    }
    }
    resource "aws_instance" "web" {
    ami = "ami-b123125"
    }
    main.tf

    View Slide

  69. Copyright © 2019 HashiCorp
    @build1point0
     !53
    Terminal
    resource "azurerm_public_ip" "web" {
    name = "webserver-ip"
    location = "West US"
    resource_group_name = "webserver-rg"
    public_ip_address_allocation = "static"
    }
    resource "dnsimple_record" "hello" {
    domain = "example.com"
    name = "test"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  70. Copyright © 2019 HashiCorp
    @build1point0
     !54
    Terminal
    resource "azurerm_public_ip" "web" {
    name = "webserver-ip"
    location = "West US"
    resource_group_name = "webserver-rg"
    public_ip_address_allocation = "static"
    }
    resource "dnsimple_record" "hello" {
    domain = "example.com"
    name = "test"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  71. Copyright © 2019 HashiCorp
    @build1point0
     !55
    Terminal
    resource "cloudflare_page_rule" "www" {
    # ...
    }
    resource "fastly_service_v1" "myservice" {
    name = "myawesometestservice"
    # ...
    }
    main.tf

    View Slide

  72. Copyright © 2019 HashiCorp
    @build1point0
     !56
    Terminal
    resource "github_membership" "membership_for_some_user" {
    username = "admin"
    role = "owner"
    }
    resource "gitlab_project" "example" {
    name = "example"
    description = "My awesome codebase"
    visibility_level = "public"
    }
    main.tf

    View Slide

  73. Copyright © 2019 HashiCorp
    @build1point0
     !57
    Core
    Config Parser
    DAG
    Schema

    View Slide

  74. Copyright © 2019 HashiCorp
    @build1point0
     !58
    Core
    Config Parser
    DAG
    Schema
    Plugins
    Providers
    Provisioners

    View Slide

  75. Copyright © 2019 HashiCorp
    @build1point0
     !59

    View Slide

  76. Copyright © 2019 HashiCorp
    @build1point0
     !59
    Amazon BitBucket CenturyLink Cloud
    CloudFlare CloudStack Cobbler
    Consul Datadog DigitalOcean
    DNSMadeEasy DNSimple Docker
    Dyn GitHub Fastly
    Google Heroku Librato
    Microsoft Azure MySQL OpenStack
    Packet PostgreSQL SoftLayer
    UltraDNS VMware Sphere and more...

    View Slide

  77. Copyright © 2019 HashiCorp
    @build1point0
     !59
    Amazon BitBucket CenturyLink Cloud
    CloudFlare CloudStack Cobbler
    Consul Datadog DigitalOcean
    DNSMadeEasy DNSimple Docker
    Dyn GitHub Fastly
    Google Heroku Librato
    Microsoft Azure MySQL OpenStack
    Packet PostgreSQL SoftLayer
    UltraDNS VMware Sphere and more...

    View Slide

  78. Copyright © 2019 HashiCorp
    @build1point0
     !59
    Amazon BitBucket CenturyLink Cloud
    CloudFlare CloudStack Cobbler
    Consul Datadog DigitalOcean
    DNSMadeEasy DNSimple Docker
    Dyn GitHub Fastly
    Google Heroku Librato
    Microsoft Azure MySQL OpenStack
    Packet PostgreSQL SoftLayer
    UltraDNS VMware Sphere and more...
    100s Terraform Providers

    View Slide

  79. Copyright © 2019 HashiCorp
    @build1point0
     !59
    Amazon BitBucket CenturyLink Cloud
    CloudFlare CloudStack Cobbler
    Consul Datadog DigitalOcean
    DNSMadeEasy DNSimple Docker
    Dyn GitHub Fastly
    Google Heroku Librato
    Microsoft Azure MySQL OpenStack
    Packet PostgreSQL SoftLayer
    UltraDNS VMware Sphere and more...

    View Slide

  80. Copyright © 2019 HashiCorp
    @build1point0
     !59

    View Slide

  81. Copyright © 2019 HashiCorp
    @build1point0
     !59

    View Slide

  82. Copyright © 2019 HashiCorp
    @build1point0
     !60
    CRUD API =

    View Slide

  83. Copyright © 2019 HashiCorp
    @build1point0
     !61
    CRUD API =

    View Slide

  84. Copyright © 2019 HashiCorp
    @build1point0
     !61
    CRUD API =
    Create()

    View Slide

  85. Copyright © 2019 HashiCorp
    @build1point0
     !61
    CRUD API =
    Create() Read()

    View Slide

  86. Copyright © 2019 HashiCorp
    @build1point0
     !61
    CRUD API =
    Create() Read() Update()

    View Slide

  87. Copyright © 2019 HashiCorp
    @build1point0
     !61
    CRUD API =
    Create() Read() Update() Destroy()

    View Slide

  88. Copyright © 2019 HashiCorp
    @build1point0
     !62
    Describe Your Infrastructure in Text Files

    View Slide

  89. Copyright © 2019 HashiCorp
    @build1point0
     !63
    Human Friendly Configuration

    View Slide

  90. Copyright © 2019 HashiCorp
    @build1point0
     !64
    Human Friendly Configuration <3 JSON

    View Slide

  91. Copyright © 2019 HashiCorp
    @build1point0
     !65
    Store in Any VCS

    View Slide

  92. Copyright © 2019 HashiCorp
    @build1point0
     !66
    Track the History of Your Infrastructure

    View Slide

  93. Copyright © 2019 HashiCorp
    @build1point0

    Terraform Usage
    !67
    • Contributors ~4600
    • Downloads ~300,000/month (unique)
    • Modules ~2000

    View Slide

  94. Copyright © 2019 HashiCorp
    @build1point0

    Goal
    !68
    Provide a Unified Workflow Using Infrastructure as Code
    to Iterate Over Infrastructure Safely
    that is Capable of Provisioning Anything Anywhere.

    View Slide

  95. Copyright © 2019 HashiCorp
    @build1point0

    Goal
    !69
    Provide a Unified Workflow Using Infrastructure as Code
    to Iterate Over Infrastructure Safely
    that is Capable of Provisioning Anything Anywhere.

    View Slide

  96. PLAN & APPLY

    View Slide

  97. Copyright © 2019 HashiCorp
    @build1point0
     !71
    Terminal
    resource "azurerm_public_ip" "web" {
    resource_group_name = "webserver-rg"
    public_ip_address_allocation = "static"
    }
    resource "azurerm_network_interface" "web" {
    resource_group_name = "webserver-rg"
    ip_configuration {
    .....
    public_ip_address_id = "${azurerm_public_ip.web.id}"
    }
    }
    resource "azurerm_virtual_machine" "web" {
    count = 1
    network_interface_ids = ["${azurerm_network_interface.web.id}"]
    storage_image_reference {
    offer = "UbuntuServer"
    .....
    }
    }
    resource "dnsimple_record" "web" {
    domain = "example.com"
    name = "webs"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  98. Copyright © 2019 HashiCorp
    @build1point0
     !72
    Terminal
    resource "azurerm_public_ip" "web" {
    resource_group_name = "webserver-rg"
    public_ip_address_allocation = "static"
    }
    resource "azurerm_network_interface" "web" {
    resource_group_name = "webserver-rg"
    ip_configuration {
    .....
    public_ip_address_id = "${azurerm_public_ip.web.id}"
    }
    }
    resource "azurerm_virtual_machine" "web" {
    count = 1
    network_interface_ids = ["${azurerm_network_interface.web.id}"]
    storage_image_reference {
    offer = "UbuntuServer"
    .....
    }
    }
    resource "dnsimple_record" "web" {
    domain = "example.com"
    name = "webs"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  99. Copyright © 2019 HashiCorp
    @build1point0
     !73
    Terminal
    $ terraform plan
    main.tf

    View Slide

  100. Copyright © 2019 HashiCorp
    @build1point0
     !74
    “Shows You What Will Happen
    Before It Actually Happens”
    TERRAFORM PLAN
    Anubhav Mishra
    Rootconf Hyderabad 2019

    View Slide

  101. Copyright © 2019 HashiCorp
    @build1point0
     !75
    Terminal
    + azurerm_public_ip.web
    .....
    + azurerm_network_interface.web
    .....
    + azurerm_virtual_machine.webserver
    .....
    + dnsimple_record.hello
    id:
    domain: "example.com"
    domain_id:
    hostname:
    name: "test"
    priority:
    ttl: "3600"
    type: "A"
    value: "${azurerm_public_ip.web.ip_address}"
    shell

    View Slide

  102. Copyright © 2019 HashiCorp
    @build1point0
     !76
    Terminal
    + azurerm_public_ip.web
    .....
    + azurerm_network_interface.web
    .....
    + azurerm_virtual_machine.webserver
    .....
    + dnsimple_record.hello
    id:
    domain: "example.com"
    domain_id:
    hostname:
    name: "test"
    priority:
    ttl: "3600"
    type: "A"
    value: "${azurerm_public_ip.web.ip_address}"
    shell

    View Slide

  103. Copyright © 2019 HashiCorp
    @build1point0
     !77
    Terminal
    + azurerm_public_ip.web
    .....
    + azurerm_network_interface.web
    .....
    + azurerm_virtual_machine.webserver
    .....
    + dnsimple_record.hello
    id:
    domain: "example.com"
    domain_id:
    hostname:
    name: "test"
    priority:
    ttl: "3600"
    type: "A"
    value: "${azurerm_public_ip.web.ip_address}"
    shell

    View Slide

  104. Copyright © 2019 HashiCorp
    @build1point0
     !78
    Terminal
    + azurerm_public_ip.web
    .....
    + azurerm_network_interface.web
    .....
    + azurerm_virtual_machine.webserver
    .....
    + dnsimple_record.hello
    id:
    domain: "example.com"
    domain_id:
    hostname:
    name: "test"
    priority:
    ttl: "3600"
    type: "A"
    value: "${azurerm_public_ip.web.ip_address}"
    shell

    View Slide

  105. Copyright © 2019 HashiCorp
    @build1point0
     !79
    Terminal
    $ terraform apply
    shell

    View Slide

  106. Copyright © 2019 HashiCorp
    @build1point0
     !80
    Previously?????

    View Slide

  107. View Slide

  108. View Slide

  109. State

    View Slide

  110. Copyright © 2019 HashiCorp
    @anubhavm
     !83
    Map of Real World Resources
    to Your Configuration.
    TERRAFORM STATE

    View Slide

  111. Copyright © 2019 HashiCorp
    @anubhavm
     !84
    Terminal
    {
    "version": 3,
    "terraform_version": "0.11.5",
    "serial": 4,
    "lineage": "af985fb6-6e75-66bc-984a-7635ea4249c7",
    "modules": [
    {
    "path": [
    "root"
    ],
    "outputs": {},
    "resources": {
    "azurerm_resource_group.default": {
    "type": "azurerm_resource_group",
    "depends_on": [],
    "primary": {
    "id": "",
    },
    },
    "deposed": [],
    "provider": "provider.azurerm"
    }
    },
    "depends_on": []
    },
    terraform.tfstate

    View Slide

  112. Copyright © 2019 HashiCorp
    @anubhavm
     !85
    Terminal
    {
    "version": 3,
    "terraform_version": "0.11.5",
    "serial": 4,
    "lineage": "af985fb6-6e75-66bc-984a-7635ea4249c7",
    "modules": [
    {
    "path": [
    "root"
    ],
    "outputs": {},
    "resources": {
    "azurerm_resource_group.default": {
    "type": "azurerm_resource_group",
    "depends_on": [],
    "primary": {
    "id": "",
    },
    },
    "deposed": [],
    "provider": "provider.azurerm"
    }
    },
    "depends_on": []
    },
    terraform.tfstate

    View Slide

  113. Copyright © 2019 HashiCorp
    @anubhavm
     !85
    Terminal
    {
    "version": 3,
    "terraform_version": "0.11.5",
    "serial": 4,
    "lineage": "af985fb6-6e75-66bc-984a-7635ea4249c7",
    "modules": [
    {
    "path": [
    "root"
    ],
    "outputs": {},
    "resources": {
    "azurerm_resource_group.default": {
    "type": "azurerm_resource_group",
    "depends_on": [],
    "primary": {
    "id": "",
    },
    },
    "deposed": [],
    "provider": "provider.azurerm"
    }
    },
    "depends_on": []
    },
    terraform.tfstate

    View Slide

  114. Copyright © 2019 HashiCorp
    @anubhavm
     !85
    Terminal
    {
    "version": 3,
    "terraform_version": "0.11.5",
    "serial": 4,
    "lineage": "af985fb6-6e75-66bc-984a-7635ea4249c7",
    "modules": [
    {
    "path": [
    "root"
    ],
    "outputs": {},
    "resources": {
    "azurerm_resource_group.default": {
    "type": "azurerm_resource_group",
    "depends_on": [],
    "primary": {
    "id": "",
    },
    },
    "deposed": [],
    "provider": "provider.azurerm"
    }
    },
    "depends_on": []
    },
    terraform.tfstate
    Storage:
    Terraform Cloud, file,
    consul, azurerm, s3,
    gcs, etc.

    View Slide

  115. View Slide

  116. View Slide

  117. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION

    View Slide

  118. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)

    View Slide

  119. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)

    View Slide

  120. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    FOO SERVICE (EC2 instances, ASGs…..)

    View Slide

  121. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    FOO SERVICE (EC2 instances, ASGs…..)

    View Slide

  122. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)

    View Slide

  123. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT

    View Slide

  124. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING

    View Slide

  125. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING
    PRODUCTION

    View Slide

  126. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING
    PRODUCTION
    DEVELOPMENT

    View Slide

  127. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING
    PRODUCTION
    DEVELOPMENT
    STAGING

    View Slide

  128. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING
    PRODUCTION
    DEVELOPMENT
    STAGING
    Terraform
    Workspaces

    View Slide

  129. Copyright © 2019 HashiCorp
    @anubhavm
     !87
    TERRAFORM STATE ORGANIZATION
    NETWORKING (VPCs, ACLs, Routing Table..)
    BAR SERVICE (Lambda, RDS instances…..)
    FOO SERVICE (EC2 instances, ASGs…..)
    DEVELOPMENT
    STAGING
    PRODUCTION
    DEVELOPMENT
    STAGING
    Terraform
    Workspaces
    }

    View Slide

  130. Collaboration
    Photo by rawpixel on Unsplash

    View Slide

  131. Modules

    View Slide

  132. Copyright © 2019 HashiCorp
    @build1point0
     !90
    Terminal
    resource "azurerm_public_ip" "web" {
    .....
    }
    resource "azurerm_network_interface" "web" {
    ip_configuration {
    .....
    public_ip_address_id = "${azurerm_public_ip.web.id}"
    }
    }
    resource "azurerm_virtual_machine" "web" {
    count = 1
    network_interface_ids = ["${azurerm_network_interface.web.id}"]
    storage_image_reference {
    publisher = "Canonical"
    offer = "UbuntuServer"
    sku = "16.04-LTS"
    version = "latest"
    }
    }
    resource "dnsimple_record" "web" {
    domain = "example.com"
    name = "test"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  133. Copyright © 2019 HashiCorp
    @build1point0
     !91
    Terminal
    resource "azurerm_public_ip" "web" {
    .....
    }
    resource "azurerm_network_interface" "web" {
    ip_configuration {
    .....
    public_ip_address_id = "${azurerm_public_ip.web.id}"
    }
    }
    resource "azurerm_virtual_machine" "web" {
    count = "${var.count}"
    network_interface_ids = ["${azurerm_network_interface.web.id}"]
    storage_image_reference {
    publisher = "Canonical"
    offer = "${var.os_name}"
    sku = "${var.sku}"
    version = "latest"
    }
    }
    resource "dnsimple_record" "web" {
    domain = "example.com"
    name = "test"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  134. Copyright © 2019 HashiCorp
    @build1point0
     !92
    Terminal
    resource "azurerm_public_ip" "web" {
    .....
    }
    resource "azurerm_network_interface" "web" {
    ip_configuration {
    .....
    public_ip_address_id = "${azurerm_public_ip.web.id}"
    }
    }
    resource "azurerm_virtual_machine" "web" {
    count = "${var.count}"
    network_interface_ids = ["${azurerm_network_interface.web.id}"]
    storage_image_reference {
    publisher = "Canonical"
    offer = "${var.os_name}"
    sku = “${var.sku}"
    version = "latest"
    }
    }
    resource "dnsimple_record" "web" {
    domain = "example.com"
    name = "test"
    value = "${azurerm_public_ip.web.ip_address}"
    type = "A"
    }
    main.tf

    View Slide

  135. Copyright © 2019 HashiCorp
    @build1point0
     !93
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf

    View Slide

  136. Copyright © 2019 HashiCorp
    @build1point0
     !94
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf
    Inputs Outputs

    View Slide

  137. Copyright © 2019 HashiCorp
    @build1point0
     !95

    View Slide

  138. Copyright © 2019 HashiCorp
    @build1point0
     !96
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf

    View Slide

  139. Copyright © 2019 HashiCorp
    @build1point0
     !97
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf
    OPERATIONS ENGINEER

    View Slide

  140. Copyright © 2019 HashiCorp
    @build1point0
     !98
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf
    OPERATIONS ENGINEER SOFTWARE ENGINEER

    View Slide

  141. Copyright © 2019 HashiCorp
    @build1point0
     !99
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf
    OPERATIONS ENGINEER SOFTWARE ENGINEER
    WEBSERVERS

    View Slide

  142. Copyright © 2019 HashiCorp
    @build1point0
     !100
    Terminal
    module "webserver" {
    source = "mishracorp/webserver?ref=v1.2.0"
    count = 10
    os_name = "UbuntuServer"
    environment = "development"
    service_name = "profile"
    contact = "Anubhav Mishra"
    }
    main.tf

    View Slide

  143. Copyright © 2019 HashiCorp
    @build1point0
     !101
    Terminal
    module "webserver" {
    source = "mishracorp/webserver?ref=v1.2.0"
    count = 10
    os_name = "UbuntuServer"
    environment = "development"
    service_name = "profile"
    contact = "Anubhav Mishra"
    }
    main.tf
    Module
    Versioning

    View Slide

  144. Copyright © 2019 HashiCorp
    @build1point0
     !102
    Terminal
    module "webserver" {
    source = "mishracorp/webserver"
    count = 10
    os_name = "UbuntuServer"
    }
    main.tf
    Terminal
    module "webserver" {
    source = “mishracorp/mysql-
    database“
    read_replica_count = 10
    }
    main.tf
    Terminal
    module "webserver" {
    source = “mishracorp/pub-sub”
    }
    main.tf
    Terminal
    module "webserver" {
    source = “mishracorp/
    autoscaling-group”
    min_count = 10
    }
    main.tf
    Terminal
    module "webserver" {
    source = “mishracorp/
    kubernetes"
    nodes = 10
    }
    main.tf

    View Slide

  145. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES

    View Slide

  146. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    PRODUCERS

    View Slide

  147. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PRODUCERS

    View Slide

  148. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PRODUCERS

    View Slide

  149. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PLATFORM ENGINEER
    PRODUCERS

    View Slide

  150. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PLATFORM ENGINEER
    PRODUCERS

    View Slide

  151. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PLATFORM ENGINEER
    PRODUCERS

    View Slide

  152. Copyright © 2019 HashiCorp
    @build1point0
     !103
    CORE MODULES
    SERVICE MODULES
    OPERATIONS ENGINEER
    PLATFORM ENGINEER
    PRODUCERS
    CONSUMERS

    View Slide

  153. INFRASTRUCTURE WORKFLOW FOR THE CLOUD

    View Slide

  154. s
    Copyright © 2017 HashiCorp @build1point0
     !105
    DEMO

    View Slide

  155. www.hashicorp.com
    FOR EVERYONE, EVERYWHERE
    Ask me anything. @build1point0
    Anubhav Mishra
    Thank you!
    mishra.dev/rootconf

    View Slide