Package: paaws
PaawsPaaws isa CLI that makes AWS services feel more like a PaaSsuch asHerokuorDokku. It is designed to work with:Elastic Container Service (ECS)for running the application process(es)Parameter Storefor environment variable/secret storageCloudwatch Logsfor loggingSession Managerfor shell accessCodebuildfor building images and testingPaaws was created byLincoln Loopto help developers manage and monitor services running on AWS without needing deep knowledge of the AWS itself. We are currently using it manage services in production.Internally we have created a Terraform module to spin up services usingBuildpacksand aProcfile, allowing developers to run new applications on AWS with very little configuration. We hope to release this as a Terraform and/or Cloudformation module in the future. In the meantime, however, the CLI is designed to work with existing systems via some configuration stored in AWS' Parameter Store.If you're interested in commercial support for Paaws, pleasecontact us.🚧 This is an early release and under active development. APIs and commands may change between releases.InstallationThe CLI requires Python 3.6+. It can be installed via pip:pip install paawsOr you can download the most recent release from theReleasespage and run it viapython3 paaws ...or runchmod +x paawsand run it directly,./paaws ....GoalsDeveloper friendlyDevelopers should be able to use the PaaS without being AWS experts. When in doubt, see how Heroku does it.Cloud nativeLeverage AWS services wherever possible. Avoid running any additional services just to make the PaaS functional. No additional maintenance is required.SecureFollows general best practice and is compatible with locked down IAM policies.Developmentpython -m venv .venv && . .venv/bin/activate
pip install flit
flit install --symlink --deps developIn development, you can run the CLI with:python -m paaws ...DistributionThe app can be bundled into a Python zipapp with shiv:make paaws.pyzTerminologyAWSTask (ECS)One or more containers that are usually run as part of a Service, but may be run as a one-off process, e.g. shell access, release process, etc.Service (ECS)A task that should run forever like a daemon process. Can be scaled up to run multiple instances.Log Group (Cloudwatch)Log storage/aggregationContainer Instance (ECS/EC2)A virtual server that runs the Docker daemon which executes the Tasks. Each Instance is part of a single Cluster (see below)Fargate (ECS)An AWS managed Task runner that does not require running Container Instances.Cluster (ECS)All Tasks run within a Cluster which serves as both a logical and security boundary.Parameter Store (SSM)A set of key/value strings stored with or without encryption. Usually used to inject environment variables into Tasks. Keys use a path-style notation and permissions can include a wildcard, so often keys are defined as/{application_name}/{key}and permissions are granted on/{application_name}/*.PaawsApplicationAn application consists of all the necessary AWS Resources to run. This is typically one or more Services, a Database, a Load Balancer, and multiple Parameters.ConfigurationThe resources associated with an Application are determined via a "sane" set of defaults which can be overridden via configuration in the Parameter Store.The default configuration is generated via the provided app name. Ifmy-appwere your app name, the configuration would be:{"cluster":{"name":"my-app"},"log_group":{"name":"my-app"},"parameter_store":{"prefix":"/my-app","chamber_compatible":false},"codebuild_project":{"name":"my-app"},"shell":{"task_amily":"my-app-shell","command":"bash -l"},"db_utils":{"shell_task_family":"my-app-dbutils-shell","dumpload_task_family":"my-app-dbutils-dumpload","s3_bucket":"myapp-dbutils"},"tags":[]}Thetagsvalue can be used to filter the set of Services and Tasks displayed from the Cluster. Keep in mind this is only a visual separation. IAM permissions are handled at the Cluster level, so no additional security is provided here.OverridesYou can override the defaults by creating a parameter store key named/paaws/apps/{appname}/settingswith a JSON string in it. An example using the AWS CLI:$ aws ssm put-parameter \
  --name /paaws/apps/$APPNAME/settings \
  --value '{"cluster": {"name": "default"}, "log_group": {"name": "/aws/ecs/default/my-app"}}' \
  --type String \
  --overwriteAvailable CommandsbuildsView build informationlistList most recent buildsviewView status for a specific buildlogsView build or test logs for a specific buildconfigView/edit environment variableslistEnvironment variables for applicationsgetGet the value for a variablesetGet the value for a variableunsetUnset (delete) a variabledbPerform database tasksdumpDump database to local fileloadReplace remote database with local dumpshellRun an interactive database shelldeploymentsList deploymentslogsView application logsviewShow application logsconsoleOpen logs in web consolepsShow running containersshellOpen an interactive shell in the remote environmentThanksPaaws is the result of a few years of learning while working with clients hosting applications on ECS. The Paaws CLI was born out of work we've been doing withWharton Interactiveand received their blessing to continue as an independent open source project. Thanks Sarah! 🎉