Cloudlift makes it easier to launch dockerized services in AWS ECS
Project description
Cloudlift
Cloudlift is built by Simpl developers to make it easier to launch dockerized services in AWS ECS.
Cloudlift is a command-line tool for dockerized services to be deployed in AWS ECS. It's very simple to use. That's possible because this is heavily opinionated. Under the hood, it is a wrapper to AWS cloudformation templates. On creating/udpating a service or a cluster this creates/updates a cloudformation in AWS.
Demo videos
Installing cloudlift
1. Pre-requisites
- pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | python get-pip.py
2. Download and Install cloudlift
git clone git@github.com:GetSimpl/cloudlift.git
cd cloudlift
./install-cloudlift.sh
2. Configure AWS
aws configure
Enter the AWS Access Key ID, AWS Secret Access Key. You can find instructions here on how to get Access Key ID and Secret Access Key here at http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
Usage
Create a new environment
Create a new environment for services to be deployed. Cloudlift creates a new VPC for the given CIDR and sets up the required networking infrastructure for services to run in ECS.
cloudlift create_environment -e <environment-name>
This starts a prompt for required details to create an environment, which includes -
- AWS region for the environment
- VPC CIDR
- NAT Elastic IP allocation ID
- 2 Public Subnet CIDRs
- 2 Private Subnet CIDRs
- Minimum instances for cluster
- Maximum instances for cluster
- SSH key name
- SNS ARN for notifications
- AWS ACM ARN for SSL certificate
Once the configuration is saved, this is opened in the default VISUAL
editor.
Here configurations can be changed if required.
Update an environment
cloudlift update_environment -e <environment-name>
This opens the environment configuration in the VISUAL
editor. Update this to
make changes to the environment.
Create a new service
1. Upload configuration to Parameter Store
During create_service and deployment cloudlift
pulls the config from AWS
Parameter Store to apply it on the task definition. Configurations are stored in
path with the convention /<environment>/<service>/<key>
cloudlift edit_config -e <environment-name>
NOTE: This is not required for every deployment. It's required only when config needs to be changed.
2. Create service
In the repository for the application, run -
cloudlift create_service -e <environment-name>
This opens the VISUAL
editor with default config similar to -
{
"services": {
"Test123": {
"command": null,
"http_interface": {
"container_port": 80,
"internal": false,
"restrict_access_to": [
"0.0.0.0/0"
]
},
"memory_reservation": 1000
}
}
}
Definitions -
services
: Map of all ECS services with configuration for current application
command
: Override command in Dockerfile
http_interface
: Configuration for HTTP interface if required, do not include
this if the services does not require a HTTP interface
container_port
: Port in which the process is exposed inside container
internal
: Scheme of loadbalancer. If internal, the loadbalancer is accessible
only within the VPC
restrict_access_to
: List of CIDR to which HTTP interface is restricted to.
memory_reservation
: Memory size reserved for each task in MBs. This is a soft
limit, i.e. at least this much memory will be available, and upto whatever
memory is free in running container instance.
3. Deploy service
cloudlift deploy_service -e <environment-name>
6. Starting shell on container instance for service
You can start a shell on a container instance which is running a task for given
application using the start_session
command. One pre-requisite for this is
installing the session manager plugin for awscli
. To install session manager
plugin follow the guide
cloudlift start_session -e <environment-name>
MFA code can be passed as parameter --mfa
or you will be prompted to enter
the MFA code.
Contributing to cloudlift
Tests
First level of tests have been added to assert cloudformation template generated vs expected one.
py.test test/deployment/
To run high level integration tests
pytest -s test/test_cloudlift.py
This tests expects to have an access to AWS console. Since there's no extensive test coverage, it's better to manually test the impacted areas whenever there's a code change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file cloudlift-1.0.4.tar.gz
.
File metadata
- Download URL: cloudlift-1.0.4.tar.gz
- Upload date:
- Size: 34.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 205ba472e2ad1170ceda5a65829f3b041315b0c4ab82ff9feb8ce0c3e9081bb4 |
|
MD5 | b1a2a7480ea438d3fdfcf44921d88d35 |
|
BLAKE2b-256 | 11052f64fb355d13e2f101cc25f4f1c858d55d7ef81be8159277b79950734704 |
File details
Details for the file cloudlift-1.0.4-py3.7.egg
.
File metadata
- Download URL: cloudlift-1.0.4-py3.7.egg
- Upload date:
- Size: 102.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e6f9b4b2611f7f83ce6f59304130f9da71d29f1bd5abe51ea1cc81d3f688266 |
|
MD5 | 27bb5130584b2f090f63cdc57d11fe85 |
|
BLAKE2b-256 | b8307f0d920713687b1ed4037959bde64208243a492de54d509e681e6e5775a3 |
File details
Details for the file cloudlift-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: cloudlift-1.0.4-py3-none-any.whl
- Upload date:
- Size: 43.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8335bbb71cc812853f17e0664133add4295d6ed08dddc8a11605424e8dbabb06 |
|
MD5 | e1a2e965fb6d7781dc1d2c8531961d15 |
|
BLAKE2b-256 | 8ab1a2e09882f9e6ebedd027b21426d80e91718d3358d0518646ac06ec269227 |