Slide 1

Slide 1 text

Infrastructure as Code and AI - does it fit? PATRICK KOCH

Slide 2

Slide 2 text

Patrick Koch Email: patrick.koch@avl.com Blog: patrickkoch.dev LinkedIn: patkoch87 GitHub: patkoch Twitter/X: PK_Koch Mastodon: @patkoch@hostux.social Cloud Adoption Engineer, AVL List GmbH Source icons: Microsoft, HashiCorp

Slide 3

Slide 3 text

Source: kleinezeitung.at – 01.04.2024

Slide 4

Slide 4 text

Content What is Infrastructure as Code? Usages of AI tools for Infrastructure as Code Demo(s) for the usages Are my prompts retained? Conclusion

Slide 5

Slide 5 text

What is Infrastructure as Code?

Slide 6

Slide 6 text

What is Infrastructure as Code?  Infrastructure as Code (IaC) is a method of managing and provisioning computing infrastructure through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools. It's a key practice in DevOps and is used in conjunction with continuous delivery.  IaC allows developers to automate the process of setting up and managing infrastructure, which can lead to faster deployment times, more efficient use of resources, and more reliable and repeatable processes. It can be used to manage a wide range of services, including networks, virtual machines, load balancers, and connection topology. Source: GitHub Copilot

Slide 7

Slide 7 text

Example: Azure Kubernetes Cluster resource "azurerm_resource_group" "example" { name = „gaa-24-rg" location = "West Europe" } resource "azurerm_kubernetes_cluster" "example" { name = „gaa-24-aks" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name dns_prefix = "exampleaks1" default_node_pool { name = "default" node_count = 1 vm_size = "Standard_D2_v2" } identity { type = "SystemAssigned" } tags = { Environment = "Production" } } Azure AKS Azure Icons: Azure Public Service Icons V14, Terraform Icon: HashiCorp Brand Kit

Slide 8

Slide 8 text

AI and IaC Example usages of AI tools for Infrastructure as Code

Slide 9

Slide 9 text

Code Generation Code Interpretation Trouble Shooting Security Answering questions Giving advice Icon MS Copilot: Microsoft 365 Copilot Icon.svg - Wikimedia Commons Icon Gemini: https://en.m.wikipedia.org/wiki/File:Google_Gemini_logo.svg Icon GitHub Copilot: Microsoft (provided by Maxim Salnikov)

Slide 10

Slide 10 text

Answering questions

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Code Generation

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Security

Slide 16

Slide 16 text

resource "azurerm_network_security_group" "sg-rdp- connection" { name = "gaa24demonsg" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name security_rule { name = "tcptraffic" priority = 100 direction = "Inbound" access = "Allow" protocol = "Tcp" source_port_range = "*" destination_port_range = "*" source_address_prefix = "*" destination_address_prefix = "*" } tags = { environment = "Testing" } }

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Code Interpretation

Slide 19

Slide 19 text

param registryName string param location string = resourceGroup().location param sku string = 'Basic' resource acr 'Microsoft.ContainerRegistry/registries@2021-06-01-preview' = { name: registryName location: location sku: { name: sku } properties: { adminUserEnabled: true } }

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Are my prompts retained?

Slide 22

Slide 22 text

Source: GitHub Copilot Trust Center - GitHub Resources

Slide 23

Slide 23 text

Source: https://learn.microsoft.com/en-us/purview/retention-policies-copilot#how-retention-works-with-microsoft-copilot-for-microsoft-365

Slide 24

Slide 24 text

Source: Gemini

Slide 25

Slide 25 text

Conclusion