AWS Cloud9

A browser-based integrated development environment that provides coding, debugging, and terminal access on EC2 instances

Overview

AWS Cloud9 is a cloud-based integrated development environment (IDE) that lets you write, run, and debug code entirely from a browser. It uses an EC2 instance or an SSH-connected server as its backend, providing syntax highlighting for over 40 programming languages, code completion, and terminal access. With AWS CLI and SAM CLI preinstalled, it excels at AWS development workflows including local testing of Lambda functions and editing CloudFormation templates.

Environment Types and EC2 Instance Lifecycle

Cloud9 offers two types of environments: EC2 environments and SSH environments. In an EC2 environment, Cloud9 automatically launches and manages an EC2 instance, and auto-hibernates it after a configurable idle period (default 30 minutes) once the IDE is closed. This auto-hibernation feature keeps costs down during non-development hours. Instance types range from t2.micro to m5.large - choose a larger instance when computational resources are needed, such as for machine learning prototyping. SSH environments connect to existing on-premises servers or instances on other clouds, suitable when you only want to use Cloud9's editor capabilities. The default storage for EC2 environments is a 10 GB EBS volume, but this often falls short for Docker image builds or large projects, so running a script to expand the EBS volume after environment creation is a common practice. By specifying a VPC and subnet, you can build a development environment with direct access to resources in private subnets.

Collaboration Features and Real-Time Co-Editing

Cloud9's standout feature is real-time collaboration. When the environment owner invites other IAM users, multiple engineers can simultaneously edit the same file, with each user's cursor position displayed in real time. This makes remote pair programming and code reviews more efficient than screen-sharing tools. Access permissions can be set to read-only or read-write when inviting users, enabling scenarios like a senior engineer reviewing and coaching a junior engineer's code in real time. The terminal is also shared in collaborative environments, so everyone can see command execution results simultaneously. However, since the shared terminal runs under the same OS user, caution is needed when performing sensitive operations (such as viewing secrets). A built-in chat feature lets team members discuss specific lines of code while making edits.

AWS Service Integration and SAM Local Testing

Cloud9 environments come with AWS CLI, SAM CLI, Git, and Docker preinstalled, letting you start AWS development without any setup overhead. For Lambda function development, local testing with SAM CLI is particularly useful. The sam local invoke command runs Lambda functions inside a local Docker container, enabling debugging in an environment close to the actual runtime. Cloud9's built-in debugger supports step-through execution for Node.js and Python, with breakpoint setting, variable watching, and call stack inspection all available within the IDE. For CloudFormation template editing, YAML syntax highlighting and auto-indentation work out of the box, along with resource type input completion. IAM credentials are automatically obtained through the EC2 instance profile, eliminating the need to hardcode access keys. Enabling the AWS Toolkit plugin adds sidebar access to Lambda function listings, CloudWatch Logs browsing, and S3 bucket navigation directly from the IDE.

共有するXB!