GO-ATtach: attach and RAID EBS volumes + ENIs
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
execute
filesystem
rpm-package
vendor
.gitignore
GNUmakefile
Gopkg.lock
Gopkg.toml
LICENSE
README.md
attach.go
ebs.go
ec2.go
eni.go
main.go

README.md

ReportCard GitHub tag

goat 🐐

Attach EBS volumes and ENIs to running EC2 instances

goat is a Go application which runs from inside the EC2 instance.

By setting your tags correctly, goat can discover and attach EBS volumes and ENIs. Furthermore, for EBS volumes, it can perform additional actions such as RAID (with mdadm), mkfs, and mount EBS volumes to the EC2 instance where it's running.

The goat package consists of the subcommands goat ebs and goat eni.

Permission model

It's necessary for the instance to have an IAM Role with at least access to the EBS and ENI resources that it will be attaching - see here. Your roles can be even more permissive (i.e. full EC2 access) but that comes with its own risks.

Unfortunately, resource-level permissions are currently not supported for attaching network interfaces. This means that to use goat@eni, your instances must have full permissions for all ENIs.

RPM-based install

Goat is systemd-based and has been developed for CentOS. Install the rpm from the releases page:

$ sudo yum install -y https://github.com/sevagh/goat/releases/download/0.6.0/goat-0.6.0-1.fc27.x86_64.rpm
$ sudo systemctl enable goat@ebs
$ sudo systemctl start goat@ebs

Additional dependencies for ENI

Goat by itself is sufficient for the EBS feature, but needs help for setting up an ENI. Refer to this document.

Hack

If you have docker locally, you can use the following command in order to quickly get a development env ready: make dev-env.

Examples

Link to the example Terraform HCL scripts.