cdk-vscode-server 0.0.14__py3-none-any.whl
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.
- cdk-vscode-server/__init__.py +588 -0
- cdk-vscode-server/_jsii/__init__.py +46 -0
- cdk-vscode-server/_jsii/cdk-vscode-server@0.0.14.jsii.tgz +0 -0
- cdk-vscode-server/py.typed +1 -0
- cdk_vscode_server-0.0.14.dist-info/LICENSE +202 -0
- cdk_vscode_server-0.0.14.dist-info/METADATA +231 -0
- cdk_vscode_server-0.0.14.dist-info/RECORD +9 -0
- cdk_vscode_server-0.0.14.dist-info/WHEEL +5 -0
- cdk_vscode_server-0.0.14.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
r'''
|
|
2
|
+

|
|
3
|
+
[](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml)
|
|
4
|
+
[](https://eslint.org)
|
|
5
|
+
[](https://github.com/MV-Consulting/cdk-vscode-server/releases)
|
|
6
|
+

|
|
7
|
+
[](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)
|
|
8
|
+
[](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)
|
|
9
|
+
|
|
10
|
+
# cdk-vscode-server
|
|
11
|
+
|
|
12
|
+
Running your dev IDE vscode on AWS for development and workshop purposes.
|
|
13
|
+
|
|
14
|
+
> [!Note]
|
|
15
|
+
> This construct is designed for workshop purposes and does not fulfill all security and authentication best practices.
|
|
16
|
+
|
|
17
|
+
**<br>This is an early version of the package. The API will change while I
|
|
18
|
+
we implement new features. Therefore make sure you use an exact version in your `package.json` before it reaches 1.0.0.**
|
|
19
|
+
|
|
20
|
+
## Table of Contents
|
|
21
|
+
|
|
22
|
+
* [Features](#features)
|
|
23
|
+
* [Usage](#usage)
|
|
24
|
+
* [Solution Design](#solution-design)
|
|
25
|
+
* [Inspiration](#inspiration)
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
* β‘ **Quick Setup**: Spin up and configure your [vscode](https://code.visualstudio.com/) server in under 10 minutes in your AWS account
|
|
30
|
+
* π **Best Practice Setup**: Set up with [projen](https://projen.io/) and a [single configuration file](./.projenrc.ts) to keep your changes centralized.
|
|
31
|
+
* π€ΉββοΈ **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.
|
|
32
|
+
* ποΈ **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...
|
|
33
|
+
|
|
34
|
+
## Usage
|
|
35
|
+
|
|
36
|
+
The following steps get you started:
|
|
37
|
+
|
|
38
|
+
1. Create a new `awscdk-app` via
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx projen new awscdk-app-ts --package-manager=npm
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
1. Add `@mavogel/cdk-vscode-server` as a dependency to your project in the `.projenrc.ts` file
|
|
45
|
+
2. Run `yarn run projen` to install it
|
|
46
|
+
3. Add the following to the `src/main.ts` file:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
50
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
51
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
52
|
+
import { Construct } from 'constructs';
|
|
53
|
+
import {
|
|
54
|
+
LinuxArchitectureType,
|
|
55
|
+
LinuxFlavorType,
|
|
56
|
+
VSCodeServer
|
|
57
|
+
} from '@mavogel/cdk-vscode-server';
|
|
58
|
+
|
|
59
|
+
export class MyStack extends Stack {
|
|
60
|
+
constructor(scope: Construct, id: string, props: StackProps = {}) {
|
|
61
|
+
super(scope, id, props);
|
|
62
|
+
|
|
63
|
+
new VSCodeServer(this, 'vscode', {
|
|
64
|
+
// for example (or simply use the defaults by not setting the properties)
|
|
65
|
+
instanceVolumeSize: 8,
|
|
66
|
+
instanceClass: ec2.InstanceClass.M7G,
|
|
67
|
+
instanceSize: ec2.InstanceSize.LARGE,
|
|
68
|
+
instanceOperatingSystem: LinuxFlavorType.UBUNTU_22,
|
|
69
|
+
instanceCpuArchitecture: LinuxArchitectureType.ARM,
|
|
70
|
+
|
|
71
|
+
// ππ½ or if you want to give the InstanceRole more permissions
|
|
72
|
+
additionalInstanceRolePolicies: [
|
|
73
|
+
new iam.PolicyStatement({
|
|
74
|
+
effect: iam.Effect.ALLOW,
|
|
75
|
+
actions: [
|
|
76
|
+
'codebuild:*',
|
|
77
|
+
],
|
|
78
|
+
resources: [
|
|
79
|
+
`arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,
|
|
80
|
+
],
|
|
81
|
+
}),
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
// and more... π‘
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const env = {
|
|
90
|
+
account: '123456789912',
|
|
91
|
+
region: 'eu-central-1',
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const app = new App();
|
|
95
|
+
new MyStack(app, 'vscode-server', { env });
|
|
96
|
+
app.synth();
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
and deploy it
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx projen build
|
|
103
|
+
npx projen deploy
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
with the output
|
|
107
|
+
|
|
108
|
+
```console
|
|
109
|
+
β¨ Deployment time: 509.87s
|
|
110
|
+
|
|
111
|
+
Outputs:
|
|
112
|
+
dev.vscodedomainName6729AA39 = https://d1foo65bar4baz.cloudfront.net/?folder=/Workshop
|
|
113
|
+
dev.vscodepassword64FBCA12 = foobarbaz
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
See the [examples](./examples) folder for more inspiration.
|
|
117
|
+
|
|
118
|
+
1. Then open the domain name in your favorite browser and you'd see the following login screen:
|
|
119
|
+

|
|
120
|
+
2. After entering the password, you are logged into VSCode and can start coding :tada:
|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
> [!Important]
|
|
125
|
+
> There are issues with copy pasting into the VSCode terminal within the Firefox browser (2025-01-12)
|
|
126
|
+
|
|
127
|
+
## Solution Design
|
|
128
|
+
|
|
129
|
+
<details>
|
|
130
|
+
<summary>... if you're curious about click here for the details</summary>
|
|
131
|
+
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
</details>
|
|
135
|
+
|
|
136
|
+
## Inspiration
|
|
137
|
+
|
|
138
|
+
This project was created based on the following inspiration
|
|
139
|
+
|
|
140
|
+
* [vscode-on-ec2-for-prototyping](https://github.com/aws-samples/vscode-on-ec2-for-prototyping): as baseline, which unfortunately was outdated
|
|
141
|
+
* [aws-terraform-dev-container](https://github.com/awslabs/aws-terraform-dev-container): as baseline for terraform, but unfortunately also outdated
|
|
142
|
+
* [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
|
|
143
|
+
* [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.
|
|
144
|
+
* [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
|
|
145
|
+
|
|
146
|
+
## π Unlock the Full Potential of Your AWS Cloud Infrastructure
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### π Why Work With Me?
|
|
154
|
+
|
|
155
|
+
βοΈ **Tailored AWS Solutions:** Every business is unique, so I design custom solutions that fit your goals and challenges.
|
|
156
|
+
βοΈ **Well-Architected Designs:** From scalability to security, my solutions align with AWS Well-Architected Framework.
|
|
157
|
+
βοΈ **Cloud-Native Focus:** I specialize in modern, cloud-native systems that embrace the full potential of AWS.
|
|
158
|
+
βοΈ **Business-Driven Tech:** Technology should serve your business, not the other way around.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### π What I Bring to the Table
|
|
164
|
+
|
|
165
|
+
π **12x AWS Certifications**
|
|
166
|
+
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](https://www.credly.com/users/manuel-vogel)
|
|
167
|
+
|
|
168
|
+
βοΈ **Infrastructure as Code (IaC)**
|
|
169
|
+
With deep expertise in **AWS CDK** and **Terraform**, I ensure your infrastructure is automated, maintainable, and scalable.
|
|
170
|
+
|
|
171
|
+
π¦ **DevOps Expertise**
|
|
172
|
+
From CI/CD pipelines with **GitHub Actions** and **GitLab CI** to container orchestration **Kubernetes** and others, I deliver workflows that are smooth and efficient.
|
|
173
|
+
|
|
174
|
+
π **Hands-On Experience**
|
|
175
|
+
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](https://github.com/mavogel)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
### πΌ Letβs Build Something Great Together
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
βοΈ **Direct Collaboration**: No middlemen or red tape β you work with me directly.
|
|
185
|
+
βοΈ **Transparent Process**: Expect open communication, clear timelines, and visible results.
|
|
186
|
+
βοΈ **Real Value**: My solutions focus on delivering measurable impact for your business.
|
|
187
|
+
|
|
188
|
+
<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>
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
## π Acknowledgements
|
|
194
|
+
|
|
195
|
+
Big shoutout to the amazing team behind [Projen](https://github.com/projen/projen)!
|
|
196
|
+
Their groundbreaking work simplifies cloud infrastructure projects and inspires us every day. π‘
|
|
197
|
+
|
|
198
|
+
## Author
|
|
199
|
+
|
|
200
|
+
[Manuel Vogel](https://manuel-vogel.de/about/)
|
|
201
|
+
|
|
202
|
+
[](https://www.linkedin.com/in/manuel-vogel)
|
|
203
|
+
[](https://github.com/mavogel)
|
|
204
|
+
'''
|
|
205
|
+
from pkgutil import extend_path
|
|
206
|
+
__path__ = extend_path(__path__, __name__)
|
|
207
|
+
|
|
208
|
+
import abc
|
|
209
|
+
import builtins
|
|
210
|
+
import datetime
|
|
211
|
+
import enum
|
|
212
|
+
import typing
|
|
213
|
+
|
|
214
|
+
import jsii
|
|
215
|
+
import publication
|
|
216
|
+
import typing_extensions
|
|
217
|
+
|
|
218
|
+
import typeguard
|
|
219
|
+
from importlib.metadata import version as _metadata_package_version
|
|
220
|
+
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
221
|
+
|
|
222
|
+
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
223
|
+
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
224
|
+
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
225
|
+
else:
|
|
226
|
+
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
227
|
+
pass
|
|
228
|
+
else:
|
|
229
|
+
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
230
|
+
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
231
|
+
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
232
|
+
else:
|
|
233
|
+
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
234
|
+
|
|
235
|
+
from ._jsii import *
|
|
236
|
+
|
|
237
|
+
import aws_cdk.aws_ec2 as _aws_cdk_aws_ec2_ceddda9d
|
|
238
|
+
import aws_cdk.aws_iam as _aws_cdk_aws_iam_ceddda9d
|
|
239
|
+
import constructs as _constructs_77d1e7e8
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
@jsii.enum(jsii_type="@mavogel/cdk-vscode-server.LinuxArchitectureType")
|
|
243
|
+
class LinuxArchitectureType(enum.Enum):
|
|
244
|
+
'''The architecture of the cpu you want to run vscode server on.'''
|
|
245
|
+
|
|
246
|
+
ARM = "ARM"
|
|
247
|
+
AMD64 = "AMD64"
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
@jsii.enum(jsii_type="@mavogel/cdk-vscode-server.LinuxFlavorType")
|
|
251
|
+
class LinuxFlavorType(enum.Enum):
|
|
252
|
+
'''The flavor of linux you want to run vscode server on.'''
|
|
253
|
+
|
|
254
|
+
UBUNTU_22 = "UBUNTU_22"
|
|
255
|
+
UBUNTU_24 = "UBUNTU_24"
|
|
256
|
+
AMAZON_LINUX_2023 = "AMAZON_LINUX_2023"
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
class VSCodeServer(
|
|
260
|
+
_constructs_77d1e7e8.Construct,
|
|
261
|
+
metaclass=jsii.JSIIMeta,
|
|
262
|
+
jsii_type="@mavogel/cdk-vscode-server.VSCodeServer",
|
|
263
|
+
):
|
|
264
|
+
def __init__(
|
|
265
|
+
self,
|
|
266
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
267
|
+
id: builtins.str,
|
|
268
|
+
*,
|
|
269
|
+
additional_instance_role_policies: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
270
|
+
dev_server_base_path: typing.Optional[builtins.str] = None,
|
|
271
|
+
dev_server_port: typing.Optional[jsii.Number] = None,
|
|
272
|
+
home_folder: typing.Optional[builtins.str] = None,
|
|
273
|
+
instance_class: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass] = None,
|
|
274
|
+
instance_cpu_architecture: typing.Optional[LinuxArchitectureType] = None,
|
|
275
|
+
instance_name: typing.Optional[builtins.str] = None,
|
|
276
|
+
instance_operating_system: typing.Optional[LinuxFlavorType] = None,
|
|
277
|
+
instance_size: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize] = None,
|
|
278
|
+
instance_volume_size: typing.Optional[jsii.Number] = None,
|
|
279
|
+
vscode_password: typing.Optional[builtins.str] = None,
|
|
280
|
+
vscode_user: typing.Optional[builtins.str] = None,
|
|
281
|
+
) -> None:
|
|
282
|
+
'''
|
|
283
|
+
:param scope: -
|
|
284
|
+
:param id: -
|
|
285
|
+
:param additional_instance_role_policies: Additional instance role policies. Default: - []
|
|
286
|
+
:param dev_server_base_path: Base path for the application to be added to Nginx sites-available list. Default: - app
|
|
287
|
+
:param dev_server_port: Port for the DevServer. Default: - 8081
|
|
288
|
+
:param home_folder: Folder to open in VS Code server. Default: - /Workshop
|
|
289
|
+
:param instance_class: VSCode Server EC2 instance class. Default: - m7g
|
|
290
|
+
:param instance_cpu_architecture: VSCode Server EC2 cpu architecture for the operating system. Default: - arm
|
|
291
|
+
:param instance_name: VSCode Server EC2 instance name. Default: - VSCodeServer
|
|
292
|
+
:param instance_operating_system: VSCode Server EC2 operating system. Default: - Ubuntu-22
|
|
293
|
+
:param instance_size: VSCode Server EC2 instance size. Default: - xlarge
|
|
294
|
+
:param instance_volume_size: VSCode Server EC2 instance volume size in GB. Default: - 40
|
|
295
|
+
:param vscode_password: Password for VSCode Server. Default: - empty and will then be generated
|
|
296
|
+
:param vscode_user: UserName for VSCode Server. Default: - participant
|
|
297
|
+
'''
|
|
298
|
+
if __debug__:
|
|
299
|
+
type_hints = typing.get_type_hints(_typecheckingstub__13d98894e731d8d5e45fa4088dfd79af04a4cb66cead591188c4ba44d922873c)
|
|
300
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
301
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
302
|
+
props = VSCodeServerProps(
|
|
303
|
+
additional_instance_role_policies=additional_instance_role_policies,
|
|
304
|
+
dev_server_base_path=dev_server_base_path,
|
|
305
|
+
dev_server_port=dev_server_port,
|
|
306
|
+
home_folder=home_folder,
|
|
307
|
+
instance_class=instance_class,
|
|
308
|
+
instance_cpu_architecture=instance_cpu_architecture,
|
|
309
|
+
instance_name=instance_name,
|
|
310
|
+
instance_operating_system=instance_operating_system,
|
|
311
|
+
instance_size=instance_size,
|
|
312
|
+
instance_volume_size=instance_volume_size,
|
|
313
|
+
vscode_password=vscode_password,
|
|
314
|
+
vscode_user=vscode_user,
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
318
|
+
|
|
319
|
+
@builtins.property
|
|
320
|
+
@jsii.member(jsii_name="domainName")
|
|
321
|
+
def domain_name(self) -> builtins.str:
|
|
322
|
+
return typing.cast(builtins.str, jsii.get(self, "domainName"))
|
|
323
|
+
|
|
324
|
+
@builtins.property
|
|
325
|
+
@jsii.member(jsii_name="password")
|
|
326
|
+
def password(self) -> builtins.str:
|
|
327
|
+
return typing.cast(builtins.str, jsii.get(self, "password"))
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
@jsii.data_type(
|
|
331
|
+
jsii_type="@mavogel/cdk-vscode-server.VSCodeServerProps",
|
|
332
|
+
jsii_struct_bases=[],
|
|
333
|
+
name_mapping={
|
|
334
|
+
"additional_instance_role_policies": "additionalInstanceRolePolicies",
|
|
335
|
+
"dev_server_base_path": "devServerBasePath",
|
|
336
|
+
"dev_server_port": "devServerPort",
|
|
337
|
+
"home_folder": "homeFolder",
|
|
338
|
+
"instance_class": "instanceClass",
|
|
339
|
+
"instance_cpu_architecture": "instanceCpuArchitecture",
|
|
340
|
+
"instance_name": "instanceName",
|
|
341
|
+
"instance_operating_system": "instanceOperatingSystem",
|
|
342
|
+
"instance_size": "instanceSize",
|
|
343
|
+
"instance_volume_size": "instanceVolumeSize",
|
|
344
|
+
"vscode_password": "vscodePassword",
|
|
345
|
+
"vscode_user": "vscodeUser",
|
|
346
|
+
},
|
|
347
|
+
)
|
|
348
|
+
class VSCodeServerProps:
|
|
349
|
+
def __init__(
|
|
350
|
+
self,
|
|
351
|
+
*,
|
|
352
|
+
additional_instance_role_policies: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
353
|
+
dev_server_base_path: typing.Optional[builtins.str] = None,
|
|
354
|
+
dev_server_port: typing.Optional[jsii.Number] = None,
|
|
355
|
+
home_folder: typing.Optional[builtins.str] = None,
|
|
356
|
+
instance_class: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass] = None,
|
|
357
|
+
instance_cpu_architecture: typing.Optional[LinuxArchitectureType] = None,
|
|
358
|
+
instance_name: typing.Optional[builtins.str] = None,
|
|
359
|
+
instance_operating_system: typing.Optional[LinuxFlavorType] = None,
|
|
360
|
+
instance_size: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize] = None,
|
|
361
|
+
instance_volume_size: typing.Optional[jsii.Number] = None,
|
|
362
|
+
vscode_password: typing.Optional[builtins.str] = None,
|
|
363
|
+
vscode_user: typing.Optional[builtins.str] = None,
|
|
364
|
+
) -> None:
|
|
365
|
+
'''
|
|
366
|
+
:param additional_instance_role_policies: Additional instance role policies. Default: - []
|
|
367
|
+
:param dev_server_base_path: Base path for the application to be added to Nginx sites-available list. Default: - app
|
|
368
|
+
:param dev_server_port: Port for the DevServer. Default: - 8081
|
|
369
|
+
:param home_folder: Folder to open in VS Code server. Default: - /Workshop
|
|
370
|
+
:param instance_class: VSCode Server EC2 instance class. Default: - m7g
|
|
371
|
+
:param instance_cpu_architecture: VSCode Server EC2 cpu architecture for the operating system. Default: - arm
|
|
372
|
+
:param instance_name: VSCode Server EC2 instance name. Default: - VSCodeServer
|
|
373
|
+
:param instance_operating_system: VSCode Server EC2 operating system. Default: - Ubuntu-22
|
|
374
|
+
:param instance_size: VSCode Server EC2 instance size. Default: - xlarge
|
|
375
|
+
:param instance_volume_size: VSCode Server EC2 instance volume size in GB. Default: - 40
|
|
376
|
+
:param vscode_password: Password for VSCode Server. Default: - empty and will then be generated
|
|
377
|
+
:param vscode_user: UserName for VSCode Server. Default: - participant
|
|
378
|
+
'''
|
|
379
|
+
if __debug__:
|
|
380
|
+
type_hints = typing.get_type_hints(_typecheckingstub__2e462747a4e6316ff07a1ca12065fecb7b143031e2052b9b3ed692a4d9a458c7)
|
|
381
|
+
check_type(argname="argument additional_instance_role_policies", value=additional_instance_role_policies, expected_type=type_hints["additional_instance_role_policies"])
|
|
382
|
+
check_type(argname="argument dev_server_base_path", value=dev_server_base_path, expected_type=type_hints["dev_server_base_path"])
|
|
383
|
+
check_type(argname="argument dev_server_port", value=dev_server_port, expected_type=type_hints["dev_server_port"])
|
|
384
|
+
check_type(argname="argument home_folder", value=home_folder, expected_type=type_hints["home_folder"])
|
|
385
|
+
check_type(argname="argument instance_class", value=instance_class, expected_type=type_hints["instance_class"])
|
|
386
|
+
check_type(argname="argument instance_cpu_architecture", value=instance_cpu_architecture, expected_type=type_hints["instance_cpu_architecture"])
|
|
387
|
+
check_type(argname="argument instance_name", value=instance_name, expected_type=type_hints["instance_name"])
|
|
388
|
+
check_type(argname="argument instance_operating_system", value=instance_operating_system, expected_type=type_hints["instance_operating_system"])
|
|
389
|
+
check_type(argname="argument instance_size", value=instance_size, expected_type=type_hints["instance_size"])
|
|
390
|
+
check_type(argname="argument instance_volume_size", value=instance_volume_size, expected_type=type_hints["instance_volume_size"])
|
|
391
|
+
check_type(argname="argument vscode_password", value=vscode_password, expected_type=type_hints["vscode_password"])
|
|
392
|
+
check_type(argname="argument vscode_user", value=vscode_user, expected_type=type_hints["vscode_user"])
|
|
393
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
394
|
+
if additional_instance_role_policies is not None:
|
|
395
|
+
self._values["additional_instance_role_policies"] = additional_instance_role_policies
|
|
396
|
+
if dev_server_base_path is not None:
|
|
397
|
+
self._values["dev_server_base_path"] = dev_server_base_path
|
|
398
|
+
if dev_server_port is not None:
|
|
399
|
+
self._values["dev_server_port"] = dev_server_port
|
|
400
|
+
if home_folder is not None:
|
|
401
|
+
self._values["home_folder"] = home_folder
|
|
402
|
+
if instance_class is not None:
|
|
403
|
+
self._values["instance_class"] = instance_class
|
|
404
|
+
if instance_cpu_architecture is not None:
|
|
405
|
+
self._values["instance_cpu_architecture"] = instance_cpu_architecture
|
|
406
|
+
if instance_name is not None:
|
|
407
|
+
self._values["instance_name"] = instance_name
|
|
408
|
+
if instance_operating_system is not None:
|
|
409
|
+
self._values["instance_operating_system"] = instance_operating_system
|
|
410
|
+
if instance_size is not None:
|
|
411
|
+
self._values["instance_size"] = instance_size
|
|
412
|
+
if instance_volume_size is not None:
|
|
413
|
+
self._values["instance_volume_size"] = instance_volume_size
|
|
414
|
+
if vscode_password is not None:
|
|
415
|
+
self._values["vscode_password"] = vscode_password
|
|
416
|
+
if vscode_user is not None:
|
|
417
|
+
self._values["vscode_user"] = vscode_user
|
|
418
|
+
|
|
419
|
+
@builtins.property
|
|
420
|
+
def additional_instance_role_policies(
|
|
421
|
+
self,
|
|
422
|
+
) -> typing.Optional[typing.List[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]]:
|
|
423
|
+
'''Additional instance role policies.
|
|
424
|
+
|
|
425
|
+
:default: - []
|
|
426
|
+
'''
|
|
427
|
+
result = self._values.get("additional_instance_role_policies")
|
|
428
|
+
return typing.cast(typing.Optional[typing.List[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]], result)
|
|
429
|
+
|
|
430
|
+
@builtins.property
|
|
431
|
+
def dev_server_base_path(self) -> typing.Optional[builtins.str]:
|
|
432
|
+
'''Base path for the application to be added to Nginx sites-available list.
|
|
433
|
+
|
|
434
|
+
:default: - app
|
|
435
|
+
'''
|
|
436
|
+
result = self._values.get("dev_server_base_path")
|
|
437
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
438
|
+
|
|
439
|
+
@builtins.property
|
|
440
|
+
def dev_server_port(self) -> typing.Optional[jsii.Number]:
|
|
441
|
+
'''Port for the DevServer.
|
|
442
|
+
|
|
443
|
+
:default: - 8081
|
|
444
|
+
'''
|
|
445
|
+
result = self._values.get("dev_server_port")
|
|
446
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
447
|
+
|
|
448
|
+
@builtins.property
|
|
449
|
+
def home_folder(self) -> typing.Optional[builtins.str]:
|
|
450
|
+
'''Folder to open in VS Code server.
|
|
451
|
+
|
|
452
|
+
:default: - /Workshop
|
|
453
|
+
'''
|
|
454
|
+
result = self._values.get("home_folder")
|
|
455
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
456
|
+
|
|
457
|
+
@builtins.property
|
|
458
|
+
def instance_class(
|
|
459
|
+
self,
|
|
460
|
+
) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass]:
|
|
461
|
+
'''VSCode Server EC2 instance class.
|
|
462
|
+
|
|
463
|
+
:default: - m7g
|
|
464
|
+
'''
|
|
465
|
+
result = self._values.get("instance_class")
|
|
466
|
+
return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass], result)
|
|
467
|
+
|
|
468
|
+
@builtins.property
|
|
469
|
+
def instance_cpu_architecture(self) -> typing.Optional[LinuxArchitectureType]:
|
|
470
|
+
'''VSCode Server EC2 cpu architecture for the operating system.
|
|
471
|
+
|
|
472
|
+
:default: - arm
|
|
473
|
+
'''
|
|
474
|
+
result = self._values.get("instance_cpu_architecture")
|
|
475
|
+
return typing.cast(typing.Optional[LinuxArchitectureType], result)
|
|
476
|
+
|
|
477
|
+
@builtins.property
|
|
478
|
+
def instance_name(self) -> typing.Optional[builtins.str]:
|
|
479
|
+
'''VSCode Server EC2 instance name.
|
|
480
|
+
|
|
481
|
+
:default: - VSCodeServer
|
|
482
|
+
'''
|
|
483
|
+
result = self._values.get("instance_name")
|
|
484
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
485
|
+
|
|
486
|
+
@builtins.property
|
|
487
|
+
def instance_operating_system(self) -> typing.Optional[LinuxFlavorType]:
|
|
488
|
+
'''VSCode Server EC2 operating system.
|
|
489
|
+
|
|
490
|
+
:default: - Ubuntu-22
|
|
491
|
+
'''
|
|
492
|
+
result = self._values.get("instance_operating_system")
|
|
493
|
+
return typing.cast(typing.Optional[LinuxFlavorType], result)
|
|
494
|
+
|
|
495
|
+
@builtins.property
|
|
496
|
+
def instance_size(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize]:
|
|
497
|
+
'''VSCode Server EC2 instance size.
|
|
498
|
+
|
|
499
|
+
:default: - xlarge
|
|
500
|
+
'''
|
|
501
|
+
result = self._values.get("instance_size")
|
|
502
|
+
return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize], result)
|
|
503
|
+
|
|
504
|
+
@builtins.property
|
|
505
|
+
def instance_volume_size(self) -> typing.Optional[jsii.Number]:
|
|
506
|
+
'''VSCode Server EC2 instance volume size in GB.
|
|
507
|
+
|
|
508
|
+
:default: - 40
|
|
509
|
+
'''
|
|
510
|
+
result = self._values.get("instance_volume_size")
|
|
511
|
+
return typing.cast(typing.Optional[jsii.Number], result)
|
|
512
|
+
|
|
513
|
+
@builtins.property
|
|
514
|
+
def vscode_password(self) -> typing.Optional[builtins.str]:
|
|
515
|
+
'''Password for VSCode Server.
|
|
516
|
+
|
|
517
|
+
:default: - empty and will then be generated
|
|
518
|
+
'''
|
|
519
|
+
result = self._values.get("vscode_password")
|
|
520
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
521
|
+
|
|
522
|
+
@builtins.property
|
|
523
|
+
def vscode_user(self) -> typing.Optional[builtins.str]:
|
|
524
|
+
'''UserName for VSCode Server.
|
|
525
|
+
|
|
526
|
+
:default: - participant
|
|
527
|
+
'''
|
|
528
|
+
result = self._values.get("vscode_user")
|
|
529
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
530
|
+
|
|
531
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
532
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
533
|
+
|
|
534
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
535
|
+
return not (rhs == self)
|
|
536
|
+
|
|
537
|
+
def __repr__(self) -> str:
|
|
538
|
+
return "VSCodeServerProps(%s)" % ", ".join(
|
|
539
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
540
|
+
)
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
__all__ = [
|
|
544
|
+
"LinuxArchitectureType",
|
|
545
|
+
"LinuxFlavorType",
|
|
546
|
+
"VSCodeServer",
|
|
547
|
+
"VSCodeServerProps",
|
|
548
|
+
]
|
|
549
|
+
|
|
550
|
+
publication.publish()
|
|
551
|
+
|
|
552
|
+
def _typecheckingstub__13d98894e731d8d5e45fa4088dfd79af04a4cb66cead591188c4ba44d922873c(
|
|
553
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
554
|
+
id: builtins.str,
|
|
555
|
+
*,
|
|
556
|
+
additional_instance_role_policies: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
557
|
+
dev_server_base_path: typing.Optional[builtins.str] = None,
|
|
558
|
+
dev_server_port: typing.Optional[jsii.Number] = None,
|
|
559
|
+
home_folder: typing.Optional[builtins.str] = None,
|
|
560
|
+
instance_class: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass] = None,
|
|
561
|
+
instance_cpu_architecture: typing.Optional[LinuxArchitectureType] = None,
|
|
562
|
+
instance_name: typing.Optional[builtins.str] = None,
|
|
563
|
+
instance_operating_system: typing.Optional[LinuxFlavorType] = None,
|
|
564
|
+
instance_size: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize] = None,
|
|
565
|
+
instance_volume_size: typing.Optional[jsii.Number] = None,
|
|
566
|
+
vscode_password: typing.Optional[builtins.str] = None,
|
|
567
|
+
vscode_user: typing.Optional[builtins.str] = None,
|
|
568
|
+
) -> None:
|
|
569
|
+
"""Type checking stubs"""
|
|
570
|
+
pass
|
|
571
|
+
|
|
572
|
+
def _typecheckingstub__2e462747a4e6316ff07a1ca12065fecb7b143031e2052b9b3ed692a4d9a458c7(
|
|
573
|
+
*,
|
|
574
|
+
additional_instance_role_policies: typing.Optional[typing.Sequence[_aws_cdk_aws_iam_ceddda9d.PolicyStatement]] = None,
|
|
575
|
+
dev_server_base_path: typing.Optional[builtins.str] = None,
|
|
576
|
+
dev_server_port: typing.Optional[jsii.Number] = None,
|
|
577
|
+
home_folder: typing.Optional[builtins.str] = None,
|
|
578
|
+
instance_class: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceClass] = None,
|
|
579
|
+
instance_cpu_architecture: typing.Optional[LinuxArchitectureType] = None,
|
|
580
|
+
instance_name: typing.Optional[builtins.str] = None,
|
|
581
|
+
instance_operating_system: typing.Optional[LinuxFlavorType] = None,
|
|
582
|
+
instance_size: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.InstanceSize] = None,
|
|
583
|
+
instance_volume_size: typing.Optional[jsii.Number] = None,
|
|
584
|
+
vscode_password: typing.Optional[builtins.str] = None,
|
|
585
|
+
vscode_user: typing.Optional[builtins.str] = None,
|
|
586
|
+
) -> None:
|
|
587
|
+
"""Type checking stubs"""
|
|
588
|
+
pass
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from pkgutil import extend_path
|
|
2
|
+
__path__ = extend_path(__path__, __name__)
|
|
3
|
+
|
|
4
|
+
import abc
|
|
5
|
+
import builtins
|
|
6
|
+
import datetime
|
|
7
|
+
import enum
|
|
8
|
+
import typing
|
|
9
|
+
|
|
10
|
+
import jsii
|
|
11
|
+
import publication
|
|
12
|
+
import typing_extensions
|
|
13
|
+
|
|
14
|
+
import typeguard
|
|
15
|
+
from importlib.metadata import version as _metadata_package_version
|
|
16
|
+
TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
|
|
17
|
+
|
|
18
|
+
def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
|
|
19
|
+
if TYPEGUARD_MAJOR_VERSION <= 2:
|
|
20
|
+
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
|
|
21
|
+
else:
|
|
22
|
+
if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
|
|
23
|
+
pass
|
|
24
|
+
else:
|
|
25
|
+
if TYPEGUARD_MAJOR_VERSION == 3:
|
|
26
|
+
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
|
|
27
|
+
typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
|
|
28
|
+
else:
|
|
29
|
+
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
|
|
30
|
+
|
|
31
|
+
import aws_cdk._jsii
|
|
32
|
+
import cdk_nag._jsii
|
|
33
|
+
import constructs._jsii
|
|
34
|
+
|
|
35
|
+
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
|
36
|
+
"@mavogel/cdk-vscode-server",
|
|
37
|
+
"0.0.14",
|
|
38
|
+
__name__[0:-6],
|
|
39
|
+
"cdk-vscode-server@0.0.14.jsii.tgz",
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
__all__ = [
|
|
43
|
+
"__jsii_assembly__",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
publication.publish()
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: cdk-vscode-server
|
|
3
|
+
Version: 0.0.14
|
|
4
|
+
Summary: Running VS Code Server on AWS
|
|
5
|
+
Home-page: https://github.com/MV-Consulting/cdk-vscode-server.git
|
|
6
|
+
Author: Manuel Vogel<info@manuel-vogel.de>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Source, https://github.com/MV-Consulting/cdk-vscode-server.git
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: JavaScript
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Typing :: Typed
|
|
18
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
19
|
+
Classifier: License :: OSI Approved
|
|
20
|
+
Requires-Python: ~=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: aws-cdk-lib<3.0.0,>=2.165.0
|
|
24
|
+
Requires-Dist: cdk-nag<3.0.0,>=2.35.0
|
|
25
|
+
Requires-Dist: constructs<11.0.0,>=10.0.5
|
|
26
|
+
Requires-Dist: jsii<2.0.0,>=1.106.0
|
|
27
|
+
Requires-Dist: publication>=0.0.3
|
|
28
|
+
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
[](https://github.com/MV-Consulting/cdk-vscode-server/actions/workflows/build.yml)
|
|
32
|
+
[](https://eslint.org)
|
|
33
|
+
[](https://github.com/MV-Consulting/cdk-vscode-server/releases)
|
|
34
|
+

|
|
35
|
+
[](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)
|
|
36
|
+
[](https://www.npmjs.com/package/@mavogel/cdk-vscode-server)
|
|
37
|
+
|
|
38
|
+
# cdk-vscode-server
|
|
39
|
+
|
|
40
|
+
Running your dev IDE vscode on AWS for development and workshop purposes.
|
|
41
|
+
|
|
42
|
+
> [!Note]
|
|
43
|
+
> This construct is designed for workshop purposes and does not fulfill all security and authentication best practices.
|
|
44
|
+
|
|
45
|
+
**<br>This is an early version of the package. The API will change while I
|
|
46
|
+
we implement new features. Therefore make sure you use an exact version in your `package.json` before it reaches 1.0.0.**
|
|
47
|
+
|
|
48
|
+
## Table of Contents
|
|
49
|
+
|
|
50
|
+
* [Features](#features)
|
|
51
|
+
* [Usage](#usage)
|
|
52
|
+
* [Solution Design](#solution-design)
|
|
53
|
+
* [Inspiration](#inspiration)
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
* β‘ **Quick Setup**: Spin up and configure your [vscode](https://code.visualstudio.com/) server in under 10 minutes in your AWS account
|
|
58
|
+
* π **Best Practice Setup**: Set up with [projen](https://projen.io/) and a [single configuration file](./.projenrc.ts) to keep your changes centralized.
|
|
59
|
+
* π€ΉββοΈ **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.
|
|
60
|
+
* ποΈ **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...
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
The following steps get you started:
|
|
65
|
+
|
|
66
|
+
1. Create a new `awscdk-app` via
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx projen new awscdk-app-ts --package-manager=npm
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
1. Add `@mavogel/cdk-vscode-server` as a dependency to your project in the `.projenrc.ts` file
|
|
73
|
+
2. Run `yarn run projen` to install it
|
|
74
|
+
3. Add the following to the `src/main.ts` file:
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import { App, Stack, StackProps } from 'aws-cdk-lib';
|
|
78
|
+
import * as ec2 from 'aws-cdk-lib/aws-ec2';
|
|
79
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
80
|
+
import { Construct } from 'constructs';
|
|
81
|
+
import {
|
|
82
|
+
LinuxArchitectureType,
|
|
83
|
+
LinuxFlavorType,
|
|
84
|
+
VSCodeServer
|
|
85
|
+
} from '@mavogel/cdk-vscode-server';
|
|
86
|
+
|
|
87
|
+
export class MyStack extends Stack {
|
|
88
|
+
constructor(scope: Construct, id: string, props: StackProps = {}) {
|
|
89
|
+
super(scope, id, props);
|
|
90
|
+
|
|
91
|
+
new VSCodeServer(this, 'vscode', {
|
|
92
|
+
// for example (or simply use the defaults by not setting the properties)
|
|
93
|
+
instanceVolumeSize: 8,
|
|
94
|
+
instanceClass: ec2.InstanceClass.M7G,
|
|
95
|
+
instanceSize: ec2.InstanceSize.LARGE,
|
|
96
|
+
instanceOperatingSystem: LinuxFlavorType.UBUNTU_22,
|
|
97
|
+
instanceCpuArchitecture: LinuxArchitectureType.ARM,
|
|
98
|
+
|
|
99
|
+
// ππ½ or if you want to give the InstanceRole more permissions
|
|
100
|
+
additionalInstanceRolePolicies: [
|
|
101
|
+
new iam.PolicyStatement({
|
|
102
|
+
effect: iam.Effect.ALLOW,
|
|
103
|
+
actions: [
|
|
104
|
+
'codebuild:*',
|
|
105
|
+
],
|
|
106
|
+
resources: [
|
|
107
|
+
`arn:aws:codebuild:*:${Stack.of(this).account}:*/*`,
|
|
108
|
+
],
|
|
109
|
+
}),
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
// and more... π‘
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const env = {
|
|
118
|
+
account: '123456789912',
|
|
119
|
+
region: 'eu-central-1',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const app = new App();
|
|
123
|
+
new MyStack(app, 'vscode-server', { env });
|
|
124
|
+
app.synth();
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
and deploy it
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx projen build
|
|
131
|
+
npx projen deploy
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
with the output
|
|
135
|
+
|
|
136
|
+
```console
|
|
137
|
+
β¨ Deployment time: 509.87s
|
|
138
|
+
|
|
139
|
+
Outputs:
|
|
140
|
+
dev.vscodedomainName6729AA39 = https://d1foo65bar4baz.cloudfront.net/?folder=/Workshop
|
|
141
|
+
dev.vscodepassword64FBCA12 = foobarbaz
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
See the [examples](./examples) folder for more inspiration.
|
|
145
|
+
|
|
146
|
+
1. Then open the domain name in your favorite browser and you'd see the following login screen:
|
|
147
|
+

|
|
148
|
+
2. After entering the password, you are logged into VSCode and can start coding :tada:
|
|
149
|
+
|
|
150
|
+

|
|
151
|
+
|
|
152
|
+
> [!Important]
|
|
153
|
+
> There are issues with copy pasting into the VSCode terminal within the Firefox browser (2025-01-12)
|
|
154
|
+
|
|
155
|
+
## Solution Design
|
|
156
|
+
|
|
157
|
+
<details>
|
|
158
|
+
<summary>... if you're curious about click here for the details</summary>
|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
162
|
+
</details>
|
|
163
|
+
|
|
164
|
+
## Inspiration
|
|
165
|
+
|
|
166
|
+
This project was created based on the following inspiration
|
|
167
|
+
|
|
168
|
+
* [vscode-on-ec2-for-prototyping](https://github.com/aws-samples/vscode-on-ec2-for-prototyping): as baseline, which unfortunately was outdated
|
|
169
|
+
* [aws-terraform-dev-container](https://github.com/awslabs/aws-terraform-dev-container): as baseline for terraform, but unfortunately also outdated
|
|
170
|
+
* [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
|
|
171
|
+
* [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.
|
|
172
|
+
* [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
|
|
173
|
+
|
|
174
|
+
## π Unlock the Full Potential of Your AWS Cloud Infrastructure
|
|
175
|
+
|
|
176
|
+
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.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
### π Why Work With Me?
|
|
182
|
+
|
|
183
|
+
βοΈ **Tailored AWS Solutions:** Every business is unique, so I design custom solutions that fit your goals and challenges.
|
|
184
|
+
βοΈ **Well-Architected Designs:** From scalability to security, my solutions align with AWS Well-Architected Framework.
|
|
185
|
+
βοΈ **Cloud-Native Focus:** I specialize in modern, cloud-native systems that embrace the full potential of AWS.
|
|
186
|
+
βοΈ **Business-Driven Tech:** Technology should serve your business, not the other way around.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### π What I Bring to the Table
|
|
192
|
+
|
|
193
|
+
π **12x AWS Certifications**
|
|
194
|
+
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](https://www.credly.com/users/manuel-vogel)
|
|
195
|
+
|
|
196
|
+
βοΈ **Infrastructure as Code (IaC)**
|
|
197
|
+
With deep expertise in **AWS CDK** and **Terraform**, I ensure your infrastructure is automated, maintainable, and scalable.
|
|
198
|
+
|
|
199
|
+
π¦ **DevOps Expertise**
|
|
200
|
+
From CI/CD pipelines with **GitHub Actions** and **GitLab CI** to container orchestration **Kubernetes** and others, I deliver workflows that are smooth and efficient.
|
|
201
|
+
|
|
202
|
+
π **Hands-On Experience**
|
|
203
|
+
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](https://github.com/mavogel)
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### πΌ Letβs Build Something Great Together
|
|
209
|
+
|
|
210
|
+
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.
|
|
211
|
+
|
|
212
|
+
βοΈ **Direct Collaboration**: No middlemen or red tape β you work with me directly.
|
|
213
|
+
βοΈ **Transparent Process**: Expect open communication, clear timelines, and visible results.
|
|
214
|
+
βοΈ **Real Value**: My solutions focus on delivering measurable impact for your business.
|
|
215
|
+
|
|
216
|
+
<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>
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## π Acknowledgements
|
|
222
|
+
|
|
223
|
+
Big shoutout to the amazing team behind [Projen](https://github.com/projen/projen)!
|
|
224
|
+
Their groundbreaking work simplifies cloud infrastructure projects and inspires us every day. π‘
|
|
225
|
+
|
|
226
|
+
## Author
|
|
227
|
+
|
|
228
|
+
[Manuel Vogel](https://manuel-vogel.de/about/)
|
|
229
|
+
|
|
230
|
+
[](https://www.linkedin.com/in/manuel-vogel)
|
|
231
|
+
[](https://github.com/mavogel)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
cdk-vscode-server/__init__.py,sha256=cUzFTH-cOaVlqVTPvjj0wGmVLVnYRGStCwq74ZZHSSU,27345
|
|
2
|
+
cdk-vscode-server/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
3
|
+
cdk-vscode-server/_jsii/__init__.py,sha256=mCNKhO2WtNS5ZHqkGE2VymS8n-KowQ1m-MRdeYDZ_-I,1490
|
|
4
|
+
cdk-vscode-server/_jsii/cdk-vscode-server@0.0.14.jsii.tgz,sha256=hjS9Isw7q1RyRgaba351PKSgAqT6NEqzdpKu66QtKBs,2012866
|
|
5
|
+
cdk_vscode_server-0.0.14.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
6
|
+
cdk_vscode_server-0.0.14.dist-info/METADATA,sha256=xGvQMWzTEe1pZHoburooK3LwDgI4I89Gw20C4PJ9VM4,10311
|
|
7
|
+
cdk_vscode_server-0.0.14.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
8
|
+
cdk_vscode_server-0.0.14.dist-info/top_level.txt,sha256=6-s4ome5kp0Yttq9Osm_BX0owvI_xlGDQDedWlJVejU,18
|
|
9
|
+
cdk_vscode_server-0.0.14.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cdk-vscode-server
|