base build for debian

This commit is contained in:
Ibrahim Mkusa 2024-11-16 22:26:04 -05:00
parent 6e12b1cdfc
commit d2315eeb28

View File

@ -27,7 +27,7 @@ source "amazon-ebs" "debian" {
region = "us-east-1" region = "us-east-1"
source_ami_filter { source_ami_filter {
filters = { filters = {
name = "Debian 12" image-id = "ami-064519b8c76274859"
root-device-type = "ebs" root-device-type = "ebs"
virtualization-type = "hvm" virtualization-type = "hvm"
@ -40,50 +40,10 @@ source "amazon-ebs" "debian" {
} }
source "amazon-ebs" "amazon" {
ami_name = "${var.ami_prefix}-amazon-${local.timestamp}"
instance_type = "t2.medium"
region = "us-east-1"
source_ami_filter {
filters = {
name = "Amazon Linux 2023 AMI"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["amazon"]
}
ssh_username = "ec2-user"
}
source "amazon-ebs" "redhat" {
ami_name = "${var.ami_prefix}-redhat-${local.timestamp}"
instance_type = "t2.medium"
region = "us-east-1"
source_ami_filter {
filters = {
name = "Red Hat Enterprise Linux 9 (HVM)"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["309956199498"]
}
ssh_username = "ubuntu"
}
build { build {
name = "AMIs for homelab use" name = "AMIs for homelab use"
sources = [ sources = [
"source.amazon-ebs.debian", "source.amazon-ebs.debian",
"source.amazon-ebs.amazon",
"source.amazon-ebs.redhat"
] ]
provisioner "shell" { provisioner "shell" {
@ -92,7 +52,7 @@ build {
provisioner "file" { provisioner "file" {
source = "files/id_rsa.pub" source = "files/id_rsa.pub"
destination = "/home/" destination = "/home/admin/"
} }