Skip to content

Use packer to provision a windows AMI, it installs software using powershell

Notifications You must be signed in to change notification settings

gusse/packer-windows-ami

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Provision a Windows AMI using Packer

Sometimes it's quite challenging to find a standard way of installing software on a windows machine from the command line (at least for me as i'm used to yum install or apt-get, etc).

You could use chocolatey but if for some reason you don't want to have any external dependencies or don't want to host your own chocolatey repo, you could use powershell to install the software in silent mode, that is what I have done and hope it can be help to resolve issues you might be experiencing or inspire you to create something more robust.

Dependencies

  • Install packer
  • There should be a default VPC in your AWS account, otherwise you have to indicate your vpc id which is also fine
  • Packer will authenticate to AWS using your exported AWS* credentials or your ~/.aws/credentials file, do not set any credentials in files that are checked in your code repository.

Usage

There is a variables section on top of the script that is used to define default variables:

"variables": {
  "base_ami_id": ""
}

If default values are present, they can be overridden from the command line, this is how you provision a new AMI from the command line using packer:

packer build -var "base_ami_id=ami-47bf8b24" provision-windows.json

About

Use packer to provision a windows AMI, it installs software using powershell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%