Zum Inhalt springen
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
Referenzen Technologien Blog Know-how Tools
Über uns Zusammenarbeit Karriere
CS EN DE
Lassen Sie uns sprechen

Terraform od nuly

19. 10. 2022 1 Min. Lesezeit advanced

Cloud Pokročilý

Terraform od nuly

TerraformIaCInfrastructure 3 min čtení

Infrastructure as Code s Terraform. Providers, resources, state a první deployment.

Základy

# main.tf
terraform {
  required_providers {
    aws = { source = "hashicorp/aws", version = "~> 5.0" }
  }
}

provider "aws" { region = "eu-central-1" }

resource "aws_instance" "web" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t3.micro"
  tags = { Name = "web-server" }
}

output "public_ip" { value = aws_instance.web.public_ip }

Workflow

terraform init     # Stáhni providery
terraform plan     # Ukaž co se změní
terraform apply    # Proveď změny
terraform destroy  # Smaž vše

State

Terraform ukládá stav do terraform.tfstate. V týmu vždy remote state (S3, Azure Blob, Terraform Cloud).

Shrnutí

Terraform je de facto standard pro IaC. Začněte s plan/apply workflow a remote state.

Potřebujete pomoct s implementací?

Náš tým má zkušenosti s návrhem a implementací moderních architektur. Rádi vám pomůžeme.

Nezávazná konzultace

Teilen:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.