Good morning.
I’m new on packer, and I’m trying to build an AMI with this repo:
https://github.com/hashicorp-education/learn-packer-windows-ami
On source block, I just modified the name of the “source_ami_filter” name (to use a Windows 2022), and added some AWS stuff like:
- VPC
- Subnet
- Key pair
- Security groups
The build launch correctly, but after 30 minutes fails (I tried with private only, and private + public address):
==> learn-packer.amazon-ebs.firstrun-windows: Prevalidating any provided VPC information
==> learn-packer.amazon-ebs.firstrun-windows: Prevalidating AMI Name: packer-windows-demo-20251202095209
==> learn-packer.amazon-ebs.firstrun-windows: Found Image ID: ami-03fcec7e979752797
==> learn-packer.amazon-ebs.firstrun-windows: Found VPC ID: vpc-aaaaaaaaaaaaa
==> learn-packer.amazon-ebs.firstrun-windows: Found Subnet ID: subnet-bbbbbbbbbb
==> learn-packer.amazon-ebs.firstrun-windows: Using existing SSH private key
==> learn-packer.amazon-ebs.firstrun-windows: Launching a source AWS instance…
==> learn-packer.amazon-ebs.firstrun-windows: Instance ID: i-083a4a3c609463749
==> learn-packer.amazon-ebs.firstrun-windows: Waiting for instance (i-083a4a3c609463749) to become ready…
==> learn-packer.amazon-ebs.firstrun-windows: Skipping waiting for password since WinRM password set…
==> learn-packer.amazon-ebs.firstrun-windows: Using WinRM communicator to connect: 10.xxx.yyyy.zzz
==> learn-packer.amazon-ebs.firstrun-windows: Waiting for WinRM to become available…
==> learn-packer.amazon-ebs.firstrun-windows: Timeout waiting for WinRM.
==> learn-packer.amazon-ebs.firstrun-windows: Terminating the source AWS instance…
==> learn-packer.amazon-ebs.firstrun-windows: Cleaning up any extra volumes…
==> learn-packer.amazon-ebs.firstrun-windows: No volumes to clean up, skipping
Build ‘learn-packer.amazon-ebs.firstrun-windows’ errored after 31 minutes 36 seconds: Timeout waiting for WinRM.==> Wait completed after 31 minutes 36 seconds
==> Some builds didn’t complete successfully and had errors:
→ learn-packer.amazon-ebs.firstrun-windows: Timeout waiting for WinRM.==> Builds finished but no artifacts were created.
I guess that seems the winrm configuration is not executed:
user_data_file = “./bootstrap_win.txt”
Could some one guide me with this issue?.
Thank you