When you create a new EC2 instance, you usually would like to install some software on top of the OS during the creation process. But unlike Linux, Windows doesn't come a package manager like yum or apt. Chocolatey is such a package manager that can either be used for free with community-made packages or as an enterprise solution with a custom repository.
To install and manage software automatically on instance launch, paste the code below into the UserData field.
This will install Chocolatey package manager first. Then you can install software packages from Chocolatey's community repository as shown below via choco install -y
.