Terraform to create an AWS Systems Manager (SSM) RunCommand that can be used to configure an EC2 Windows instance as a bitbucket pipeline runner.
The installation uses WinSW to wrap the runner process as a Windows service and configures it to restart on failure / reboots as described in https://jira.atlassian.com/browse/BCLOUD-21928, also based on https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/
This is for a workspace-level runner.
A repository-level runner requires an extra parameter in the XML file and the SSM document.
Not all of the install scripts are included as they're pretty straightforward (e.g. choco install xyz, apart from the initial install of chocolately (see powershell-scripts/winEc2-choco-install-git.ps1) and disabling of pagefile+swapfile (see powershell-scripts/winEc2-disable-pagefile-and-swapfile.ps1).