Skip to main content

Running VS Code Server on AWS

Project description

Source Build Status ESLint Code Formatting Latest release GitHub npm typescript

cdk-vscode-server

Running your dev IDE vscode on AWS for development and workshop purposes.

[!Note] This construct is designed for workshop purposes and does not fulfill all security and authentication best practices.

EXPERIMENTAL
This is an early version of the package. The API will change while I we implement new features. Therefore make sure you use an exact version in your package.json before it reaches 1.0.0.

Table of Contents

Features

  • Quick Setup: Spin up and configure your vscode server in under 10 minutes in your AWS account
  • 📏 Best Practice Setup: Set up with projen and a single configuration file to keep your changes centralized.
  • 🤹‍♂️ Pre-installed packages: Besides the vscode server, other tools and software packages such as git, docker, awscli nodejs and python are pre-installed on the EC2 instance.
  • 🌐 Custom Domain Support: Use your own domain name with automatic ACM certificate creation and Route53 DNS configuration, or bring your existing certificate.
  • 🏗️ Extensibility: Pass in properties to the construct, which start with additional*. They allow you to extend the configuration to your needs. There are more to come...

Usage

Actually we supported 2 modes:

Standard

The following steps get you started:

  1. Create a new awscdk-app via
npx projen new awscdk-app-ts --package-manager=npm
  1. Add @mavogel/cdk-vscode-server as a dependency to your project in the .projenrc.ts file
  2. Run npx projen to install it
  3. Add the following to the src/main.ts file:
import { App, Stack, StackProps } from 'aws-cdk-lib';
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as iam from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';
import {
  LinuxArchitectureType,
  LinuxFlavorType,
  VSCodeServer
} from '@mavogel/cdk-vscode-server';

export class MyStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps = {}) {
    super(scope, id, props);

