Skip to main content

No project description provided

Project description

EC2 Manager

Publish Package

A python wrapper around a terraformed ec2 deployment. It awaits instances till their done initializing and allows the user more control over updating or not updating particular instances.

Dependencies

  • Terraform The python package deploys a terraform module.
  • AWS CLI Boto3 commands check the instance status and send it ssm commands.
  • GitHub Optional methods that clone a repo on your ec2.
  • Docker Optional methods that run compose up and down on your instance.
  • Python

Installation

You can install this package with pip by running the command below.

pip install ec2-manager

Usage

Here is a basic example of

config.yaml

# globals
type: some-group-name
aws_region: us-east-1
vpc_name: "Default VPC"
public_subnet_cidr: "172.31.64.0/20"

# instance configurations
instances:
  instance-1:
    update: True

custom_manager.py

import ec2_manager

class CustomManager(ec2_manager.EC2Manager):
    def update(self):
        """
        Update the bots according to the config.
        """
        self.create_instances()
        self.update_repos()
        self.stop()
        self.start()

if __name__ == '__main__':
    custom_manager = ec2_manager.CustomManager()
    custom_manager.update()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ec2-manager-0.0.2.tar.gz (10.8 kB view hashes)

Uploaded Source

Built Distribution

ec2_manager-0.0.2-py3-none-any.whl (12.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page