Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ec2-manager

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ec2-manager

  • 0.0.61
  • PyPI
  • Socket score

Maintainers
1

EC2 Manager

Publish Package

A python wrapper around a terraform ec2 deployment. It awaits instances till their done initializing and allows the user more control over updating or not updating particular instances. It also streamlines project setup and deployments with GitHub workflows.

Dependencies

  • Terraform The python package deploys a terraform module.
  • AWS CLI Boto3 commands check the instance status and send it ssm commands.
  • GitHub The deployment updates based on a GitHub repo.
  • Docker Centered around docker deployments, but it is not a requirement.
  • Python The tool is written is 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

  1. Setup your project and make sure to check it into GitHub
    ec2-manger init
    
    This will setup your repo with a template and a config that looks like this:

    config.yaml

    # globals
    type: example
    aws_region: us-east-1
    vpc_name: "Default VPC"
    public_subnet_cidr: "172.31.0.0/20"
    
    # instance configurations
    instances:
      example-instance-1:
        instance_type: t4g.nano
        update: True
        volume_size: 8
        commands:
          start: "docker-compose up --detach"
          stop: "docker-compose down"
        envs:
          EXAMPLE: HelloWorld
        ports:
          - protocol: tcp
            from_port: 80
            to_port: 80
    
    
  2. Add your secrets to your repo via the prompts
    ec2-manger set-secrets
    
  3. Apply your changes to deploy, or use the workflow in the template to auto deploy on push.
    ec2-manger apply
    

Override

You can subclass ec2-manager to script in any custom steps or additional remote commands.

override.py

import ec2_manager

class CustomManager(ec2_manager.EC2Manager):
    def update(self):
        print('Override!!')
        self.create_instances()
        self.update_repos()
        self.stop()
        self.start()

Then run ec2-manager with the override.py in the working directory and it will use that class instead!

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc