We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78fc607 commit 91c0ef1Copy full SHA for 91c0ef1
template.pkr.hcl
@@ -0,0 +1,37 @@
1
+packer {
2
+ required_plugins {
3
+ amazon = {
4
+ version = ">= 1.0.0"
5
+ source = "github.com/hashicorp/amazon"
6
+ }
7
8
+}
9
+
10
+source "amazon-ebs" "my_vm" {
11
+ region = "us-east-1"
12
+ source_ami = "ami-04b4f1a9cf54c11d0"
13
+ instance_type = "t3.micro"
14
+ ssh_username = "ubuntu"
15
+ ami_name = "my-vm-image-${formatdate("YYYYMMDD-hhmmss", timestamp())}"
16
17
+ #temporary_key_pair_type = "ed25519"
18
19
20
+build {
21
+ sources = [
22
+ "source.amazon-ebs.my_vm"
23
+ ]
24
25
+ provisioner "file" {
26
+ source = "main.py"
27
+ destination = "/tmp/main.py"
28
29
30
+ provisioner "shell" {
31
+ inline = [
32
+ "sudo apt-get update",
33
+ "sudo apt-get install -y python3-pip",
34
+ "python3 /tmp/main.py"
35
36
37
0 commit comments