Is it possible to create AWS Linux instance on the fly so that it could pull a source code from a private gihub repository? My main obstacle is that github requires private keys which I assumably should generate on my Linux instance and manually insert into github profile on site. Can this be automated?
2 Answers
You could automate this using an EBS instance and creating an AMI to launch new instances off of.
You could setup a script that would run on boot - check to see if the code was pulled, and if not: set it up. (e.g.: /etc/rc.local
and have that run a custom bash script )
You'd have to load your key in manually just that time (And any subsequent time should your github key change).
Then, any time you spin up a new instance of your AMI it would perform this check/get operation on boot.
Should your infrastructure require a more sophisticated method of everything, you could utilize puppet
or chef
on a 'command server' to manage this deployment more intelligently from a single host and not a bundled AMI.

- 4,716
- 21
- 38
I suggest creating an AMI that has puppet installed. You can then use that as a base to configure any number of images with any number of profiles from one AMI image.
Centralized configuration == automatic deployment and a simplified life. In this particular case, your private key that you generated would be part of a file that is distributed to the relevant instance(s).

- 20,547
- 2
- 62
- 85