    new VSCodeServer(this, 'vscode', {
      // for example (or simply use the defaults by not setting the properties)
      instanceVolumeSize: 8,
      instanceClass: ec2.InstanceClass.M7G,
      instanceSize: ec2.InstanceSize.LARGE,
      instanceOperatingSystem: LinuxFlavorType.UBUNTU_22,
      instanceCpuArchitecture: LinuxArchitectureType.ARM,

      // 👇🏽 or if you want to give the InstanceRole more permissions
      additionalInstanceRolePolicies: [
        new iam.PolicyStatement({
          effect: iam.Effect.ALLOW,
          actions: [
            'codebuild:*',
          ],
          resources: [
            `arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,
          ],
        }),
      ]

      // and more... 💡
    });
  }
}

const env = {
  account: '123456789912',
  region: 'eu-central-1',
};

const app = new App();
new MyStack(app, 'vscode-server', { env });
app.synth();

and deploy it

npx projen build
npx projen deploy

with the output

✨  Deployment time: 509.87s

Outputs:
dev.vscodedomainName6729AA39 = https://d1foo65bar4baz.cloudfront.net/?folder=/Workshop
dev.vscodepassword64FBCA12 = foobarbaz

See the examples folder for more inspiration.

Custom Domain Configuration

You can configure your VS Code Server with a custom domain name instead of using the default CloudFront domain. The construct supports three different configuration options:

Option 1: Auto-create Certificate with DNS Validation

new VSCodeServer(this, 'vscode', {
  domainName: 'vscode.example.com',
  hostedZoneId: 'Z123EXAMPLE456',  // optional - will auto-discover if not provided
  autoCreateCertificate: true,
});

This will:

  • Create an ACM certificate in us-east-1 (required for CloudFront)
  • Validate the certificate using DNS validation
  • Create a Route53 A record pointing to the CloudFront distribution
  • Configure the CloudFront distribution with the custom domain

Option 2: Use Existing Certificate

new VSCodeServer(this, 'vscode', {
  domainName: 'vscode.example.com',
  hostedZoneId: 'Z123EXAMPLE456',
  certificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',
});

Requirements:

  • Certificate must be in us-east-1 region
  • Certificate must be validated and ready to use
  • Certificate must include the domain name

Option 3: Default (No Custom Domain)

new VSCodeServer(this, 'vscode', {
  // No domain configuration - uses CloudFront default domain
});

For complete examples, see examples/custom-domain/main.ts.

  1. Then open the domain name in your favorite browser and you'd see the following login screen: vscode-server-ui-login
  2. After entering the password, you are logged into VSCode and can start coding :tada:

vscode-server-ui

[!Important] There are issues with copy pasting into the VSCode terminal within the Firefox browser (2025-01-12)

Solution Design

... if you're curious about click here for the details

vscode-server-solution-design

Inspiration

This project was created based on the following inspiration

🚀 Unlock the Full Potential of Your AWS Cloud Infrastructure

Hi, I’m Manuel, an AWS expert passionate about empowering businesses with scalable, resilient, and cost-optimized cloud solutions. With MV Consulting, I specialize in crafting tailored AWS architectures and DevOps-driven workflows that not only meet your current needs but grow with you.


🌟 Why Work With Me?

✔️ Tailored AWS Solutions: Every business is unique, so I design custom solutions that fit your goals and challenges. ✔️ Well-Architected Designs: From scalability to security, my solutions align with AWS Well-Architected Framework. ✔️ Cloud-Native Focus: I specialize in modern, cloud-native systems that embrace the full potential of AWS. ✔️ Business-Driven Tech: Technology should serve your business, not the other way around.


🛠 What I Bring to the Table

🔑 12x AWS Certifications I’m AWS Certified Solutions Architect and DevOps – Professional and hold numerous additional certifications, so you can trust I’ll bring industry best practices to your projects. Feel free to explose by badges

⚙️ Infrastructure as Code (IaC) With deep expertise in AWS CDK and Terraform, I ensure your infrastructure is automated, maintainable, and scalable.

📦 DevOps Expertise From CI/CD pipelines with GitHub Actions and GitLab CI to container orchestration Kubernetes and others, I deliver workflows that are smooth and efficient.

🌐 Hands-On Experience With over 7 years of AWS experience and a decade in the tech world, I’ve delivered solutions for companies large and small. My open-source contributions showcase my commitment to transparency and innovation. Feel free to explore my GitHub profile


💼 Let’s Build Something Great Together

I know that choosing the right partner is critical to your success. When you work with me, you’re not just contracting an engineer – you’re gaining a trusted advisor and hands-on expert who cares about your business as much as you do.

✔️ Direct Collaboration: No middlemen or red tape – you work with me directly. ✔️ Transparent Process: Expect open communication, clear timelines, and visible results. ✔️ Real Value: My solutions focus on delivering measurable impact for your business.

Schedule your call


🙌 Acknowledgements

Big shoutout to the amazing team behind Projen! Their groundbreaking work simplifies cloud infrastructure projects and inspires us every day. 💡

Author

Manuel Vogel

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

cdk_vscode_server-0.0.60.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_vscode_server-0.0.60-py3-none-any.whl (2.8 MB view details)

Uploaded Python 3

File details

Details for the file cdk_vscode_server-0.0.60.tar.gz.

File metadata

  • Download URL: cdk_vscode_server-0.0.60.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cdk_vscode_server-0.0.60.tar.gz
Algorithm Hash digest
SHA256 c606cea0316da34322ced42da1af0186f348dad00a6ded8b20bb143a5249e3d6
MD5 ce95ddfbb1711cae351fdc5f5fcb12dc
BLAKE2b-256 5c1de89b6540d37de96c3adbf886fc136331a6041d001965a4ff2a0d76238331

See more details on using hashes here.

File details

Details for the file cdk_vscode_server-0.0.60-py3-none-any.whl.

File metadata

File hashes

Hashes for cdk_vscode_server-0.0.60-py3-none-any.whl
Algorithm Hash digest
SHA256 f929fe9001a638fa4305981055fbe58842997b1fe60c86e6378d1e5290c9a5af
MD5 a4bfd31149f3c40bffb48658db20e1e3
BLAKE2b-256 e4ebea75bfcf8a42051626971d476919f062a6d32e50ab284d66e0b97aef8de5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page