docs: add Terraform certification notes and tasks

This commit is contained in:
2026-08-04 23:18:47 +02:00
parent 91a1849009
commit 758182a700
53 changed files with 4588 additions and 0 deletions

53
terraform/007/main.tf Normal file
View File

@@ -0,0 +1,53 @@
# terraform {
# required_providers {
# aws = {
# source = "hashicorp/aws"
# version = "~> 6.0"
# }
# tls = {
# source = "hashicorp/tls"
# version = "~> 4.0"
# }
# }
# }
# provider "aws" {
# region = "us-east-1"
# }
# --- New RSA key pair ---
resource "tls_private_key" "devops_kp" {
algorithm = "RSA"
rsa_bits = 4096
}
resource "aws_key_pair" "devops_kp" {
key_name = "devops-kp"
public_key = tls_private_key.devops_kp.public_key_openssh
}
# --- Default VPC + its default security group ---
data "aws_vpc" "default" {
default = true
}
data "aws_security_group" "default" {
vpc_id = data.aws_vpc.default.id
name = "default"
}
# --- EC2 instance ---
resource "aws_instance" "devops_ec2" {
ami = "ami-0c101f26f147fa7fd"
instance_type = "t2.micro"
key_name = aws_key_pair.devops_kp.key_name
vpc_security_group_ids = [data.aws_security_group.default.id]
credit_specification {
cpu_credits = "standard"
}
tags = {
Name = "devops-ec2"
}
}