NEW: first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
packer {
|
||||||
|
required_plugins {
|
||||||
|
amazon = {
|
||||||
|
version = ">= 1.2.8"
|
||||||
|
source = "github.com/hashicorp/amazon"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
source "amazon-ebs" "al2023" {
|
||||||
|
ami_name = "learn-packer-linux-aws"
|
||||||
|
instance_type = "t3.micro"
|
||||||
|
region = "ap-east-1"
|
||||||
|
vpc_id = "vpc-01a10b033169f89a8"
|
||||||
|
subnet_filter {
|
||||||
|
filters = {
|
||||||
|
"tag:Name" = "*shared*"
|
||||||
|
}
|
||||||
|
most_free = true
|
||||||
|
random = false
|
||||||
|
}
|
||||||
|
encrypt_boot = true
|
||||||
|
source_ami_filter {
|
||||||
|
filters = {
|
||||||
|
name = "al2023-ami-2023*-kernel-6.1-x86_64"
|
||||||
|
root-device-type = "ebs"
|
||||||
|
virtualization-type = "hvm"
|
||||||
|
}
|
||||||
|
most_recent = true
|
||||||
|
owners = ["910595266909"]
|
||||||
|
}
|
||||||
|
ssh_username = "ec2-user"
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
name = "learn-packer"
|
||||||
|
sources = [
|
||||||
|
"source.amazon-ebs.al2023"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
packer {
|
||||||
|
required_plugins {
|
||||||
|
docker = {
|
||||||
|
version = ">= 1.0.8"
|
||||||
|
source = "github.com/hashicorp/docker"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
source "docker" "ubuntu" {
|
||||||
|
image = "alpine:latest"
|
||||||
|
commit = true
|
||||||
|
}
|
||||||
|
|
||||||
|
build {
|
||||||
|
name = "learn-packer"
|
||||||
|
sources = [
|
||||||
|
"source.docker.ubuntu"
|
||||||
|
]
|
||||||
|
post-processor "docker-tag" {
|
||||||
|
repository = "packer/alpine"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user