@mavogel/cdk-vscode-server 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.claude/hooks/file_checker.sh +0 -0
  2. package/.jsii +96 -24
  3. package/API.md +56 -0
  4. package/CLAUDE.md +84 -118
  5. package/README.md +48 -0
  6. package/assets/installer/installer.lambda/index.js +14 -2
  7. package/examples/custom-domain/main.ts +49 -0
  8. package/integ-tests/integ.al2023.ts.snapshot/IntegSetupVSCodeOnAl2023DefaultTestDeployAssert74D8F645.assets.json +7 -6
  9. package/integ-tests/integ.al2023.ts.snapshot/IntegSetupVSCodeOnAl2023DefaultTestDeployAssert74D8F645.template.json +6 -6
  10. package/integ-tests/integ.al2023.ts.snapshot/IntegTestStackAl2023.assets.json +20 -12
  11. package/integ-tests/integ.al2023.ts.snapshot/IntegTestStackAl2023.template.json +36 -152
  12. package/integ-tests/integ.al2023.ts.snapshot/{asset.23732f3d1982f7fb0da3bd6638a8107337bb767fea165b45eae12000a1dd67ce → asset.0ad50fc42afd768c3d0bfdd4701e43284fb077a25f19eea1e8c51a5ca36ebfe4}/index.js +988 -1165
  13. package/integ-tests/{integ.ubuntu.ts.snapshot/asset.a9865c9d36c7aa999e28cb7926e7a3a8e0b6d0854b25131a172024c5777442fa.lambda → integ.al2023.ts.snapshot/asset.33da23274e25bd9f43638c5d83dad26e3931cbe78d462ffd9a9f565e948b4f5f.lambda}/index.js +14 -2
  14. package/integ-tests/{integ.ubuntu.ts.snapshot/asset.f692c9f68e4daba2abc99103efd3518bced1e9d7a2a89847b9b5d5473c64f1bd.bundle → integ.al2023.ts.snapshot/asset.530055f7515b3f0a47900f5df37e729ba40ca977b2d07b952bdefa2b8f883f42.bundle}/index.js +296 -191
  15. package/integ-tests/{integ.ubuntu.ts.snapshot/asset.ce2f3595a340d6c519a65888ef97e3b9b64f053f83608e32cc28162e22d7d99a → integ.al2023.ts.snapshot/asset.9d043014be736e8162bcc7ec5590cc6d2ff24fd0d9c73a5c5d595151c5fdad00}/index.js +1 -1
  16. package/integ-tests/integ.al2023.ts.snapshot/cdk.out +1 -1
  17. package/integ-tests/integ.al2023.ts.snapshot/integ.json +4 -3
  18. package/integ-tests/integ.al2023.ts.snapshot/manifest.json +956 -7
  19. package/integ-tests/integ.al2023.ts.snapshot/tree.json +1 -3228
  20. package/integ-tests/integ.custom-domain.ts +87 -0
  21. package/integ-tests/integ.custom-domain.ts.snapshot/IntegSetupVSCodeOnCustomDomainDefaultTestDeployAssert6982D514.assets.json +33 -0
  22. package/integ-tests/integ.custom-domain.ts.snapshot/IntegSetupVSCodeOnCustomDomainDefaultTestDeployAssert6982D514.template.json +333 -0
  23. package/integ-tests/integ.custom-domain.ts.snapshot/IntegTestStackCustomDomain.assets.json +132 -0
  24. package/integ-tests/integ.custom-domain.ts.snapshot/IntegTestStackCustomDomain.template.json +2862 -0
  25. package/integ-tests/{integ.ubuntu.ts.snapshot/asset.23732f3d1982f7fb0da3bd6638a8107337bb767fea165b45eae12000a1dd67ce → integ.custom-domain.ts.snapshot/asset.0ad50fc42afd768c3d0bfdd4701e43284fb077a25f19eea1e8c51a5ca36ebfe4}/index.js +988 -1165
  26. package/integ-tests/integ.custom-domain.ts.snapshot/asset.2819175352ad1ce0dae768e83fc328fb70fb5f10b4a8ff0ccbcb791f02b0716d/index.js +1 -0
  27. package/integ-tests/{integ.al2023.ts.snapshot/asset.a9865c9d36c7aa999e28cb7926e7a3a8e0b6d0854b25131a172024c5777442fa.lambda → integ.custom-domain.ts.snapshot/asset.33da23274e25bd9f43638c5d83dad26e3931cbe78d462ffd9a9f565e948b4f5f.lambda}/index.js +14 -2
  28. package/integ-tests/{integ.al2023.ts.snapshot/asset.f692c9f68e4daba2abc99103efd3518bced1e9d7a2a89847b9b5d5473c64f1bd.bundle → integ.custom-domain.ts.snapshot/asset.530055f7515b3f0a47900f5df37e729ba40ca977b2d07b952bdefa2b8f883f42.bundle}/index.js +296 -191
  29. package/integ-tests/integ.custom-domain.ts.snapshot/asset.781ab0ab74634cdaf61539ab208ab777829ef07097ac21f95b9e15a3b1eedc1b.lambda/index.js +57 -0
  30. package/integ-tests/integ.custom-domain.ts.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/__entrypoint__.js +1 -0
  31. package/integ-tests/integ.custom-domain.ts.snapshot/asset.7fa1e366ee8a9ded01fc355f704cff92bfd179574e6f9cfee800a3541df1b200/index.js +1 -0
  32. package/integ-tests/{integ.al2023.ts.snapshot/asset.ce2f3595a340d6c519a65888ef97e3b9b64f053f83608e32cc28162e22d7d99a → integ.custom-domain.ts.snapshot/asset.9d043014be736e8162bcc7ec5590cc6d2ff24fd0d9c73a5c5d595151c5fdad00}/index.js +1 -1
  33. package/integ-tests/integ.custom-domain.ts.snapshot/asset.b073cebcf4d61fb152a30f5a5e57a94df7f980a549fdf1a79a0b18c5750522d8/index.js +1 -0
  34. package/integ-tests/integ.custom-domain.ts.snapshot/asset.bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca/cfn-response.js +1 -0
  35. package/integ-tests/integ.custom-domain.ts.snapshot/asset.bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca/consts.js +1 -0
  36. package/integ-tests/integ.custom-domain.ts.snapshot/asset.bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca/framework.js +3 -0
  37. package/integ-tests/integ.custom-domain.ts.snapshot/asset.bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca/outbound.js +1 -0
  38. package/integ-tests/integ.custom-domain.ts.snapshot/asset.bdc104ed9cab1b5b6421713c8155f0b753380595356f710400609664d3635eca/util.js +1 -0
  39. package/integ-tests/integ.custom-domain.ts.snapshot/integ.json +23 -0
  40. package/integ-tests/integ.custom-domain.ts.snapshot/manifest.json +1653 -0
  41. package/integ-tests/integ.custom-domain.ts.snapshot/tree.json +1 -0
  42. package/integ-tests/integ.ubuntu.ts.snapshot/IntegSetupVSCodeOnUbuntuDefaultTestDeployAssertFF8DF2C5.assets.json +7 -6
  43. package/integ-tests/integ.ubuntu.ts.snapshot/IntegSetupVSCodeOnUbuntuDefaultTestDeployAssertFF8DF2C5.template.json +6 -6
  44. package/integ-tests/integ.ubuntu.ts.snapshot/IntegTestStackUbuntu22.assets.json +20 -12
  45. package/integ-tests/integ.ubuntu.ts.snapshot/IntegTestStackUbuntu22.template.json +36 -72
  46. package/integ-tests/integ.ubuntu.ts.snapshot/asset.0ad50fc42afd768c3d0bfdd4701e43284fb077a25f19eea1e8c51a5ca36ebfe4/index.js +5992 -0
  47. package/integ-tests/integ.ubuntu.ts.snapshot/asset.33da23274e25bd9f43638c5d83dad26e3931cbe78d462ffd9a9f565e948b4f5f.lambda/index.js +143 -0
  48. package/integ-tests/integ.ubuntu.ts.snapshot/asset.530055f7515b3f0a47900f5df37e729ba40ca977b2d07b952bdefa2b8f883f42.bundle/index.js +30676 -0
  49. package/integ-tests/integ.ubuntu.ts.snapshot/asset.9d043014be736e8162bcc7ec5590cc6d2ff24fd0d9c73a5c5d595151c5fdad00/index.js +1 -0
  50. package/integ-tests/integ.ubuntu.ts.snapshot/cdk.out +1 -1
  51. package/integ-tests/integ.ubuntu.ts.snapshot/integ.json +3 -2
  52. package/integ-tests/integ.ubuntu.ts.snapshot/manifest.json +956 -7
  53. package/integ-tests/integ.ubuntu.ts.snapshot/tree.json +1 -3070
  54. package/lib/installer/installer.d.ts +7 -0
  55. package/lib/installer/installer.js +15 -7
  56. package/lib/installer/installer.lambda.js +20 -3
  57. package/lib/vscode-server.d.ts +33 -0
  58. package/lib/vscode-server.js +165 -5
  59. package/mavogelcdkvscodeserver/go.mod +1 -1
  60. package/mavogelcdkvscodeserver/jsii/jsii.go +2 -2
  61. package/mavogelcdkvscodeserver/version +1 -1
  62. package/package.json +4 -4
