I’ve been trying to get this too work for 3 days now, nothing seems to work.
Could you please help me out or I have to change the solution.
image.pkr.hcl
variable "region" {
type = string
default = "us-east-1"
}
source "amazon-ebs" "example" {
ami_name = "packer_tag_example {{timestamp}}"
instance_type = "t2.micro"
region = var.region
source_ami_filter {
filters = {
name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["099720109477"]
}
ssh_username = "ubuntu"
ssh_pty = true
run_tags = {
Name = "Test Packer"
c-domain = "atlassian"
c-subdomain = "atlassian"
c-service = "bitubcket_prod"
c-env = "prod"
c-team = "atlassian-team"
c-criticality = "high"
resource_owner = "bplump"
service_name = "aws_ami_packer_builder"
}
tags = {
Name = "Test Packer"
c-domain = "atlassian"
c-subdomain = "atlassian"
c-service = "bitubcket_prod"
c-env = "prod"
c-team = "atlassian-team"
c-criticality = "high"
resource_owner = "bplump"
service_name = "aws_ami_packer_builder"
}
}
build {
sources = ["source.amazon-ebs.example"]
provisioner "file" {
source = "../tf-packer.pub"
destination = "/tmp/tf-packer.pub"
}
provisioner "shell" {
script = "../scripts/setup.sh"
}
}
logs:
2022/07/20 09:45:18 ui error: --> amazon-ebs: Timeout waiting for SSH.
type or paste code here
What am I missing?