aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md56
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
3This is designed to do the minimal amount of work required to bootstrap an EC2
4instance based on the local settings assigned at boot time as well as the
5user's configured settings. This is in-concept similar to
6[cloud-init](https://cloudinit.readthedocs.io/en/latest/) but trades features
7and cloud platform support for small size and limited external dependencies.
8
9## Requirements
10
11The most important feature of this bootstrapper is the very limited set of
12dependencies. In-fact this works with just busybox provided the wget applet is
13built-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
20cloud-init has support for many different cloud providers. This project only
21supports EC2, specifically the [EC2 metadata
22service](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
23is a hard requirement of using this bootstrapper. All of the data for the
24supported features below is sourced from the EC2 instance metadata service
25which runs on every EC2 instance at IP 169.254.169.254.
26
27cloud-init also has a very rich feature set with support for adding users,
28installing packages, and many other things. This bootstrap does not support
29those 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
35These steps only run once. After the initial bootstrap the bootstrapper script
36is 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
41User data is provided at instance boot time and can be any arbitrary string of
42data. The bootstrapper will consider any user data that begins with the ASCII
43characters '#!' to be a script. It will write the entire contents of the user
44data to `/var/lib/cloud/user-data.sh`, make the file executable, and execute
45the file piping any output to `/var/log/cloud-bootstrap.log`.
46
47The user data script can do anything it pleases with the instance. It will be
48run as root and networking will be up. No other grantees about system state are
49made 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