├── .gitignore ├── .npmignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.jp.md ├── README.md ├── bin └── vscode-on-ec2-for-prototyping.ts ├── cdk.json ├── lib └── vscode-on-ec2-for-prototyping-stack.ts ├── package-lock.json ├── package.json ├── session.sh └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | !jest.config.js 3 | *.d.ts 4 | node_modules 5 | 6 | # CDK asset staging directory 7 | .cdk.staging 8 | cdk.out 9 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional 4 | documentation, we greatly value feedback and contributions from our community. 5 | 6 | Please read through this document before submitting any issues or pull requests to ensure we have all the necessary 7 | information to effectively respond to your bug report or contribution. 8 | 9 | 10 | ## Reporting Bugs/Feature Requests 11 | 12 | We welcome you to use the GitHub issue tracker to report bugs or suggest features. 13 | 14 | When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already 15 | reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: 16 | 17 | * A reproducible test case or series of steps 18 | * The version of our code being used 19 | * Any modifications you've made relevant to the bug 20 | * Anything unusual about your environment or deployment 21 | 22 | 23 | ## Contributing via Pull Requests 24 | Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: 25 | 26 | 1. You are working against the latest source on the *main* branch. 27 | 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 28 | 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. 29 | 30 | To send us a pull request, please: 31 | 32 | 1. Fork the repository. 33 | 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. 34 | 3. Ensure local tests pass. 35 | 4. Commit to your fork using clear commit messages. 36 | 5. Send us a pull request, answering any default questions in the pull request interface. 37 | 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. 38 | 39 | GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and 40 | [creating a pull request](https://help.github.com/articles/creating-a-pull-request/). 41 | 42 | 43 | ## Finding contributions to work on 44 | Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. 45 | 46 | 47 | ## Code of Conduct 48 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 49 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 50 | opensource-codeofconduct@amazon.com with any additional questions or comments. 51 | 52 | 53 | ## Security issue notifications 54 | If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. 55 | 56 | 57 | ## Licensing 58 | 59 | See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. 60 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT No Attribution 2 | 3 | Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 13 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 14 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 15 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 16 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | 18 | -------------------------------------------------------------------------------- /README.jp.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code on EC2 2 | 3 | このリポジトリでは、EC2 にホストした VSCode にブラウザからアクセスして利用する方法を紹介します。接続は Session Manager 経由で行うため、認証には IAM 権限が利用されます。また、アクセス先は localhost になります。このリポジトリが紹介する方法は、手元の VSCode から Remote SSH で EC2 インスタンスに接続する方法ではありませんのでご注意ください。 4 | 5 | ## Features 6 | - ブラウザから VSCode を利用できます 7 | - Node.js 環境がインストールされています 8 | - デフォルトで 128 GB のストレージが用意されています 9 | - AdministratorAccess 相当の権限で aws cli が実行できます 10 | - VSCode をホストする EC2 インスタンスは Private Subnet に属するため、インターネットには晒されていません。接続は Session Manager 経由で行います。 11 | 12 | ## Prerequirements 13 | - Node.js 実行環境 14 | - [`aws` コマンド](https://aws.amazon.com/jp/cli/) (AWS CDK を実行するため、AdministratorAccess 相当の権限の付与が必要) 15 | - `git` コマンド 16 | - `jq` コマンド (必須ではない。後述する session.sh を実行する場合に必要) 17 | 18 | 手元に環境を用意するのが難しい場合は [CloudShell](https://console.aws.amazon.com/cloudshell/home) で代替が可能ですが、`session.sh` 以降の手順は手元で行う必要がある点に注意してください。 19 | (SessionManager 経由で localhost にセッションを作成するため。) 20 | 21 | ## Installation 22 | 23 | まずはこのリポジトリを clone してください。 24 | 25 | ```bash 26 | git clone https://github.com/aws-samples/vscode-on-ec2-for-prototyping 27 | ``` 28 | 29 | アプリケーションは [AWS Cloud Development Kit](https://aws.amazon.com/jp/cdk/)(以降 CDK)を利用してデプロイします。実行には Node.js が必要です。まず、以下のコマンドを実行してください。全てのコマンドはリポジトリのルートで実行してください。 30 | 31 | ```bash 32 | npm ci 33 | ``` 34 | 35 | CDK を利用したことがない場合、初回のみ [Bootstrap](https://docs.aws.amazon.com/ja_jp/cdk/v2/guide/bootstrapping.html) 作業が必要です。すでに Bootstrap された環境では以下のコマンドは不要です。 36 | 37 | ```bash 38 | npx cdk bootstrap 39 | ``` 40 | 41 | 続いて、以下のコマンドで AWS リソースをデプロイします。 42 | 43 | ```bash 44 | npx cdk deploy 45 | ``` 46 | 47 | デプロイが完了したら、EC2 インスタンスが作成されたことを[マネージメントコンソール](https://console.aws.amazon.com/ec2/home#Instances)で確認します。 48 | また、その際に Status check が Initializing から checks passed になることをご確認ください。 49 | checks passed になったことが確認できたら、`session.sh` を実行してセッションを作成します。 50 | 51 | ```bash 52 | ./session.sh 53 | ``` 54 | 55 | 手元で Unix 系コマンドが使えない場合は、`session.sh` が実行できません。 56 | 代わりに、以下のコマンドを実行してください。 57 | Instance ID と Private IP は前述したマネージメントコンソールでも確認可能ですし、`cdk deploy` 時にそれぞれ `VscodeOnEc2ForPrototypingStack.InstanceID`、`VscodeOnEc2ForPrototypingStack.PrivateIP` として出力されます。 58 | 59 | ```bash 60 | # <> で囲まれた 2 箇所の値は置き換えが必要 61 | 62 | aws ssm start-session \ 63 | --target \ 64 | --document-name AWS-StartPortForwardingSessionToRemoteHost \ 65 | --parameters "{\"portNumber\":[\"8080\"],\"localPortNumber\":[\"8080\"],\"host\":[\"\"]}" 66 | ``` 67 | 68 | セッションの作成に成功したら、http://localhost:8080 を開いてください。接続できない場合は [Troubleshooting](#Troubleshooting) をご参照ください。 69 | 70 | ## Configurations 71 | 72 | [cdk.json](/cdk.json) の `context` の値を変更することでいくつかの項目を修正できます。 73 | 74 | - `volume` VSCode をホストする EC2 インスタンスのストレージサイズ (GB) 75 | - `nvm` Node.js をインストールする `nvm` のバージョン 76 | - `node` Node.js のバージョン 77 | 78 | ## Troubleshooting 79 | 80 | [こちらの Issue](https://github.com/amazonlinux/amazon-linux-2023/issues/397) で書かれているのと同様の現象が確認されることがあります。**セッションを作成後にブラウザを開いても接続できない場合は、まずこれを疑ってください。** 81 | 82 | エラーを確認するためには、まず[マネージメントコンソール](https://console.aws.amazon.com/ec2/home#Instances)を開き、作成した EC2 インスタンスを選択した状態で上部の Connect をクリックします。続いて Session Manager のタブを開き、Connect をクリックします。 83 | 84 | ターミナルを開いたら、以下のコマンドを実行してください。EC2 インスタンスを初期化する際に実行したコマンドの実行結果が確認できます。 85 | 86 | ```bash 87 | sudo cat /var/log/cloud-init-output.log 88 | ``` 89 | 90 | この中で `[Errno 2] No such file or directory: '/var/cache/dnf/amazonlinux-...` というエラーが出ている場合は code コマンドのインストールに失敗しています。その場合は、以下のコマンドで改めてインストールしてください。 91 | 92 | ```bash 93 | sudo yum install -y code 94 | ``` 95 | 96 | インストールに成功後、以下のコマンドを実行して `code` を起動します。 97 | 98 | ```bash 99 | sudo systemctl start code-server 100 | ``` 101 | 102 | 実行後に再度 `session.sh` でセッションを作成し、ブラウザで接続できることを確認してください。(http://localhost:8080) なお、一度 `code` コマンドをインストールしてしまえば、ブラウザのタブを一度閉じて再度開いた時や、EC2 インスタンスの再起動時、セッションを作成した時などにこれらの手順を再度実行する必要はありません。 103 | 104 | ## Future works 105 | - [ ] 既存の VPC をインポートできるようにする 106 | - [ ] インスタンスタイプを選択できるようにする 107 | 108 | ## Cleanup 109 | 110 | 環境を削除する場合は、以下のコマンドを実行してください。 111 | 112 | ``` 113 | npx cdk destroy 114 | ``` 115 | 116 | ## Security 117 | 118 | See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. 119 | 120 | ## License 121 | 122 | This library is licensed under the MIT-0 License. See the LICENSE file. 123 | 124 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > [!NOTE] 2 | > 日本語のドキュメントは [こちら](/README.jp.md) 3 | 4 | # Visual Studio Code on EC2 5 | 6 | This repository introduces how to access and use VSCode hosted on EC2 from a browser. The connection is made via Session Manager, so IAM permissions are used for authentication. The access destination will be localhost. Please note that this repository does not introduce connecting from your local VSCode to an EC2 instance via Remote SSH. 7 | 8 | ## Features 9 | - You can use VSCode from a browser 10 | - Node.js environment is installed 11 | - 128 GB of storage is provided by default 12 | - aws cli can be executed with AdministratorAccess equivalent permissions 13 | - The EC2 instance hosting VSCode belongs to a Private Subnet, so it is not exposed to the internet. The connection is made via Session Manager. 14 | 15 | ## Prerequisites 16 | - Node.js runtime environment 17 | - [`aws` command](https://aws.amazon.com/cli/) (AdministratorAccess equivalent permissions are required to run AWS CDK) 18 | - `git` command 19 | - `jq` command (not required. Needed when executing session.sh described later) 20 | 21 | If it is difficult to prepare the environment locally, [CloudShell](https://console.aws.amazon.com/cloudshell/home) can be used as an alternative, but the steps from `session.sh` onwards need to be performed locally (because a session is created to localhost via SessionManager). 22 | 23 | ## Installation 24 | 25 | First, clone this repository. 26 | 27 | ```bash 28 | git clone https://github.com/aws-samples/vscode-on-ec2-for-prototyping 29 | ``` 30 | 31 | The application uses the [AWS Cloud Development Kit](https://aws.amazon.com/cdk/)(CDK) for deployment. Node.js is required to run. First, run the following command. Run all commands from the root of the repository. 32 | 33 | ```bash 34 | npm ci 35 | ``` 36 | 37 | If you have never used CDK before, a [Bootstrap](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html) process is required only the first time. The following command is not required if already bootstrapped. 38 | 39 | ```bash 40 | npx cdk bootstrap 41 | ``` 42 | 43 | Then deploy the AWS resources with the following command: 44 | 45 | ```bash 46 | npx cdk deploy 47 | ``` 48 | 49 | After deployment completes, check that the EC2 instance was created in the [management console](https://console.aws.amazon.com/ec2/home#Instances). Also please confirm that the Status check changes from Initializing to checks passed. 50 | 51 | Once checks passed is confirmed, run `session.sh` to create a session: 52 | 53 | ```bash 54 | ./session.sh 55 | ``` 56 | 57 | If Unix-like commands cannot be used locally, run the following command instead. The Instance ID and Private IP can be confirmed in the management console mentioned above, or output when running `cdk deploy` as `VscodeOnEc2ForPrototypingStack.InstanceID` and `VscodeOnEc2ForPrototypingStack.PrivateIP` respectively. 58 | 59 | ```bash 60 | # Replace the two values enclosed in <> 61 | 62 | aws ssm start-session \ 63 | --target \ 64 | --document-name AWS-StartPortForwardingSessionToRemoteHost \ 65 | --parameters "{\"portNumber\":[\"8080\"],\"localPortNumber\":[\"8080\"],\"host\":[\"\"]}" 66 | ``` 67 | 68 | Once the session is created, open http://localhost:8080 in your browser. If it does not connect, please refer to [Troubleshooting](#Troubleshooting). 69 | 70 | ## Configurations 71 | 72 | The values in the `context` of [cdk.json](/cdk.json) can be modified to change some items. 73 | 74 | - `volume` The storage size (GB) of the EC2 instance hosting VSCode 75 | - `nvm` The version of `nvm` used to install Node.js 76 | - `node` The version of Node.js 77 | 78 | ## Troubleshooting 79 | 80 | The same phenomenon described in [this Issue](https://github.com/amazonlinux/amazon-linux-2023/issues/397) may occur. **If the browser cannot connect after creating a session, first suspect this. 81 | 82 | To check for errors, first open the [management console](https://console.aws.amazon.com/ec2/home#Instances) and select the created EC2 instance. Then click Connect at the top and open the Session Manager tab and click Connect. 83 | 84 | Open a terminal and run the following command. This will show the execution results of the commands run when initializing the EC2 instance: 85 | 86 | ```bash 87 | sudo cat /var/log/cloud-init-output.log 88 | ``` 89 | 90 | If this shows an error like `[Errno 2] No such file or directory: '/var/cache/dnf/amazonlinux-...`, the code command installation failed. In that case, reinstall with: 91 | 92 | ```bash 93 | sudo yum install -y code 94 | ``` 95 | 96 | After successful installation, run: 97 | 98 | ```bash 99 | sudo systemctl start code-server 100 | ``` 101 | 102 | Try creating a session with `session.sh` and connecting in the browser (http://localhost:8080) again. You will no longer need to run these steps again after the initial code installation, such as when closing and reopening the browser tab, or restarting the EC2 instance. 103 | 104 | ## Future works 105 | - [ ] Make it possible to import existing VPC 106 | - [ ] Allow selecting instance type 107 | 108 | ## Cleanup 109 | 110 | To delete the environment, run the following command: 111 | 112 | ``` 113 | npx cdk destroy 114 | ``` 115 | 116 | ## Security 117 | 118 | See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. 119 | 120 | ## License 121 | 122 | This library is licensed under the MIT-0 License. See the LICENSE file. 123 | 124 | -------------------------------------------------------------------------------- /bin/vscode-on-ec2-for-prototyping.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import 'source-map-support/register'; 3 | import * as cdk from 'aws-cdk-lib'; 4 | import { VscodeOnEc2ForPrototypingStack } from '../lib/vscode-on-ec2-for-prototyping-stack'; 5 | 6 | const app = new cdk.App(); 7 | new VscodeOnEc2ForPrototypingStack(app, 'VscodeOnEc2ForPrototypingStack', {}); 8 | -------------------------------------------------------------------------------- /cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts bin/vscode-on-ec2-for-prototyping.ts", 3 | "watch": { 4 | "include": [ 5 | "**" 6 | ], 7 | "exclude": [ 8 | "README.md", 9 | "cdk*.json", 10 | "**/*.d.ts", 11 | "**/*.js", 12 | "tsconfig.json", 13 | "package*.json", 14 | "yarn.lock", 15 | "node_modules", 16 | "test" 17 | ] 18 | }, 19 | "context": { 20 | "volume": 128, 21 | "nvm": "0.39.7", 22 | "node": "20.11.0", 23 | "@aws-cdk/aws-lambda:recognizeLayerVersion": true, 24 | "@aws-cdk/core:checkSecretUsage": true, 25 | "@aws-cdk/core:target-partitions": [ 26 | "aws", 27 | "aws-cn" 28 | ], 29 | "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, 30 | "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, 31 | "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true, 32 | "@aws-cdk/aws-iam:minimizePolicies": true, 33 | "@aws-cdk/core:validateSnapshotRemovalPolicy": true, 34 | "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true, 35 | "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true, 36 | "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true, 37 | "@aws-cdk/aws-apigateway:disableCloudWatchRole": true, 38 | "@aws-cdk/core:enablePartitionLiterals": true, 39 | "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true, 40 | "@aws-cdk/aws-iam:standardizedServicePrincipals": true, 41 | "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true, 42 | "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true, 43 | "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true, 44 | "@aws-cdk/aws-route53-patters:useCertificate": true, 45 | "@aws-cdk/customresources:installLatestAwsSdkDefault": false, 46 | "@aws-cdk/aws-rds:databaseProxyUniqueResourceName": true, 47 | "@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup": true, 48 | "@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId": true, 49 | "@aws-cdk/aws-ec2:launchTemplateDefaultUserData": true, 50 | "@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments": true, 51 | "@aws-cdk/aws-redshift:columnId": true, 52 | "@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2": true, 53 | "@aws-cdk/aws-ec2:restrictDefaultSecurityGroup": true, 54 | "@aws-cdk/aws-apigateway:requestValidatorUniqueId": true, 55 | "@aws-cdk/aws-kms:aliasNameRef": true, 56 | "@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig": true, 57 | "@aws-cdk/core:includePrefixInUniqueNameGeneration": true, 58 | "@aws-cdk/aws-efs:denyAnonymousAccess": true, 59 | "@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby": true, 60 | "@aws-cdk/aws-lambda-nodejs:useLatestRuntimeVersion": true, 61 | "@aws-cdk/aws-efs:mountTargetOrderInsensitiveLogicalId": true, 62 | "@aws-cdk/aws-rds:auroraClusterChangeScopeOfInstanceParameterGroupWithEachParameters": true, 63 | "@aws-cdk/aws-appsync:useArnForSourceApiAssociationIdentifier": true, 64 | "@aws-cdk/aws-rds:preventRenderingDeprecatedCredentials": true, 65 | "@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/vscode-on-ec2-for-prototyping-stack.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import * as ec2 from 'aws-cdk-lib/aws-ec2'; 4 | import * as iam from 'aws-cdk-lib/aws-iam'; 5 | 6 | export class VscodeOnEc2ForPrototypingStack extends cdk.Stack { 7 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 8 | super(scope, id, props); 9 | 10 | const paramVolume: number = this.node.tryGetContext('volume')!; 11 | const paramNvm: string = this.node.tryGetContext('nvm')!; 12 | const paramNode: string = this.node.tryGetContext('node')!; 13 | 14 | const vpc = new ec2.Vpc(this, 'VSCodeVPC', {}); 15 | const host = new ec2.BastionHostLinux(this, 'VSCodeBastionHost', { 16 | vpc, 17 | instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.MEDIUM), 18 | machineImage: ec2.MachineImage.latestAmazonLinux2023(), 19 | // 20 | // To confirm the device name 21 | // ``` 22 | // aws ec2 describe-images --region ap-northeast-1 --image-ids ami-0506f0f56e3a057a4 23 | // ``` 24 | // 25 | blockDevices: [ 26 | { 27 | deviceName: '/dev/xvda', 28 | volume: ec2.BlockDeviceVolume.ebs(paramVolume), 29 | }, 30 | ], 31 | }); 32 | 33 | host.instance.addToRolePolicy( 34 | new iam.PolicyStatement({ 35 | actions: ['*'], 36 | resources: ['*'], 37 | }) 38 | ); 39 | 40 | host.instance.addUserData( 41 | `#!/bin/bash 42 | sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc 43 | sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo' 44 | 45 | # https://github.com/amazonlinux/amazon-linux-2023/issues/397 46 | sleep 10 47 | 48 | sudo yum install -y code git 49 | sudo tee /etc/systemd/system/code-server.service <=12" 50 | } 51 | }, 52 | "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { 53 | "version": "0.3.9", 54 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", 55 | "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", 56 | "dev": true, 57 | "dependencies": { 58 | "@jridgewell/resolve-uri": "^3.0.3", 59 | "@jridgewell/sourcemap-codec": "^1.4.10" 60 | } 61 | }, 62 | "node_modules/@jridgewell/resolve-uri": { 63 | "version": "3.1.1", 64 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", 65 | "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", 66 | "dev": true, 67 | "engines": { 68 | "node": ">=6.0.0" 69 | } 70 | }, 71 | "node_modules/@jridgewell/sourcemap-codec": { 72 | "version": "1.4.15", 73 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", 74 | "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", 75 | "dev": true 76 | }, 77 | "node_modules/@tsconfig/node10": { 78 | "version": "1.0.9", 79 | "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", 80 | "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", 81 | "dev": true 82 | }, 83 | "node_modules/@tsconfig/node12": { 84 | "version": "1.0.11", 85 | "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", 86 | "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", 87 | "dev": true 88 | }, 89 | "node_modules/@tsconfig/node14": { 90 | "version": "1.0.3", 91 | "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", 92 | "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", 93 | "dev": true 94 | }, 95 | "node_modules/@tsconfig/node16": { 96 | "version": "1.0.4", 97 | "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", 98 | "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", 99 | "dev": true 100 | }, 101 | "node_modules/@types/node": { 102 | "version": "20.11.5", 103 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.5.tgz", 104 | "integrity": "sha512-g557vgQjUUfN76MZAN/dt1z3dzcUsimuysco0KeluHgrPdJXkP/XdAURgyO2W9fZWHRtRBiVKzKn8vyOAwlG+w==", 105 | "dev": true, 106 | "dependencies": { 107 | "undici-types": "~5.26.4" 108 | } 109 | }, 110 | "node_modules/acorn": { 111 | "version": "8.11.3", 112 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", 113 | "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", 114 | "dev": true, 115 | "bin": { 116 | "acorn": "bin/acorn" 117 | }, 118 | "engines": { 119 | "node": ">=0.4.0" 120 | } 121 | }, 122 | "node_modules/acorn-walk": { 123 | "version": "8.3.2", 124 | "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", 125 | "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", 126 | "dev": true, 127 | "engines": { 128 | "node": ">=0.4.0" 129 | } 130 | }, 131 | "node_modules/arg": { 132 | "version": "4.1.3", 133 | "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", 134 | "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", 135 | "dev": true 136 | }, 137 | "node_modules/aws-cdk": { 138 | "version": "2.122.0", 139 | "resolved": "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.122.0.tgz", 140 | "integrity": "sha512-WqiVTedcuW4LjH4WqtQncliUdeDa9j9xgu3II8Qd1HmCZotbzBorYIHDvOJ+m3ovIzd9DL+hNq9PPUqxtBe0VQ==", 141 | "dev": true, 142 | "bin": { 143 | "cdk": "bin/cdk" 144 | }, 145 | "engines": { 146 | "node": ">= 14.15.0" 147 | }, 148 | "optionalDependencies": { 149 | "fsevents": "2.3.2" 150 | } 151 | }, 152 | "node_modules/aws-cdk-lib": { 153 | "version": "2.122.0", 154 | "resolved": "https://registry.npmjs.org/aws-cdk-lib/-/aws-cdk-lib-2.122.0.tgz", 155 | "integrity": "sha512-NBUfYk/SialvKFsvBG/Ucd7lM+BID3Uy3EEOnIBbioDpnMotm5SDaU/RUm4APS4sxzQZX1DjduD5ZUFNHnEWhQ==", 156 | "bundleDependencies": [ 157 | "@balena/dockerignore", 158 | "case", 159 | "fs-extra", 160 | "ignore", 161 | "jsonschema", 162 | "minimatch", 163 | "punycode", 164 | "semver", 165 | "table", 166 | "yaml" 167 | ], 168 | "dependencies": { 169 | "@aws-cdk/asset-awscli-v1": "^2.2.201", 170 | "@aws-cdk/asset-kubectl-v20": "^2.1.2", 171 | "@aws-cdk/asset-node-proxy-agent-v6": "^2.0.1", 172 | "@balena/dockerignore": "^1.0.2", 173 | "case": "1.6.3", 174 | "fs-extra": "^11.2.0", 175 | "ignore": "^5.3.0", 176 | "jsonschema": "^1.4.1", 177 | "minimatch": "^3.1.2", 178 | "punycode": "^2.3.1", 179 | "semver": "^7.5.4", 180 | "table": "^6.8.1", 181 | "yaml": "1.10.2" 182 | }, 183 | "engines": { 184 | "node": ">= 14.15.0" 185 | }, 186 | "peerDependencies": { 187 | "constructs": "^10.0.0" 188 | } 189 | }, 190 | "node_modules/aws-cdk-lib/node_modules/@balena/dockerignore": { 191 | "version": "1.0.2", 192 | "inBundle": true, 193 | "license": "Apache-2.0" 194 | }, 195 | "node_modules/aws-cdk-lib/node_modules/ajv": { 196 | "version": "8.12.0", 197 | "inBundle": true, 198 | "license": "MIT", 199 | "dependencies": { 200 | "fast-deep-equal": "^3.1.1", 201 | "json-schema-traverse": "^1.0.0", 202 | "require-from-string": "^2.0.2", 203 | "uri-js": "^4.2.2" 204 | }, 205 | "funding": { 206 | "type": "github", 207 | "url": "https://github.com/sponsors/epoberezkin" 208 | } 209 | }, 210 | "node_modules/aws-cdk-lib/node_modules/ansi-regex": { 211 | "version": "5.0.1", 212 | "inBundle": true, 213 | "license": "MIT", 214 | "engines": { 215 | "node": ">=8" 216 | } 217 | }, 218 | "node_modules/aws-cdk-lib/node_modules/ansi-styles": { 219 | "version": "4.3.0", 220 | "inBundle": true, 221 | "license": "MIT", 222 | "dependencies": { 223 | "color-convert": "^2.0.1" 224 | }, 225 | "engines": { 226 | "node": ">=8" 227 | }, 228 | "funding": { 229 | "url": "https://github.com/chalk/ansi-styles?sponsor=1" 230 | } 231 | }, 232 | "node_modules/aws-cdk-lib/node_modules/astral-regex": { 233 | "version": "2.0.0", 234 | "inBundle": true, 235 | "license": "MIT", 236 | "engines": { 237 | "node": ">=8" 238 | } 239 | }, 240 | "node_modules/aws-cdk-lib/node_modules/balanced-match": { 241 | "version": "1.0.2", 242 | "inBundle": true, 243 | "license": "MIT" 244 | }, 245 | "node_modules/aws-cdk-lib/node_modules/brace-expansion": { 246 | "version": "1.1.11", 247 | "inBundle": true, 248 | "license": "MIT", 249 | "dependencies": { 250 | "balanced-match": "^1.0.0", 251 | "concat-map": "0.0.1" 252 | } 253 | }, 254 | "node_modules/aws-cdk-lib/node_modules/case": { 255 | "version": "1.6.3", 256 | "inBundle": true, 257 | "license": "(MIT OR GPL-3.0-or-later)", 258 | "engines": { 259 | "node": ">= 0.8.0" 260 | } 261 | }, 262 | "node_modules/aws-cdk-lib/node_modules/color-convert": { 263 | "version": "2.0.1", 264 | "inBundle": true, 265 | "license": "MIT", 266 | "dependencies": { 267 | "color-name": "~1.1.4" 268 | }, 269 | "engines": { 270 | "node": ">=7.0.0" 271 | } 272 | }, 273 | "node_modules/aws-cdk-lib/node_modules/color-name": { 274 | "version": "1.1.4", 275 | "inBundle": true, 276 | "license": "MIT" 277 | }, 278 | "node_modules/aws-cdk-lib/node_modules/concat-map": { 279 | "version": "0.0.1", 280 | "inBundle": true, 281 | "license": "MIT" 282 | }, 283 | "node_modules/aws-cdk-lib/node_modules/emoji-regex": { 284 | "version": "8.0.0", 285 | "inBundle": true, 286 | "license": "MIT" 287 | }, 288 | "node_modules/aws-cdk-lib/node_modules/fast-deep-equal": { 289 | "version": "3.1.3", 290 | "inBundle": true, 291 | "license": "MIT" 292 | }, 293 | "node_modules/aws-cdk-lib/node_modules/fs-extra": { 294 | "version": "11.2.0", 295 | "inBundle": true, 296 | "license": "MIT", 297 | "dependencies": { 298 | "graceful-fs": "^4.2.0", 299 | "jsonfile": "^6.0.1", 300 | "universalify": "^2.0.0" 301 | }, 302 | "engines": { 303 | "node": ">=14.14" 304 | } 305 | }, 306 | "node_modules/aws-cdk-lib/node_modules/graceful-fs": { 307 | "version": "4.2.11", 308 | "inBundle": true, 309 | "license": "ISC" 310 | }, 311 | "node_modules/aws-cdk-lib/node_modules/ignore": { 312 | "version": "5.3.0", 313 | "inBundle": true, 314 | "license": "MIT", 315 | "engines": { 316 | "node": ">= 4" 317 | } 318 | }, 319 | "node_modules/aws-cdk-lib/node_modules/is-fullwidth-code-point": { 320 | "version": "3.0.0", 321 | "inBundle": true, 322 | "license": "MIT", 323 | "engines": { 324 | "node": ">=8" 325 | } 326 | }, 327 | "node_modules/aws-cdk-lib/node_modules/json-schema-traverse": { 328 | "version": "1.0.0", 329 | "inBundle": true, 330 | "license": "MIT" 331 | }, 332 | "node_modules/aws-cdk-lib/node_modules/jsonfile": { 333 | "version": "6.1.0", 334 | "inBundle": true, 335 | "license": "MIT", 336 | "dependencies": { 337 | "universalify": "^2.0.0" 338 | }, 339 | "optionalDependencies": { 340 | "graceful-fs": "^4.1.6" 341 | } 342 | }, 343 | "node_modules/aws-cdk-lib/node_modules/jsonschema": { 344 | "version": "1.4.1", 345 | "inBundle": true, 346 | "license": "MIT", 347 | "engines": { 348 | "node": "*" 349 | } 350 | }, 351 | "node_modules/aws-cdk-lib/node_modules/lodash.truncate": { 352 | "version": "4.4.2", 353 | "inBundle": true, 354 | "license": "MIT" 355 | }, 356 | "node_modules/aws-cdk-lib/node_modules/lru-cache": { 357 | "version": "6.0.0", 358 | "inBundle": true, 359 | "license": "ISC", 360 | "dependencies": { 361 | "yallist": "^4.0.0" 362 | }, 363 | "engines": { 364 | "node": ">=10" 365 | } 366 | }, 367 | "node_modules/aws-cdk-lib/node_modules/minimatch": { 368 | "version": "3.1.2", 369 | "inBundle": true, 370 | "license": "ISC", 371 | "dependencies": { 372 | "brace-expansion": "^1.1.7" 373 | }, 374 | "engines": { 375 | "node": "*" 376 | } 377 | }, 378 | "node_modules/aws-cdk-lib/node_modules/punycode": { 379 | "version": "2.3.1", 380 | "inBundle": true, 381 | "license": "MIT", 382 | "engines": { 383 | "node": ">=6" 384 | } 385 | }, 386 | "node_modules/aws-cdk-lib/node_modules/require-from-string": { 387 | "version": "2.0.2", 388 | "inBundle": true, 389 | "license": "MIT", 390 | "engines": { 391 | "node": ">=0.10.0" 392 | } 393 | }, 394 | "node_modules/aws-cdk-lib/node_modules/semver": { 395 | "version": "7.5.4", 396 | "inBundle": true, 397 | "license": "ISC", 398 | "dependencies": { 399 | "lru-cache": "^6.0.0" 400 | }, 401 | "bin": { 402 | "semver": "bin/semver.js" 403 | }, 404 | "engines": { 405 | "node": ">=10" 406 | } 407 | }, 408 | "node_modules/aws-cdk-lib/node_modules/slice-ansi": { 409 | "version": "4.0.0", 410 | "inBundle": true, 411 | "license": "MIT", 412 | "dependencies": { 413 | "ansi-styles": "^4.0.0", 414 | "astral-regex": "^2.0.0", 415 | "is-fullwidth-code-point": "^3.0.0" 416 | }, 417 | "engines": { 418 | "node": ">=10" 419 | }, 420 | "funding": { 421 | "url": "https://github.com/chalk/slice-ansi?sponsor=1" 422 | } 423 | }, 424 | "node_modules/aws-cdk-lib/node_modules/string-width": { 425 | "version": "4.2.3", 426 | "inBundle": true, 427 | "license": "MIT", 428 | "dependencies": { 429 | "emoji-regex": "^8.0.0", 430 | "is-fullwidth-code-point": "^3.0.0", 431 | "strip-ansi": "^6.0.1" 432 | }, 433 | "engines": { 434 | "node": ">=8" 435 | } 436 | }, 437 | "node_modules/aws-cdk-lib/node_modules/strip-ansi": { 438 | "version": "6.0.1", 439 | "inBundle": true, 440 | "license": "MIT", 441 | "dependencies": { 442 | "ansi-regex": "^5.0.1" 443 | }, 444 | "engines": { 445 | "node": ">=8" 446 | } 447 | }, 448 | "node_modules/aws-cdk-lib/node_modules/table": { 449 | "version": "6.8.1", 450 | "inBundle": true, 451 | "license": "BSD-3-Clause", 452 | "dependencies": { 453 | "ajv": "^8.0.1", 454 | "lodash.truncate": "^4.4.2", 455 | "slice-ansi": "^4.0.0", 456 | "string-width": "^4.2.3", 457 | "strip-ansi": "^6.0.1" 458 | }, 459 | "engines": { 460 | "node": ">=10.0.0" 461 | } 462 | }, 463 | "node_modules/aws-cdk-lib/node_modules/universalify": { 464 | "version": "2.0.1", 465 | "inBundle": true, 466 | "license": "MIT", 467 | "engines": { 468 | "node": ">= 10.0.0" 469 | } 470 | }, 471 | "node_modules/aws-cdk-lib/node_modules/uri-js": { 472 | "version": "4.4.1", 473 | "inBundle": true, 474 | "license": "BSD-2-Clause", 475 | "dependencies": { 476 | "punycode": "^2.1.0" 477 | } 478 | }, 479 | "node_modules/aws-cdk-lib/node_modules/yallist": { 480 | "version": "4.0.0", 481 | "inBundle": true, 482 | "license": "ISC" 483 | }, 484 | "node_modules/aws-cdk-lib/node_modules/yaml": { 485 | "version": "1.10.2", 486 | "inBundle": true, 487 | "license": "ISC", 488 | "engines": { 489 | "node": ">= 6" 490 | } 491 | }, 492 | "node_modules/buffer-from": { 493 | "version": "1.1.2", 494 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 495 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" 496 | }, 497 | "node_modules/constructs": { 498 | "version": "10.3.0", 499 | "resolved": "https://registry.npmjs.org/constructs/-/constructs-10.3.0.tgz", 500 | "integrity": "sha512-vbK8i3rIb/xwZxSpTjz3SagHn1qq9BChLEfy5Hf6fB3/2eFbrwt2n9kHwQcS0CPTRBesreeAcsJfMq2229FnbQ==", 501 | "engines": { 502 | "node": ">= 16.14.0" 503 | } 504 | }, 505 | "node_modules/create-require": { 506 | "version": "1.1.1", 507 | "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", 508 | "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", 509 | "dev": true 510 | }, 511 | "node_modules/diff": { 512 | "version": "4.0.2", 513 | "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", 514 | "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", 515 | "dev": true, 516 | "engines": { 517 | "node": ">=0.3.1" 518 | } 519 | }, 520 | "node_modules/fsevents": { 521 | "version": "2.3.2", 522 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 523 | "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 524 | "dev": true, 525 | "hasInstallScript": true, 526 | "optional": true, 527 | "os": [ 528 | "darwin" 529 | ], 530 | "engines": { 531 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 532 | } 533 | }, 534 | "node_modules/make-error": { 535 | "version": "1.3.6", 536 | "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", 537 | "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", 538 | "dev": true 539 | }, 540 | "node_modules/source-map": { 541 | "version": "0.6.1", 542 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 543 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 544 | "engines": { 545 | "node": ">=0.10.0" 546 | } 547 | }, 548 | "node_modules/source-map-support": { 549 | "version": "0.5.21", 550 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 551 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 552 | "dependencies": { 553 | "buffer-from": "^1.0.0", 554 | "source-map": "^0.6.0" 555 | } 556 | }, 557 | "node_modules/ts-node": { 558 | "version": "10.9.2", 559 | "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", 560 | "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", 561 | "dev": true, 562 | "dependencies": { 563 | "@cspotcode/source-map-support": "^0.8.0", 564 | "@tsconfig/node10": "^1.0.7", 565 | "@tsconfig/node12": "^1.0.7", 566 | "@tsconfig/node14": "^1.0.0", 567 | "@tsconfig/node16": "^1.0.2", 568 | "acorn": "^8.4.1", 569 | "acorn-walk": "^8.1.1", 570 | "arg": "^4.1.0", 571 | "create-require": "^1.1.0", 572 | "diff": "^4.0.1", 573 | "make-error": "^1.1.1", 574 | "v8-compile-cache-lib": "^3.0.1", 575 | "yn": "3.1.1" 576 | }, 577 | "bin": { 578 | "ts-node": "dist/bin.js", 579 | "ts-node-cwd": "dist/bin-cwd.js", 580 | "ts-node-esm": "dist/bin-esm.js", 581 | "ts-node-script": "dist/bin-script.js", 582 | "ts-node-transpile-only": "dist/bin-transpile.js", 583 | "ts-script": "dist/bin-script-deprecated.js" 584 | }, 585 | "peerDependencies": { 586 | "@swc/core": ">=1.2.50", 587 | "@swc/wasm": ">=1.2.50", 588 | "@types/node": "*", 589 | "typescript": ">=2.7" 590 | }, 591 | "peerDependenciesMeta": { 592 | "@swc/core": { 593 | "optional": true 594 | }, 595 | "@swc/wasm": { 596 | "optional": true 597 | } 598 | } 599 | }, 600 | "node_modules/typescript": { 601 | "version": "5.3.3", 602 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", 603 | "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", 604 | "dev": true, 605 | "bin": { 606 | "tsc": "bin/tsc", 607 | "tsserver": "bin/tsserver" 608 | }, 609 | "engines": { 610 | "node": ">=14.17" 611 | } 612 | }, 613 | "node_modules/undici-types": { 614 | "version": "5.26.5", 615 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", 616 | "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", 617 | "dev": true 618 | }, 619 | "node_modules/v8-compile-cache-lib": { 620 | "version": "3.0.1", 621 | "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", 622 | "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", 623 | "dev": true 624 | }, 625 | "node_modules/yn": { 626 | "version": "3.1.1", 627 | "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", 628 | "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", 629 | "dev": true, 630 | "engines": { 631 | "node": ">=6" 632 | } 633 | } 634 | } 635 | } 636 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vscode-on-ec2-for-prototyping", 3 | "private": true, 4 | "version": "0.1.0", 5 | "bin": { 6 | "vscode-on-ec2-for-prototyping": "bin/vscode-on-ec2-for-prototyping.js" 7 | }, 8 | "scripts": { 9 | "build": "tsc", 10 | "watch": "tsc -w", 11 | "cdk": "cdk" 12 | }, 13 | "devDependencies": { 14 | "@types/node": "20.11.5", 15 | "aws-cdk": "2.122.0", 16 | "ts-node": "^10.9.2", 17 | "typescript": "~5.3.3" 18 | }, 19 | "dependencies": { 20 | "aws-cdk-lib": "2.122.0", 21 | "constructs": "^10.0.0", 22 | "source-map-support": "^0.5.21" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /session.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | STACK=`aws cloudformation describe-stacks --stack-name VscodeOnEc2ForPrototypingStack` 4 | INSTANCE_ID=`echo $STACK | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "InstanceID") | .OutputValue'` 5 | PRIVATE_IP=`echo $STACK | jq -r '.Stacks[0].Outputs[] | select(.OutputKey == "PrivateIP") | .OutputValue'` 6 | 7 | echo 'Instance ID='.$INSTANCE_ID 8 | echo 'Private IP='.$PRIVATE_IP 9 | 10 | aws ssm start-session \ 11 | --target $INSTANCE_ID \ 12 | --document-name AWS-StartPortForwardingSessionToRemoteHost \ 13 | --parameters "{\"portNumber\":[\"8080\"],\"localPortNumber\":[\"8080\"],\"host\":[\"${PRIVATE_IP}\"]}" 14 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "module": "commonjs", 5 | "lib": [ 6 | "es2020", 7 | "dom" 8 | ], 9 | "declaration": true, 10 | "strict": true, 11 | "noImplicitAny": true, 12 | "strictNullChecks": true, 13 | "noImplicitThis": true, 14 | "alwaysStrict": true, 15 | "noUnusedLocals": false, 16 | "noUnusedParameters": false, 17 | "noImplicitReturns": true, 18 | "noFallthroughCasesInSwitch": false, 19 | "inlineSourceMap": true, 20 | "inlineSources": true, 21 | "experimentalDecorators": true, 22 | "strictPropertyInitialization": false, 23 | "typeRoots": [ 24 | "./node_modules/@types" 25 | ] 26 | }, 27 | "exclude": [ 28 | "node_modules", 29 | "cdk.out" 30 | ] 31 | } 32 | --------------------------------------------------------------------------------