This repository contains the source code that implements the AWS cloud provider for the Recode CLI.
recode aws start recode-sh/workspace --instance-type t2.mediumrecode_intro.mp4
To begin, create your first development environment using the command:
recode aws start <repository>
Once started, you could stop it at any time, to save costs, using the command:
recode aws stop <repository>
If you don't plan to use this development environment again, you could remove it using the command:
recode aws remove <repository>
<repository> may be relative to your personal GitHub account (eg: cli) or fully qualified (eg: my-organization/api).
Usage:
recode aws [command]
Examples:
recode aws start recode-sh/api --instance-type m4.large
recode aws stop recode-sh/api
recode aws remove recode-sh/api
Available Commands:
remove Remove a development environment
start Start a development environment
stop Stop a development environment
uninstall Uninstall Recode from your AWS account
Flags:
-h, --help help for aws
--profile string the configuration profile to use to access your AWS account
--region string the region to use to access your AWS account
Use "recode aws [command] --help" for more information about a command.In order to access your AWS account, the Recode CLI will first look for credentials in the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_REGION environment variables.
If not found, the configuration files created by the AWS CLI (via aws configure) will be used.
If you have configured the AWS CLI with multiple configuration profiles, you could tell Recode which one to use via the --profile flag:
recode aws --profile production start recode-sh/workspaceBy default, Recode will use the profile named default.
If you want to overwrite the region resolved by the Recode CLI, you could use the --region flag:
recode aws --region eu-west-3 start recode-sh/workspaceYour credentials must have certain permissions attached to be used with Recode. See the next sections to learn more about the actions that will be done on your behalf.
To be used with Recode, the chosen instance must be an on-demand linux instance with EBS support running on an amd64 or arm64 architecture.
t2.medium, m6g.large, a1.xlarge, c5.12xlarge...The schema above describe all the components that may be created in your AWS account. The next sections will describe their lifetime according to your use of the Recode CLI.
recode aws start recode-sh/workspace --instance-type t2.mediumA DynamoDB table named recode-config-dynamodb-table will be created. This table will be used to store the state of the infrastructure.
Once created, all the following components will also be created:
-
A
VPCnamedrecode-vpcwith an IPv4 CIDR block equals to10.0.0.0/16to isolate your infrastructure. -
A
public subnetnamedrecode-public-subnetwith an IPv4 CIDR block equals to10.0.0.0/24that will contain the instances. -
An
internet gatewaynamedrecode-internet-gatewayto let the instances communicate with internet. -
A
route tablenamedrecode-route-tablethat will allow egress traffic from your instances to the internet (via the internet gateway).
What will be done when running the start command will depend on the state of the development environment that you want to start:
-
If the development environment doesn't exist, the following components will be created:
-
A
security groupnamedrecode-${DEV_ENV_NAME}-security-groupto let the instance acceptSSHconnections on port2200. -
A
SSH key pairnamedrecode-${DEV_ENV_NAME}-key-pairto let you access the instance viaSSH. -
A
network interfacenamedrecode-${DEV_ENV_NAME}-network-interfaceto enable network connectivity in the instance. -
An
EC2 instancenamedrecode-${DEV_ENV_NAME}-instancewith a type equals to the one passed via the--instance-typeflag ort2.mediumby default. -
An
EBS volumeattached to the instance (default to16GB).
-
-
If the development environment exists but is stopped, a request to start the stopped
EC2 instancewill be sent. -
If the development environment exists and is started, nothing will be done.
recode aws stop recode-sh/workspaceWhat will be done when running the stop command will depend on the state of the development environment that you want to stop:
-
If the development environment is started, a request to stop the started
EC2 instancewill be sent. -
If the development environment is already stopped, nothing will be done.
recode aws remove recode-sh/workspaceWhen running the remove command, all the components associated with the development environment will be removed.
In other words:
-
The
EC2 instance. -
The
network interface. -
The
EBS volume. -
The
SSH key pair. -
The
security group.
recode aws uninstallWhen running the uninstall command, all the shared components will be removed.
In other words:
-
The
route table. -
The
internet gateway. -
The
public subnet. -
The
VPC. -
The
DynamoDB table.
The costs of running a development environment on AWS are essentially equal to the costs of the EC2 instance and the EBS volume:
-
For the
EC2instance, the price depends on the instance type chosen. -
For the
EBSvolume, Recode uses theGeneral Purpose SSD (gp2) Volumesthat will cost you ~$0.10 per GB-month.
All other components are free (or mostly free) given their limited usage. Once a development environment is stopped, you will still be charged for the EBS volume.
This project is 100% community-driven, meaning that except for bug fixes no more features will be added.
The only features that will be added are the ones that will be posted as an issue and that will receive a significant amount of upvotes (>= 10 currently).
Recode is available as open source under the terms of the MIT License.


