Package: aegea
Aegeais a command line interface (CLI) that provides a set of essential commands and terminal dashboards for
operators of Amazon Web Services (AWS) accounts. Aegea lets you build AMIs and Docker images using thecloud-initconfig management package, manage config roles, launch and monitor
instances and services, and manage AWS resources including ELB, RDS, and AWS Batch. Aegea is designed to be used in
conjunction with the existing functionality of theAWS CLIandboto3.Installationpip install aegeaRunaws configureto configureIAMaccess credentials that will be used by theawsandaegeacommands. You can create a new IAM key athttps://console.aws.amazon.com/iam/home#/users. See theAWS CLI documentationfor more details.Aegea commandsBelow are some highlights from Aegea’s suite of commands. Runaegea--helpto see the full list of commands.CommandKey functionalityaegea lsList running EC2 instancesaegea launchLaunch EC2 instances and specify options such as spot tenancy, AMI, instance type, etc.aegea ssh,aegea scpConnect to running instances, transfer files using AWS Systems Manager or other optionsaegea batchSubmit, manage and monitor AWS Batch jobsaegea ecsMonitor ECS clusters and run Fargate tasksaegea build-amiBuild EC2 AMIs using cloud-init configuration scriptsaegea build-docker-imageBuild AWS ECR docker images using Dockerfiles or cloud-init scriptsaegea logsDownload AWS CloudWatch Logs contents using S3 exportaegea grepQuery AWS CloudWatch Logs contents using CloudWatch Logs Insightsaegea costList AWS cost reports generated by AWS Cost Exploreraegea secretsList and manage secrets stored in AWS Secrets Manageraegea cloudtrailQuery AWS CloudTrail events to audit the security of your AWS accountAegea LaunchTheaegea launchcommand launches EC2 instances. It has integrated support for AWS SSM/EC2 Instance Connect, runtime
cloud-init configuration, automatic location of Aegea-built AMIs or up-to-date Ubuntu or Amazon Linux AMIs, automatic
storage configuration, and other options.Aegea SSHTheaegea sshcommand (and its variantaegea scp) is an SSH configuration wrapper that integrates with theAWS Systems ManagerandEC2 Instance Connectto provide SSH connectivity to your instances without opening any inbound ports (if your instance OS is not configured
with SSM, useaegea ssh--no-ssmto open a direct connection).aegea sshsecurely resolves instance addresses by
name and pre-fetches their public keys without the Trust-On-First-Use requirement.Visual Studio Code Remote Development integrationVisual Studio Codeprovides aremote development extension packwhich allows your
VSCode IDE to connect remotely to AWS instances. To use VSCode with aegea ssh, open the Remote.SSH plugin settings
(command palette > Remote-SSH: Settings) and enter the path to theaegea-sshexecutable under the “Remote.SSH: Path”
setting (for example,/usr/local/bin/aegea-ssh). After doing this, you can use the “Remote-SSH: Connect to Host”
palette command to connect to any aegea-launched instance by name or ID (for example,aegea launchmy-test-instancefollowed by enteringmy-test-instancein theConnect to Hostdialog). Note that VSCode will use the default
AWS CLI profile for authentication.Aegea BatchTheAWS BatchAPI lets you run non-interactive command line workflows in Docker
containers, managing AWS ECS, Fargate, and EC2/Spot in your account on your behalf. Use theaegea batchfamily of
commands to interact with AWS Batch. The key command isaegea batch submitto submit jobs.Runaegea batch submit--command"echo 'hello world'"--memory4096--vcpus2--watchto run a Batch job that requires 4 GB RAM and 2 cores to be allocated to the Docker container,
and executes the specified command.You can also useaegea batch submit--executeFILE. This will slurp up FILE (any type of shell script or ELF
executable) and execute it in the job’s Docker container.The concurrency and cost of your Batch jobs is governed by the “Max vCPUs” setting in your compute environment.
To change the capacity or other settings of the default compute environment used byaegea batch, go tohttps://console.aws.amazon.com/batch/home?region=us-east-1#/compute-environments, select “aegea_batch”, and click
“Edit”.Batch and ECS FargateTheECS FargateAPI is an interface to the AWS container-based virtualization
platform,Firecracker. ECS Fargate allows you to run workloads
in fully managed containers: no instances run in your account; you are billed by the second of container use, and
containers start up within 10 seconds, compared to minutes for EC2 instances.AWS Batch can run your jobs on either ECS Container Instances (EC2 instances connected to ECS that Batch manages in your
account) or directly in ECS Fargate containers. While Fargate containers are much faster to start, they havelower CPU and memory limitsof 4 CPUs and 30 GB RAM (compared to 96 CPUs and 768 GB RAM on EC2).By default,aegea batchwill create and use an AWS Batch compute environment and queue that uses ECS Fargate, but
you can control this by setting the--compute-typeoption toaegea batchcreate-compute-environment.Aegea also supports direct use of ECS Fargate without Batch via theaegea ecs runcommand. Mostaegea batchsemantics are applicable toaegea ecs, which interacts with ECS via the “one shot”ECS RunTaskAPI.Configuration managementAegea supports ingesting configuration from a configurable array of sources. Each source is a JSON or YAML file.
Configuration sources that follow the first source update the configuration using recursive dictionary merging. Sources
are enumerated in the following order of priority:Command line options (values take priority over all other sources)Any sources listed in the colon-delimited variableAEGEA_CONFIG_FILEUser configuration source,~/.config/aegea/config.ymlSite-wide configuration source,/etc/aegea/config.ymlConfiguration defaults frombase_config.ymlArray merge operators: When loading a chain of configuration sources, Aegea uses recursive dictionary merging to
combine the sources. Additionally, when the original config value is a list, Aegea supports array manipulation
operators, which let you extend and modify arrays defined in underlying configurations. For example, to enable full S3
access for all instances launched withaegea launch, add the following to~/.config/aegea/config.yml:launch:
  iam_policies:
    $append: AmazonS3FullAccessTo enable S3 and SQS access, and also list the instance private IP address and availability zone inaegea ls,
add the following:launch:
  iam_policies:
    $extend:
      - AmazonS3FullAccess
      - AmazonSQSFullAccess
ls:
  columns:
    $extend:
      - private_ip_address
      - placement.AvailabilityZoneFor a listing of available configuration parameters that can be set, runaegea configureor seehttps://github.com/kislyuk/aegea/blob/develop/aegea/base_config.yml. Seehttps://github.com/kislyuk/tweak#array-merge-operatorsfor a formal description of the array merge operators.Building AMIs and Docker imagesAegea includes a lightweight configuration management system for building machine images based oncloud-init(both Docker images and AMIs are supported).