File without changes
package/.jsii CHANGED
@@ -4082,7 +4082,7 @@
4082
4082
  "stability": "experimental"
4083
4083
  },
4084
4084
  "homepage": "https://github.com/MV-Consulting/cdk-vscode-server.git",
4085
- "jsiiVersion": "5.7.22 (build 1cfeabd)",
4085
+ "jsiiVersion": "5.8.20 (build bb5928c)",
4086
4086
  "keywords": [
4087
4087
  "aws",
4088
4088
  "cdk",
@@ -4101,7 +4101,7 @@
4101
4101
  },
4102
4102
  "name": "@mavogel/cdk-vscode-server",
4103
4103
  "readme": {
4104
- "markdown": "![Source](https://img.shields.io/github/stars/MV-Consulting/cdk-vscode-server?logo=github&label=GitHub%20Stars)\n[![Build Status](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml/badge.svg)](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml)\n[![ESLint Code Formatting](https://img.shields.io/badge/code_style-eslint-brightgreen.svg)](https://eslint.org)\n[![Latest release](https://img.shields.io/github/release/MV-Consulting/cdk-vscode-server.svg)](https://github.com/MV-Consulting/cdk-vscode-server/releases)\n![GitHub](https://img.shields.io/github/license/MV-Consulting/cdk-vscode-server)\n[![npm](https://img.shields.io/npm/dt/@mavogel/cdk-vscode-server?label=npm&color=orange)](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)\n[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)\n\n# cdk-vscode-server\n\nRunning your dev IDE vscode on AWS for development and workshop purposes.\n\n> [!Note]\n> This construct is designed for workshop purposes and does not fulfill all security and authentication best practices.\n\n![EXPERIMENTAL](https://img.shields.io/badge/stability-experimantal-orange?style=for-the-badge)**<br>This is an early version of the package. The API will change while I\nwe implement new features. Therefore make sure you use an exact version in your `package.json` before it reaches 1.0.0.**\n\n## Table of Contents\n\n- [Features](#features)\n- [Usage](#usage)\n- [Solution Design](#solution-design)\n- [Inspiration](#inspiration)\n\n## Features\n\n- ⚡ **Quick Setup**: Spin up and configure your [vscode](https://code.visualstudio.com/) server in under 10 minutes in your AWS account\n- 📏 **Best Practice Setup**: Set up with [projen](https://projen.io/) and a [single configuration file](./.projenrc.ts) to keep your changes centralized.\n- 🤹‍♂️ **Pre-installed packages**: Besides the [vscode](https://code.visualstudio.com/) server, other tools and software packages such as `git`, `docker`, `awscli` `nodejs` and `python` are pre-installed on the EC2 instance.\n- 🏗️ **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...\n\n## Usage\nThe following steps get you started:\n\n1. Create a new `awscdk-app` via\n```bash\nnpx projen new awscdk-app-ts --package-manager=npm\n```\n3. Add `@mavogel/cdk-vscode-server` as a dependency to your project in the `.projenrc.ts` file\n4. Run `npx projen` to install it\n5. Add the following to the `src/main.ts` file:\n```ts\nimport { App, Stack, StackProps } from 'aws-cdk-lib';\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { Construct } from 'constructs';\nimport {\n LinuxArchitectureType,\n LinuxFlavorType,\n VSCodeServer\n} from '@mavogel/cdk-vscode-server';\n\nexport class MyStack extends Stack {\n constructor(scope: Construct, id: string, props: StackProps = {}) {\n super(scope, id, props);\n\n new VSCodeServer(this, 'vscode', {\n // for example (or simply use the defaults by not setting the properties)\n instanceVolumeSize: 8,\n instanceClass: ec2.InstanceClass.M7G,\n instanceSize: ec2.InstanceSize.LARGE,\n instanceOperatingSystem: LinuxFlavorType.UBUNTU_22,\n instanceCpuArchitecture: LinuxArchitectureType.ARM,\n\n // 👇🏽 or if you want to give the InstanceRole more permissions\n additionalInstanceRolePolicies: [\n new iam.PolicyStatement({\n effect: iam.Effect.ALLOW,\n actions: [\n 'codebuild:*',\n ],\n resources: [\n `arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,\n ],\n }),\n ]\n\n // and more... 💡\n });\n }\n}\n\nconst env = {\n account: '123456789912',\n region: 'eu-central-1',\n};\n\nconst app = new App();\nnew MyStack(app, 'vscode-server', { env });\napp.synth();\n```\n\nand deploy it\n```bash\nnpx projen build\nnpx projen deploy\n```\n\nwith the output\n```console\n✨ Deployment time: 509.87s\n\nOutputs:\ndev.vscodedomainName6729AA39 = https://d1foo65bar4baz.cloudfront.net/?folder=/Workshop\ndev.vscodepassword64FBCA12 = foobarbaz\n```\n\nSee the [examples](./examples) folder for more inspiration.\n\n6. Then open the domain name in your favorite browser and you'd see the following login screen:\n![vscode-server-ui-login](docs/img/vscode-server-ui-login-min.png)\n\n7. After entering the password, you are logged into VSCode and can start coding :tada:\n\n![vscode-server-ui](docs/img/vscode-server-ui-min.png)\n\n> [!Important]\n> There are issues with copy pasting into the VSCode terminal within the Firefox browser (2025-01-12)\n\n## Solution Design\n\n<details>\n <summary>... if you're curious about click here for the details</summary>\n\n![vscode-server-solution-design](docs/img/vscode-server.drawio-min.png)\n\n</details>\n\n## Inspiration\nThis project was created based on the following inspiration\n\n- [vscode-on-ec2-for-prototyping](https://github.com/aws-samples/vscode-on-ec2-for-prototyping): as baseline, which unfortunately was outdated\n- [aws-terraform-dev-container](https://github.com/awslabs/aws-terraform-dev-container): as baseline for terraform, but unfortunately also outdated\n- [java-on-aws-workshop-ide-only.yaml](https://github.com/aws-samples/java-on-aws/blob/main/labs/unicorn-store/infrastructure/cfn/java-on-aws-workshop-ide-only.yaml): an already synthesized cloudformation stack, which used mostly python as the custom resources\n- [fleet-workshop-team-stack-self.json](https://static.us-east-1.prod.workshops.aws/public/cc4aa67e-5b7a-4df1-abf7-c42502899a25/assets/fleet-workshop-team-stack-self.json): also an already synthesized cloudformation stack, which did much more as I currently implemented here.\n- [eks-workshop-vscode-cfn.yaml](https://github.com/aws-samples/eks-workshop-v2/blob/main/lab/cfn/eks-workshop-vscode-cfn.yaml): another great baseline\n\n\n## 🚀 Unlock the Full Potential of Your AWS Cloud Infrastructure\n\nHi, 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.\n\n---\n\n### 🌟 Why Work With Me?\n\n✔️ **Tailored AWS Solutions:** Every business is unique, so I design custom solutions that fit your goals and challenges.\n✔️ **Well-Architected Designs:** From scalability to security, my solutions align with AWS Well-Architected Framework.\n✔️ **Cloud-Native Focus:** I specialize in modern, cloud-native systems that embrace the full potential of AWS.\n✔️ **Business-Driven Tech:** Technology should serve your business, not the other way around.\n\n---\n\n### 🛠 What I Bring to the Table\n\n🔑 **12x AWS Certifications**\nI’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](https://www.credly.com/users/manuel-vogel)\n\n⚙️ **Infrastructure as Code (IaC)**\nWith deep expertise in **AWS CDK** and **Terraform**, I ensure your infrastructure is automated, maintainable, and scalable.\n\n📦 **DevOps Expertise**\nFrom CI/CD pipelines with **GitHub Actions** and **GitLab CI** to container orchestration **Kubernetes** and others, I deliver workflows that are smooth and efficient.\n\n🌐 **Hands-On Experience**\nWith 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](https://github.com/mavogel)\n\n---\n\n### 💼 Let’s Build Something Great Together\n\nI 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.\n\n✔️ **Direct Collaboration**: No middlemen or red tape – you work with me directly.\n✔️ **Transparent Process**: Expect open communication, clear timelines, and visible results.\n✔️ **Real Value**: My solutions focus on delivering measurable impact for your business.\n\n\n<a href=\"https://tinyurl.com/mvc-15min\"><img alt=\"Schedule your call\" src=\"https://img.shields.io/badge/schedule%20your%20call-success.svg?style=for-the-badge\"/></a>\n\n---\n\n## 🙌 Acknowledgements\n\nBig shoutout to the amazing team behind [Projen](https://github.com/projen/projen)!\nTheir groundbreaking work simplifies cloud infrastructure projects and inspires us every day. 💡\n\n## Author\n\n[Manuel Vogel](https://manuel-vogel.de/about/)\n\n[![](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/manuel-vogel)\n[![](https://img.shields.io/badge/GitHub-2b3137?style=for-the-badge&logo=github&logoColor=white)](https://github.com/mavogel)"
4104
+ "markdown": "![Source](https://img.shields.io/github/stars/MV-Consulting/cdk-vscode-server?logo=github&label=GitHub%20Stars)\n[![Build Status](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml/badge.svg)](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml)\n[![ESLint Code Formatting](https://img.shields.io/badge/code_style-eslint-brightgreen.svg)](https://eslint.org)\n[![Latest release](https://img.shields.io/github/release/MV-Consulting/cdk-vscode-server.svg)](https://github.com/MV-Consulting/cdk-vscode-server/releases)\n![GitHub](https://img.shields.io/github/license/MV-Consulting/cdk-vscode-server)\n[![npm](https://img.shields.io/npm/dt/@mavogel/cdk-vscode-server?label=npm&color=orange)](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)\n[![typescript](https://img.shields.io/badge/jsii-typescript-blueviolet.svg)](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)\n\n# cdk-vscode-server\n\nRunning your dev IDE vscode on AWS for development and workshop purposes.\n\n> [!Note]\n> This construct is designed for workshop purposes and does not fulfill all security and authentication best practices.\n\n![EXPERIMENTAL](https://img.shields.io/badge/stability-experimantal-orange?style=for-the-badge)**<br>This is an early version of the package. The API will change while I\nwe implement new features. Therefore make sure you use an exact version in your `package.json` before it reaches 1.0.0.**\n\n## Table of Contents\n\n- [Features](#features)\n- [Usage](#usage)\n - [Standard](#Standard)\n - [Custom Domain Configuration](#custom-domain-configuration)\n- [Solution Design](#solution-design)\n- [Inspiration](#inspiration)\n\n## Features\n\n- ⚡ **Quick Setup**: Spin up and configure your [vscode](https://code.visualstudio.com/) server in under 10 minutes in your AWS account\n- 📏 **Best Practice Setup**: Set up with [projen](https://projen.io/) and a [single configuration file](./.projenrc.ts) to keep your changes centralized.\n- 🤹‍♂️ **Pre-installed packages**: Besides the [vscode](https://code.visualstudio.com/) server, other tools and software packages such as `git`, `docker`, `awscli` `nodejs` and `python` are pre-installed on the EC2 instance.\n- 🌐 **Custom Domain Support**: Use your own domain name with automatic ACM certificate creation and Route53 DNS configuration, or bring your existing certificate.\n- 🏗️ **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...\n\n## Usage\nActually we supported 2 modes:\n\n### Standard\nThe following steps get you started:\n\n1. Create a new `awscdk-app` via\n```bash\nnpx projen new awscdk-app-ts --package-manager=npm\n```\n3. Add `@mavogel/cdk-vscode-server` as a dependency to your project in the `.projenrc.ts` file\n4. Run `npx projen` to install it\n5. Add the following to the `src/main.ts` file:\n```ts\nimport { App, Stack, StackProps } from 'aws-cdk-lib';\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport { Construct } from 'constructs';\nimport {\n LinuxArchitectureType,\n LinuxFlavorType,\n VSCodeServer\n} from '@mavogel/cdk-vscode-server';\n\nexport class MyStack extends Stack {\n constructor(scope: Construct, id: string, props: StackProps = {}) {\n super(scope, id, props);\n\n new VSCodeServer(this, 'vscode', {\n // for example (or simply use the defaults by not setting the properties)\n instanceVolumeSize: 8,\n instanceClass: ec2.InstanceClass.M7G,\n instanceSize: ec2.InstanceSize.LARGE,\n instanceOperatingSystem: LinuxFlavorType.UBUNTU_22,\n instanceCpuArchitecture: LinuxArchitectureType.ARM,\n\n // 👇🏽 or if you want to give the InstanceRole more permissions\n additionalInstanceRolePolicies: [\n new iam.PolicyStatement({\n effect: iam.Effect.ALLOW,\n actions: [\n 'codebuild:*',\n ],\n resources: [\n `arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,\n ],\n }),\n ]\n\n // and more... 💡\n });\n }\n}\n\nconst env = {\n account: '123456789912',\n region: 'eu-central-1',\n};\n\nconst app = new App();\nnew MyStack(app, 'vscode-server', { env });\napp.synth();\n```\n\nand deploy it\n```bash\nnpx projen build\nnpx projen deploy\n```\n\nwith the output\n```console\n✨ Deployment time: 509.87s\n\nOutputs:\ndev.vscodedomainName6729AA39 = https://d1foo65bar4baz.cloudfront.net/?folder=/Workshop\ndev.vscodepassword64FBCA12 = foobarbaz\n```\n\nSee the [examples](./examples) folder for more inspiration.\n\n### Custom Domain Configuration\n\nYou 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:\n\n#### Option 1: Auto-create Certificate with DNS Validation\n```ts\nnew VSCodeServer(this, 'vscode', {\n domainName: 'vscode.example.com',\n hostedZoneId: 'Z123EXAMPLE456', // optional - will auto-discover if not provided\n autoCreateCertificate: true,\n});\n```\n\nThis will:\n- Create an ACM certificate in us-east-1 (required for CloudFront)\n- Validate the certificate using DNS validation\n- Create a Route53 A record pointing to the CloudFront distribution\n- Configure the CloudFront distribution with the custom domain\n\n#### Option 2: Use Existing Certificate\n```ts\nnew VSCodeServer(this, 'vscode', {\n domainName: 'vscode.example.com',\n hostedZoneId: 'Z123EXAMPLE456',\n certificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',\n});\n```\n\n**Requirements:**\n- Certificate must be in us-east-1 region\n- Certificate must be validated and ready to use\n- Certificate must include the domain name\n\n#### Option 3: Default (No Custom Domain)\n```ts\nnew VSCodeServer(this, 'vscode', {\n // No domain configuration - uses CloudFront default domain\n});\n```\n\nFor complete examples, see [examples/custom-domain/main.ts](./examples/custom-domain/main.ts).\n\n6. Then open the domain name in your favorite browser and you'd see the following login screen:\n![vscode-server-ui-login](docs/img/vscode-server-ui-login-min.png)\n\n7. After entering the password, you are logged into VSCode and can start coding :tada:\n\n![vscode-server-ui](docs/img/vscode-server-ui-min.png)\n\n> [!Important]\n> There are issues with copy pasting into the VSCode terminal within the Firefox browser (2025-01-12)\n\n## Solution Design\n\n<details>\n <summary>... if you're curious about click here for the details</summary>\n\n![vscode-server-solution-design](docs/img/vscode-server.drawio-min.png)\n\n</details>\n\n## Inspiration\nThis project was created based on the following inspiration\n\n- [vscode-on-ec2-for-prototyping](https://github.com/aws-samples/vscode-on-ec2-for-prototyping): as baseline, which unfortunately was outdated\n- [aws-terraform-dev-container](https://github.com/awslabs/aws-terraform-dev-container): as baseline for terraform, but unfortunately also outdated\n- [java-on-aws-workshop-ide-only.yaml](https://github.com/aws-samples/java-on-aws/blob/main/labs/unicorn-store/infrastructure/cfn/java-on-aws-workshop-ide-only.yaml): an already synthesized cloudformation stack, which used mostly python as the custom resources\n- [fleet-workshop-team-stack-self.json](https://static.us-east-1.prod.workshops.aws/public/cc4aa67e-5b7a-4df1-abf7-c42502899a25/assets/fleet-workshop-team-stack-self.json): also an already synthesized cloudformation stack, which did much more as I currently implemented here.\n- [eks-workshop-vscode-cfn.yaml](https://github.com/aws-samples/eks-workshop-v2/blob/main/lab/cfn/eks-workshop-vscode-cfn.yaml): another great baseline\n\n\n## 🚀 Unlock the Full Potential of Your AWS Cloud Infrastructure\n\nHi, 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.\n\n---\n\n### 🌟 Why Work With Me?\n\n✔️ **Tailored AWS Solutions:** Every business is unique, so I design custom solutions that fit your goals and challenges.\n✔️ **Well-Architected Designs:** From scalability to security, my solutions align with AWS Well-Architected Framework.\n✔️ **Cloud-Native Focus:** I specialize in modern, cloud-native systems that embrace the full potential of AWS.\n✔️ **Business-Driven Tech:** Technology should serve your business, not the other way around.\n\n---\n\n### 🛠 What I Bring to the Table\n\n🔑 **12x AWS Certifications**\nI’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](https://www.credly.com/users/manuel-vogel)\n\n⚙️ **Infrastructure as Code (IaC)**\nWith deep expertise in **AWS CDK** and **Terraform**, I ensure your infrastructure is automated, maintainable, and scalable.\n\n📦 **DevOps Expertise**\nFrom CI/CD pipelines with **GitHub Actions** and **GitLab CI** to container orchestration **Kubernetes** and others, I deliver workflows that are smooth and efficient.\n\n🌐 **Hands-On Experience**\nWith 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](https://github.com/mavogel)\n\n---\n\n### 💼 Let’s Build Something Great Together\n\nI 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.\n\n✔️ **Direct Collaboration**: No middlemen or red tape – you work with me directly.\n✔️ **Transparent Process**: Expect open communication, clear timelines, and visible results.\n✔️ **Real Value**: My solutions focus on delivering measurable impact for your business.\n\n\n<a href=\"https://tinyurl.com/mvc-15min\"><img alt=\"Schedule your call\" src=\"https://img.shields.io/badge/schedule%20your%20call-success.svg?style=for-the-badge\"/></a>\n\n---\n\n## 🙌 Acknowledgements\n\nBig shoutout to the amazing team behind [Projen](https://github.com/projen/projen)!\nTheir groundbreaking work simplifies cloud infrastructure projects and inspires us every day. 💡\n\n## Author\n\n[Manuel Vogel](https://manuel-vogel.de/about/)\n\n[![](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/manuel-vogel)\n[![](https://img.shields.io/badge/GitHub-2b3137?style=for-the-badge&logo=github&logoColor=white)](https://github.com/mavogel)"
4105
4105
  },
