diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..86ebfc5 --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,56 @@ | |||
1 | # Tiny EC2 Bootstrapper | ||
2 | |||
3 | This is designed to do the minimal amount of work required to bootstrap an EC2 | ||
4 | instance based on the local settings assigned at boot time as well as the | ||
5 | user's configured settings. This is in-concept similar to | ||
6 | [cloud-init](https://cloudinit.readthedocs.io/en/latest/) but trades features | ||
7 | and cloud platform support for small size and limited external dependencies. | ||
8 | |||
9 | ## Requirements | ||
10 | |||
11 | The most important feature of this bootstrapper is the very limited set of | ||
12 | dependencies. In-fact this works with just busybox provided the wget applet is | ||
13 | built-in. The only required dependencies are: | ||
14 | |||
15 | - bash-like shell (e.g. bash, dash, ash) | ||
16 | - wget | ||
17 | |||
18 | ## Supported Features and Environments | ||
19 | |||
20 | cloud-init has support for many different cloud providers. This project only | ||
21 | supports EC2, specifically the [EC2 metadata | ||
22 | service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) | ||
23 | is a hard requirement of using this bootstrapper. All of the data for the | ||
24 | supported features below is sourced from the EC2 instance metadata service | ||
25 | which runs on every EC2 instance at IP 169.254.169.254. | ||
26 | |||
27 | cloud-init also has a very rich feature set with support for adding users, | ||
28 | installing packages, and many other things. This bootstrap does not support | ||
29 | those things. Instead it supports: | ||
30 | |||
31 | - setting system hostname | ||
32 | - install user's configured SSH keys to the alpine user's authorized_keys file | ||
33 | - run any script-like user data (must start with #!) | ||
34 | |||
35 | These steps only run once. After the initial bootstrap the bootstrapper script | ||
36 | is a no-op. To force the script to run again at boot time remove the file | ||
37 | `/var/lib/cloud/.bootstrap-complete` and reboot the instance. | ||
38 | |||
39 | ## User Data | ||
40 | |||
41 | User data is provided at instance boot time and can be any arbitrary string of | ||
42 | data. The bootstrapper will consider any user data that begins with the ASCII | ||
43 | characters '#!' to be a script. It will write the entire contents of the user | ||
44 | data to `/var/lib/cloud/user-data.sh`, make the file executable, and execute | ||
45 | the file piping any output to `/var/log/cloud-bootstrap.log`. | ||
46 | |||
47 | The user data script can do anything it pleases with the instance. It will be | ||
48 | run as root and networking will be up. No other grantees about system state are | ||
49 | made at the point the script runs. | ||
50 | |||
51 | ## Assumptions | ||
52 | |||
53 | - This was written for Alpine Linux and thus assumes that the login user is | ||
54 | called alpine. This could be configurable in the future but currently is not. | ||
55 | |||
56 | - The script is run by OpenRC | ||