Skip to main content

No project description provided

Project description

ec2-dev-machine

Overview

This Python package provides a L2 CDK Construct for spinning up a EC2 instance from a YAML configuration to quickly create and manage development instances.

The instances created have public IPs (cheaper than NAT Gateway for single instances) but has no open ports. All access to the instance should be done via System Manager Session Manager.

Usage

Setup CDK

  1. Set up CDK. If unfamiliar with CDK see the Getting Started Guide
  2. Bootstrap your account for CDK deployments.
    cdk bootstrap aws://{account_number}/{region}
    

A Single Instance

  1. Create a configuration file based on the example (config.example.yaml)
  2. Deploy the instance with CDK
    cdk deploy
    

Multiple Instances

Work in progress!

Connecting to an instance

  1. Install the Session Manager plugin for the AWS CLI - Docs

  2. Connect to your instance with Session Manager

    aws ssm start-session --target {instance_id}
    
  3. (Optional) Port Foward SSH to your local machine with SSH, for example if you want to use VSCode Remote-SSH - Docs.

    Windows (Powershell):

    aws ssm start-session `
        --target {instance_id} `
        --document-name AWS-StartPortForwardingSession `
        --parameters portNumber="22",localPortNumber="40000"
    

    Linux/Mac (bash):

    aws ssm start-session \
        --target {instance_id} \
        --document-name AWS-StartPortForwardingSession \
        --parameters "{"portNumber":["22"],"localPortNumber":["40000"]}"
    
  4. (Optional) SSH into your instance

    ssh -i /path/key-pair-name.pem -p 40000 ec2-user@localhost
    

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_dev_machine-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

ec2_dev_machine-0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file ec2_dev_machine-0.1.1.tar.gz.

File metadata

  • Download URL: ec2_dev_machine-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/6.8.0-1014-azure

File hashes

Hashes for ec2_dev_machine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 993b83dd7cd67b453d4ca5d8d896a0bf15232bf1eff9deac81365e0e65f6e42b
MD5 0958c0a566cebdebf44f3b5baa57e94c
BLAKE2b-256 a0e70d6b66a96d667f289861c17edcaff55eeab8f62f77d7d88bb85f39650ef6

See more details on using hashes here.

File details

Details for the file ec2_dev_machine-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ec2_dev_machine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.15 Linux/6.8.0-1014-azure

File hashes

Hashes for ec2_dev_machine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a1413a06bd16c806fb6f63ce6f048d1e4861a917dda8b109d109ed952002f3c
MD5 1d7cac66a473b2b9ccd06ddb67b1da02
BLAKE2b-256 d36dee77141501b9edcbd1d3a50c0189e106c1a1b31849534a47a7aa40e9022a

See more details on using hashes here.

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