After a while, manually deploying my tiny site got a little tedious. As a solution, I decided to automate this deployment using TYPO3 Surf. Since I’m also working with Surf on the job, that task was not too difficult for me. However, the first version of my deployment script did not really “feel” good (you know that feeling when you have built something that works well, but just doesn’t “feel” good, don’t you?):
What would happen, should I decide to delete my teeny-tiny-micro EC2 instance? Or if I decided to operate my site on two (teeny-tiny) micro instances? It appears a lot more elegant to simply retrieve the information on the target nodes directly from the EC2 API. For this, you can use the AWS SDK for php, which can be easily installed using Composer:
$ composer require aws/aws-sdk-php
Here it pays off that in TYPO3 Surf, deployment definitions are simply executable PHP files. That way, you can simply query the AWS API for all instances (optionally filtered by status and a certain tag) and add as a new node to the deployment:
And done! Now I never again have to configure new servers in the deployment configuration.