Packer Version: 1.5.6
Platform: AWS (EC2)
OS: Windows 1903
Hi -
I'm building Windows 1903 AMIs using Packer 1.5.6.
I originally ran into the dreaded "Waiting for WinRM to become available.." error, but found that most docs suggested adding a user data script to enable/configure WinRM on the Packer Build instance. That worked fine.
Because it's Windows, as part of my Packer provisioning, I then run the EC2 Launch scripts to:
1. Initialize the instance so that User Data will run when the AMI is booted.
2. Sysprep the instance.
That all seems to work fine.
However, now my issue is that when I create a new EC2 instance off of my Packer AMI, the user data runs the WinRM config from my original Packer instance.
This was confirmed by checking C:\ProgramData\Amazon\EC2-Windows\Launch\Log\UserdataExecution.log on a child instance created from the Packer AMI
I cannot specify a new user data script to work with my custom AMI because of this; my new user data is ignored and the original WinRM user data script is executed instead.
I'm assuming this is because it was sysprepped into the AMI. Is this the intended behavior or is there a workaround for this?