21
Marcom V1.0 2018 © 2018 Controlware GmbH 1 Bereitstellung und Verwaltung von Multi-Cloud Umgebungen mit Terraform Frank Guldner Multi-Cloud Consultant Infrastructure as Code Frankfurt, 23.05.2019

Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 1

Bereitstellung und Verwaltung von Multi-Cloud Umgebungen mit Terraform

Frank Guldner

Multi-Cloud Consultant

Infrastructure as Code

Frankfurt, 23.05.2019

Page 2: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 2

“create, change and

improve your

infrastructure, safely

and predictably”

Übersicht Infrastructure as Code1

Code Syntax und Demo5

Probleme und Herausforderungen in Multi-Cloud

Umgebungen2

Terraform als IaC Lösung3

Terraform bei unseren Kunden4

Agenda

Page 3: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 3

Entwicklung zu einem „Anything as a Service

(XaaS)“-Ansatz

Vorteile von Cloud basierten Infrastrukturen

nutzen – Flexibilität, Sicherheit, globale

Verfügbarkeit, Innovation, u.v.m.

Infrastructure as Code als grundlegender

Bestandteil von Cloud Computing

Der Weg von traditionellen IT-Infrastrukturen in Richtung Cloud Computing

Übersicht Infrastructure as Code

Page 4: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 4

Paradigmenwechsel im Management von IT-Infrastruktur

Übersicht Infrastructure as Code

Page 5: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 5

Wechsel von manuellen Prozessen zu automatisierten Abläufen

Bereitstellung der Infrastruktur als Ergebnis eines ausführbaren Codes,

den man beliebig oft duplizieren und versionieren kann

Änderungen schnell, konsistent und sicher umsetzen

Risiko- und Kostensenkung, sowie Steigerung der Produktivität

Infrastructure as Code auf den Punkt gebracht

Übersicht Infrastructure as Code

Page 6: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 6

Cloud Provider stellen eigene IaC Tools

zur Verfügung

Wiederverwendbare, aber Cloud

spezifische Templates

Technische und organisatorische

Komplexität

Die Herausforderung

Probleme und Herausforderung in Multi-Cloud Umgebungen

Page 7: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 7

Tool zum sicheren und effizienten

Erstellen, Ändern und Versionieren von

Infrastruktur

Sichere und konsistente Workflows

Code Syntax basiert auf einer gut

lesbaren, JSON kompatiblen

Skriptsprache (HCL)

Die Lösung

Terraform als IaC Lösung

Page 8: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 8

160+ Provider für Services und

Plattformen (On-Premises und Cloud

basierend)

Vorgehensweise der „Immutable“

Infrastruktur

Deklarativer Code Stil

„Client-Only“ Architektur

Terraform auf den Punkt gebracht

Terraform als IaC Lösung

Page 9: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 9

Code Open Source Open Source Open Source Open Source Closed Source Open Source

Cloud All All All All AWS only All

Type Config Mgmt Config Mgmt Config Mgmt Config Mgmt Orchestration Orchestration

Infrastructure Mutable Mutable Mutable Mutable Immutable Immutable

Language Procedural Declarative Procedural Declarative Declarative Declarative

Architecture Client/Server Client/Server Client-Only Client/Server Client-Only Client-Only

Vergleich zu anderen IaC Tools – Configuration Management vs. Provisioning

Terraform als IaC Lösung

Page 10: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 10

Änderungen in der Infrastruktur erkennen und

Ausführungsplan erstellen

terraform plan

Änderungen in API Aufrufe übersetzen, ausführen und

speichern (terraform.tfstate)

terraform apply

Konfiguration, bzw. die von Terraform erstellte Infrastruktur

löschen

terraform destroy

Terraform Enterprise Workflow

Terraform als IaC Lösung

Page 11: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 11

Virtual Networks + VNET Peering

Subnets + UDRs + NSGs

Virtual + Local Network Gateway + Public IP

Site-to-Site VPN Connection

Key Vault

Windows VM + ADE Extension

Storage Accounts

Log Analytics Workspace

Workshop und Tag 1 Konfiguration in Azure

Terraform bei unseren Kunden

Page 12: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 12

Workshop (Terraform Grundlagen)

Proof of Concept

Controlware unterstützt bei der…

…Entscheidungsfindung für die zu Ihrer Organisation passenden Terraform Version

…Implementierung der Terraform Umgebung

…Entwicklung von TF Skripten

…Weiterentwicklung, bzw. beim Aufbau der Infrastruktur mit Terraform

Wie können wir Sie bei der Einführung von Terraform erfolgreich unterstützen?

Terraform bei unseren Kunden

Page 13: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 13

1 provider "azurerm" {

2 subscription_id = "SUBSCRIPTION_ID"

3 }

Provider – AzureRM

Code Syntax und Demo

Page 14: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 14

4 data "azurerm_resource_group" "cw_road_show_rg" {

5 name = "cw_road_show_rg"

6 }

Data – Resource Group

Code Syntax und Demo

Page 15: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 15

7 resource "azurerm_app_service_plan" "cw_road_show_asp" {

8 name = "cw_road_show_asp"

9 location = "${data.azurerm_resource_group.cw_road_show_rg.location}"

10 resource_group_name = "${data.azurerm_resource_group.cw_road_show_rg.name}"

11 sku {

12 tier = "Standard"

13 size = "S1"

14 }

15 }

Resource – App Service Plan

Code Syntax und Demo

Page 16: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 16

16 resource "azurerm_app_service" "cwroadshow" {

17 name = "cwroadshow"

18 location = "${data.azurerm_resource_group.cw_road_show_rg.location}"

19 resource_group_name = "${data.azurerm_resource_group.cw_road_show_rg.name}"

20 app_service_plan_id = "${azurerm_app_service_plan.cw_road_show_asp.id}"

21 }

Resource – App Service

Code Syntax und Demo

Page 17: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 17

22 resource "null_resource" "default" {

23 depends_on = ["azurerm_app_service.cwroadshow"]

24 provisioner "local-exec" {

25 command = "az webapp deployment source config-zip --resource-group

cw_road_show_rg --name cwroadshow --src ./cw_road_show.zip"

26 }

27 }

Null Resource – Local-Exec

Code Syntax und Demo

Page 18: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 18

28 output "default_site_url" {

29 value = "https://${azurerm_app_service.cwroadshow.default_site_hostname}"

30 }

URL – Output

Code Syntax und Demo

Page 19: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 19

terraform graph | dot -Tpng -o terraform.png

Terraform Resource Graph

Code Syntax und Demo

Page 20: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 20

LIVE DEMO

Page 21: Infrastructure as Code - Controlware...infrastructure, safely and predictably” 1 Übersicht Infrastructure as Code 5 Code Syntax und Demo Probleme und Herausforderungen in Multi-Cloud

Marc

om

V1.0

2018

© 2018 Controlware GmbH 21

Vielen Dank für Ihre Aufmerksamkeit!

Thank you very much for your

attention!

CWROAD SHOW

???