4106
4106
  "repository": {
4107
4107
  "type": "git",
@@ -4131,7 +4131,7 @@
4131
4131
  "kind": "enum",
4132
4132
  "locationInModule": {
4133
4133
  "filename": "src/vscode-server.ts",
4134
- "line": 140
4134
+ "line": 180
4135
4135
  },
4136
4136
  "members": [
4137
4137
  {
@@ -4162,7 +4162,7 @@
4162
4162
  "kind": "enum",
4163
4163
  "locationInModule": {
4164
4164
  "filename": "src/vscode-server.ts",
4165
- "line": 120
4165
+ "line": 160
4166
4166
  },
4167
4167
  "members": [
4168
4168
  {
@@ -4204,7 +4204,7 @@
4204
4204
  },
4205
4205
  "locationInModule": {
4206
4206
  "filename": "src/vscode-server.ts",
4207
- "line": 166
4207
+ "line": 206
4208
4208
  },
4209
4209
  "parameters": [
4210
4210
  {
@@ -4231,7 +4231,7 @@
4231
4231
  "kind": "class",
4232
4232
  "locationInModule": {
4233
4233
  "filename": "src/vscode-server.ts",
4234
- "line": 155
4234
+ "line": 195
4235
4235
  },
4236
4236
  "name": "VSCodeServer",
4237
4237
  "properties": [
@@ -4243,7 +4243,7 @@
4243
4243
  "immutable": true,
4244
4244
  "locationInModule": {
4245
4245
  "filename": "src/vscode-server.ts",
4246
- "line": 159
4246
+ "line": 199
4247
4247
  },
4248
4248
  "name": "domainName",
4249
4249
  "type": {
@@ -4258,7 +4258,7 @@
4258
4258
  "immutable": true,
4259
4259
  "locationInModule": {
4260
4260
  "filename": "src/vscode-server.ts",
4261
- "line": 164
4261
+ "line": 204
4262
4262
  },
4263
4263
  "name": "password",
4264
4264
  "type": {
@@ -4279,7 +4279,7 @@
4279
4279
  "kind": "interface",
4280
4280
  "locationInModule": {
4281
4281
  "filename": "src/vscode-server.ts",
4282
- "line": 24
4282
+ "line": 27
4283
4283
  },
4284
4284
  "name": "VSCodeServerProps",
4285
4285
  "properties": [
@@ -4293,7 +4293,7 @@
4293
4293
  "immutable": true,
4294
4294
  "locationInModule": {
4295
4295
  "filename": "src/vscode-server.ts",
4296
- "line": 107
4296
+ "line": 110
4297
4297
  },
4298
4298
  "name": "additionalInstanceRolePolicies",
4299
4299
  "optional": true,
@@ -4316,7 +4316,7 @@
4316
4316
  "immutable": true,
4317
4317
  "locationInModule": {
4318
4318
  "filename": "src/vscode-server.ts",
4319
- "line": 114
4319
+ "line": 117
4320
4320
  },
4321
4321
  "name": "additionalTags",
4322
4322
  "optional": true,
@@ -4329,6 +4329,42 @@
4329
4329
  }
4330
4330
  }
4331
4331
  },
4332
+ {
4333
+ "abstract": true,
4334
+ "docs": {
4335
+ "default": "false",
4336
+ "stability": "experimental",
4337
+ "summary": "Auto-create ACM certificate with DNS validation in us-east-1 region Requires hostedZoneId to be provided for DNS validation Cannot be used together with certificateArn Certificate will automatically be created in us-east-1 as required by CloudFront."
4338
+ },
4339
+ "immutable": true,
4340
+ "locationInModule": {
4341
+ "filename": "src/vscode-server.ts",
4342
+ "line": 154
4343
+ },
4344
+ "name": "autoCreateCertificate",
4345
+ "optional": true,
4346
+ "type": {
4347
+ "primitive": "boolean"
4348
+ }
4349
+ },
4350
+ {
4351
+ "abstract": true,
4352
+ "docs": {
4353
+ "default": "- auto-create certificate if autoCreateCertificate is true",
4354
+ "stability": "experimental",
4355
+ "summary": "ARN of existing ACM certificate for the domain Certificate must be in us-east-1 region for CloudFront Cannot be used together with autoCreateCertificate."
4356
+ },
4357
+ "immutable": true,
4358
+ "locationInModule": {
4359
+ "filename": "src/vscode-server.ts",
4360
+ "line": 144
4361
+ },
4362
+ "name": "certificateArn",
4363
+ "optional": true,
4364
+ "type": {
4365
+ "primitive": "string"
4366
+ }
4367
+ },
4332
4368
  {
4333
4369
  "abstract": true,
4334
4370
  "docs": {
@@ -4339,7 +4375,7 @@
4339
4375
  "immutable": true,
4340
4376
  "locationInModule": {
4341
4377
  "filename": "src/vscode-server.ts",
4342
- "line": 93
4378
+ "line": 96
4343
4379
  },
4344
4380
  "name": "devServerBasePath",
4345
4381
  "optional": true,
@@ -4357,7 +4393,7 @@
4357
4393
  "immutable": true,
4358
4394
  "locationInModule": {
4359
4395
  "filename": "src/vscode-server.ts",
4360
- "line": 100
4396
+ "line": 103
4361
4397
  },
4362
4398
  "name": "devServerPort",
4363
4399
  "optional": true,
@@ -4365,6 +4401,24 @@
4365
4401
  "primitive": "number"
4366
4402
  }
4367
4403
  },
4404
+ {
4405
+ "abstract": true,
4406
+ "docs": {
4407
+ "default": "- uses CloudFront default domain",
4408
+ "stability": "experimental",
4409
+ "summary": "Custom domain name for the VS Code server When provided, creates a CloudFront distribution with this domain name and sets up Route53 A record pointing to the distribution."
4410
+ },
4411
+ "immutable": true,
4412
+ "locationInModule": {
4413
+ "filename": "src/vscode-server.ts",
4414
+ "line": 126
4415
+ },
4416
+ "name": "domainName",
4417
+ "optional": true,
4418
+ "type": {
4419
+ "primitive": "string"
4420
+ }
4421
+ },
4368
4422
  {
4369
4423
  "abstract": true,
4370
4424
  "docs": {
@@ -4375,7 +4429,7 @@
4375
4429
  "immutable": true,
4376
4430
  "locationInModule": {
4377
4431
  "filename": "src/vscode-server.ts",
4378
- "line": 86
4432
+ "line": 89
4379
4433
  },
4380
4434
  "name": "homeFolder",
4381
4435
  "optional": true,
@@ -4383,6 +4437,24 @@
4383
4437
  "primitive": "string"
4384
4438
  }
4385
4439
  },
4440
+ {
4441
+ "abstract": true,
4442
+ "docs": {
4443
+ "default": "- auto-discover from domain name",
4444
+ "stability": "experimental",
4445
+ "summary": "Route53 hosted zone ID for the domain Required when using autoCreateCertificate If not provided, will attempt to lookup hosted zone from domain name."
4446
+ },
4447
+ "immutable": true,
4448
+ "locationInModule": {
4449
+ "filename": "src/vscode-server.ts",
4450
+ "line": 135
4451
+ },
4452
+ "name": "hostedZoneId",
4453
+ "optional": true,
4454
+ "type": {
4455
+ "primitive": "string"
4456
+ }
4457
+ },
4386
4458
  {
4387
4459
  "abstract": true,
4388
4460
  "docs": {
@@ -4393,7 +4465,7 @@
4393
4465
  "immutable": true,
4394
4466
  "locationInModule": {
4395
4467
  "filename": "src/vscode-server.ts",
4396
- "line": 58
4468
+ "line": 61
4397
4469
  },
4398
4470
  "name": "instanceClass",
4399
4471
  "optional": true,
@@ -4411,7 +4483,7 @@
4411
4483
  "immutable": true,
4412
4484
  "locationInModule": {
4413
4485
  "filename": "src/vscode-server.ts",
4414
- "line": 79
4486
+ "line": 82
4415
4487
  },
4416
4488
  "name": "instanceCpuArchitecture",
4417
4489
  "optional": true,
@@ -4429,7 +4501,7 @@
4429
4501
  "immutable": true,
4430
4502
  "locationInModule": {
4431
4503
  "filename": "src/vscode-server.ts",
4432
- "line": 44
4504
+ "line": 47
4433
4505
  },
4434
4506
  "name": "instanceName",
4435
4507
  "optional": true,
@@ -4447,7 +4519,7 @@
4447
4519
  "immutable": true,
4448
4520
  "locationInModule": {
4449
4521
  "filename": "src/vscode-server.ts",
4450
- "line": 72
4522
+ "line": 75
4451
4523
  },
4452
4524
  "name": "instanceOperatingSystem",
4453
4525
  "optional": true,
@@ -4465,7 +4537,7 @@
4465
4537
  "immutable": true,
4466
4538
  "locationInModule": {
4467
4539
  "filename": "src/vscode-server.ts",
4468
- "line": 65
4540
+ "line": 68
4469
4541
  },
4470
4542
  "name": "instanceSize",
4471
4543
  "optional": true,
@@ -4483,7 +4555,7 @@
4483
4555
  "immutable": true,
4484
4556
  "locationInModule": {
4485
4557
  "filename": "src/vscode-server.ts",
4486
- "line": 51
4558
+ "line": 54
4487
4559
  },
4488
4560
  "name": "instanceVolumeSize",
4489
4561
  "optional": true,
@@ -4501,7 +4573,7 @@
4501
4573
  "immutable": true,
4502
4574
  "locationInModule": {
4503
4575
  "filename": "src/vscode-server.ts",
4504
- "line": 37
4576
+ "line": 40
4505
4577
  },
4506
4578
  "name": "vscodePassword",
4507
4579
  "optional": true,
@@ -4519,7 +4591,7 @@
4519
4591
  "immutable": true,
4520
4592
  "locationInModule": {
4521
4593
  "filename": "src/vscode-server.ts",
4522
- "line": 30
4594
+ "line": 33
4523
4595
  },
4524
4596
  "name": "vscodeUser",
4525
4597
  "optional": true,
@@ -4531,6 +4603,6 @@
4531
4603
  "symbolId": "src/vscode-server:VSCodeServerProps"
4532
4604
  }
4533
4605
  },
4534
- "version": "0.0.55",
4535
- "fingerprint": "Nj9mijztejY2IdTOrGaFhD2J1KV+TVRnuPIpmC9mlmU="
4606
+ "version": "0.0.56",
4607
+ "fingerprint": "gV9xsEiWCOrlugATByYLsKJMFqoOp5MZpNf9HViUhRM="
4536
4608
  }
package/API.md CHANGED
@@ -163,9 +163,13 @@ const vSCodeServerProps: VSCodeServerProps = { ... }
163
163
  | --- | --- | --- |
164
164
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.additionalInstanceRolePolicies">additionalInstanceRolePolicies</a></code> | <code>aws-cdk-lib.aws_iam.PolicyStatement[]</code> | Additional instance role policies. |
165
165
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.additionalTags">additionalTags</a></code> | <code>{[ key: string ]: string}</code> | Additional tags to add to the instance. |
166
+ | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.autoCreateCertificate">autoCreateCertificate</a></code> | <code>boolean</code> | Auto-create ACM certificate with DNS validation in us-east-1 region Requires hostedZoneId to be provided for DNS validation Cannot be used together with certificateArn Certificate will automatically be created in us-east-1 as required by CloudFront. |
167
+ | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.certificateArn">certificateArn</a></code> | <code>string</code> | ARN of existing ACM certificate for the domain Certificate must be in us-east-1 region for CloudFront Cannot be used together with autoCreateCertificate. |
166
168
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerBasePath">devServerBasePath</a></code> | <code>string</code> | Base path for the application to be added to Nginx sites-available list. |
167
169
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerPort">devServerPort</a></code> | <code>number</code> | Port for the DevServer. |
170
+ | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.domainName">domainName</a></code> | <code>string</code> | Custom domain name for the VS Code server When provided, creates a CloudFront distribution with this domain name and sets up Route53 A record pointing to the distribution. |
168
171
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.homeFolder">homeFolder</a></code> | <code>string</code> | Folder to open in VS Code server. |
172
+ | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.hostedZoneId">hostedZoneId</a></code> | <code>string</code> | Route53 hosted zone ID for the domain Required when using autoCreateCertificate If not provided, will attempt to lookup hosted zone from domain name. |
169
173
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.instanceClass">instanceClass</a></code> | <code>aws-cdk-lib.aws_ec2.InstanceClass</code> | VSCode Server EC2 instance class. |
170
174
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.instanceCpuArchitecture">instanceCpuArchitecture</a></code> | <code><a href="#@mavogel/cdk-vscode-server.LinuxArchitectureType">LinuxArchitectureType</a></code> | VSCode Server EC2 cpu architecture for the operating system. |
171
175
  | <code><a href="#@mavogel/cdk-vscode-server.VSCodeServerProps.property.instanceName">instanceName</a></code> | <code>string</code> | VSCode Server EC2 instance name. |
@@ -203,6 +207,32 @@ Additional tags to add to the instance.
203
207
 
204
208
  ---
205
209
 
210
+ ##### `autoCreateCertificate`<sup>Optional</sup> <a name="autoCreateCertificate" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.autoCreateCertificate"></a>
211
+
212
+ ```typescript
213
+ public readonly autoCreateCertificate: boolean;
214
+ ```
215
+
216
+ - *Type:* boolean
217
+ - *Default:* false
218
+
219
+ Auto-create ACM certificate with DNS validation in us-east-1 region Requires hostedZoneId to be provided for DNS validation Cannot be used together with certificateArn Certificate will automatically be created in us-east-1 as required by CloudFront.
220
+
221
+ ---
222
+
223
+ ##### `certificateArn`<sup>Optional</sup> <a name="certificateArn" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.certificateArn"></a>
224
+
225
+ ```typescript
226
+ public readonly certificateArn: string;
227
+ ```
228
+
229
+ - *Type:* string
230
+ - *Default:* auto-create certificate if autoCreateCertificate is true
231
+
232
+ ARN of existing ACM certificate for the domain Certificate must be in us-east-1 region for CloudFront Cannot be used together with autoCreateCertificate.
233
+
234
+ ---
235
+
206
236
  ##### `devServerBasePath`<sup>Optional</sup> <a name="devServerBasePath" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.devServerBasePath"></a>
207
237
 
208
238
  ```typescript
@@ -229,6 +259,19 @@ Port for the DevServer.
229
259
 
230
260
  ---
231
261
 
262
+ ##### `domainName`<sup>Optional</sup> <a name="domainName" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.domainName"></a>
263
+
264
+ ```typescript
265
+ public readonly domainName: string;
266
+ ```
267
+
268
+ - *Type:* string
269
+ - *Default:* uses CloudFront default domain
270
+
271
+ Custom domain name for the VS Code server When provided, creates a CloudFront distribution with this domain name and sets up Route53 A record pointing to the distribution.
272
+
273
+ ---
274
+
232
275
  ##### `homeFolder`<sup>Optional</sup> <a name="homeFolder" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.homeFolder"></a>
233
276
 
234
277
  ```typescript
@@ -242,6 +285,19 @@ Folder to open in VS Code server.
242
285
 
243
286
  ---
244
287
 
288
+ ##### `hostedZoneId`<sup>Optional</sup> <a name="hostedZoneId" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.hostedZoneId"></a>
289
+
290
+ ```typescript
291
+ public readonly hostedZoneId: string;
292
+ ```
293
+
294
+ - *Type:* string
295
+ - *Default:* auto-discover from domain name
296
+
297
+ Route53 hosted zone ID for the domain Required when using autoCreateCertificate If not provided, will attempt to lookup hosted zone from domain name.
298
+
299
+ ---
300
+
245
301
  ##### `instanceClass`<sup>Optional</sup> <a name="instanceClass" id="@mavogel/cdk-vscode-server.VSCodeServerProps.property.instanceClass"></a>
246
302
 
247
303
  ```typescript