Howto install AWS CodeDeploy on EC2 Windows instance by using CloudInit

  1. Create user-data.txt file

    New-Item -ItemType Directory -Force -Path c:\temp
    Read-S3Object -BucketName aws-codedeploy-us-east-1/latest -Key codedeploy-agent.msi -File c:\temp\codedeploy-agent.msi
    start c:\temp\codedeploy-agent.msi '/qn /l*v c:\temp\host-agent-install-log.txt'


  2. Go to AWS EC2 console and select Windows image (e.g. Windows_Server-2012-R2_RTM-English-64Bit-Base-2014.10.15 (ami-ba13abd2))
  3. Click Launch/Spot Request
  4. Provide user data as user-data.txt file
  5. Now you will get Windows instance with AWS CodeDeploy installed. Enjoy!