Skip to content

nickschuch/docker-volume-efs

Repository files navigation

Docker Volume Plugin: AWS EFS

Docker plugin for AWS EFS (Elastic File System)

This plugin performs the following actions:

  • Detect the VPC Subnet which the AWS host is placed (uses the DescribeInstance API endpoint)
  • Automatically detect the region which the AWS host is placed
  • Create an EFS Filesystem if it does not exist
  • Create an EFS Mount Point if it does not exist
  • Mount to the local filesystem and into the container environment

Acknowledgements

Roadmap

  • Check if the system has NFS utils installed (at boot)

Requirements

Usage

Start the plugin

$ sudo ./docker-volume-efs

Start a container with this plugin as the file storage backend

$ docker run --rm -it --volume-driver=efs -v foo:/no busybox

This results in:

  • A new EFS Filesystem called "foo" being created
  • The EFS Filesystem mounted onto the host and into the container

IAM Role

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:CreateNetworkInterface",
        "ec2:DeleteNetworkInterface",
        "ec2:Describe*",
        "ec2:ModifyNetworkInterfaceAttribute",
        "elasticfilesystem:*"
      ],
      "Resource": "*"
    }
  ]
}

Credentials

Before using the tool, ensure that you've configured credentials. The best way to configure credentials on a development machine is to use the ~/.aws/credentials file, which might look like:

[default]
aws_access_key_id = AKID1234567890
aws_secret_access_key = MY-SECRET-KEY

You can learn more about the credentials file from this blog post.

Alternatively, you can set the following environment variables:

AWS_ACCESS_KEY_ID=AKID1234567890
AWS_SECRET_ACCESS_KEY=MY-SECRET-KEY

About

Docker plugin for AWS EFS (Elastic File System)

Resources

Stars

Watchers

Forks

Packages

No packages published