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
- Set up CDK. If unfamiliar with CDK see the Getting Started Guide
- Bootstrap your account for CDK deployments.
cdk bootstrap aws://{account_number}/{region}
A Single Instance
- Create a configuration file based on the example (
config.example.yaml
) - Deploy the instance with CDK
cdk deploy
Multiple Instances
Work in progress!
Connecting to an instance
-
Install the Session Manager plugin for the AWS CLI - Docs
-
Connect to your instance with Session Manager
aws ssm start-session --target {instance_id}
-
(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"]}"
-
(Optional) SSH into your instance
ssh -i /path/key-pair-name.pem -p 40000 ec2-user@localhost
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 993b83dd7cd67b453d4ca5d8d896a0bf15232bf1eff9deac81365e0e65f6e42b |
|
MD5 | 0958c0a566cebdebf44f3b5baa57e94c |
|
BLAKE2b-256 | a0e70d6b66a96d667f289861c17edcaff55eeab8f62f77d7d88bb85f39650ef6 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a1413a06bd16c806fb6f63ce6f048d1e4861a917dda8b109d109ed952002f3c |
|
MD5 | 1d7cac66a473b2b9ccd06ddb67b1da02 |
|
BLAKE2b-256 | d36dee77141501b9edcbd1d3a50c0189e106c1a1b31849534a47a7aa40e9022a |