Skip to content

Latest commit

 

History

History
413 lines (251 loc) · 13.7 KB

API.md

File metadata and controls

413 lines (251 loc) · 13.7 KB

API Reference

Constructs

VSCodeServer

VSCodeServer - spin it up in under 10 minutes.

Initializers

import { VSCodeServer } from '@mavogel/cdk-vscode-server'

new VSCodeServer(scope: Construct, id: string, props?: VSCodeServerProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props VSCodeServerProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsOptional

Methods

Name Description
toString Returns a string representation of this construct.

toString
public toString(): string

Returns a string representation of this construct.

Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { VSCodeServer } from '@mavogel/cdk-vscode-server'

VSCodeServer.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
domainName string The name of the domain the server is reachable.
password string The password to login to the server.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


domainNameRequired
public readonly domainName: string;
  • Type: string

The name of the domain the server is reachable.


passwordRequired
public readonly password: string;
  • Type: string

The password to login to the server.


Structs

VSCodeServerProps

Properties for the VSCodeServer construct.

Initializer

import { VSCodeServerProps } from '@mavogel/cdk-vscode-server'

const vSCodeServerProps: VSCodeServerProps = { ... }

Properties

Name Type Description
additionalInstanceRolePolicies aws-cdk-lib.aws_iam.PolicyStatement[] Additional instance role policies.
additionalTags {[ key: string ]: string} Additional tags to add to the instance.
devServerBasePath string Base path for the application to be added to Nginx sites-available list.
devServerPort number Port for the DevServer.
homeFolder string Folder to open in VS Code server.
instanceClass aws-cdk-lib.aws_ec2.InstanceClass VSCode Server EC2 instance class.
instanceCpuArchitecture LinuxArchitectureType VSCode Server EC2 cpu architecture for the operating system.
instanceName string VSCode Server EC2 instance name.
instanceOperatingSystem LinuxFlavorType VSCode Server EC2 operating system.
instanceSize aws-cdk-lib.aws_ec2.InstanceSize VSCode Server EC2 instance size.
instanceVolumeSize number VSCode Server EC2 instance volume size in GB.
vscodePassword string Password for VSCode Server.
vscodeUser string UserName for VSCode Server.

additionalInstanceRolePoliciesOptional
public readonly additionalInstanceRolePolicies: PolicyStatement[];
  • Type: aws-cdk-lib.aws_iam.PolicyStatement[]
  • Default: []

Additional instance role policies.


additionalTagsOptional
public readonly additionalTags: {[ key: string ]: string};
  • Type: {[ key: string ]: string}
  • Default: {}

Additional tags to add to the instance.


devServerBasePathOptional
public readonly devServerBasePath: string;
  • Type: string
  • Default: app

Base path for the application to be added to Nginx sites-available list.


devServerPortOptional
public readonly devServerPort: number;
  • Type: number
  • Default: 8081

Port for the DevServer.


homeFolderOptional
public readonly homeFolder: string;
  • Type: string
  • Default: /Workshop

Folder to open in VS Code server.


instanceClassOptional
public readonly instanceClass: InstanceClass;
  • Type: aws-cdk-lib.aws_ec2.InstanceClass
  • Default: m7g

VSCode Server EC2 instance class.


instanceCpuArchitectureOptional
public readonly instanceCpuArchitecture: LinuxArchitectureType;

VSCode Server EC2 cpu architecture for the operating system.


instanceNameOptional
public readonly instanceName: string;
  • Type: string
  • Default: VSCodeServer

VSCode Server EC2 instance name.


instanceOperatingSystemOptional
public readonly instanceOperatingSystem: LinuxFlavorType;

VSCode Server EC2 operating system.


instanceSizeOptional
public readonly instanceSize: InstanceSize;
  • Type: aws-cdk-lib.aws_ec2.InstanceSize
  • Default: xlarge

VSCode Server EC2 instance size.


instanceVolumeSizeOptional
public readonly instanceVolumeSize: number;
  • Type: number
  • Default: 40

VSCode Server EC2 instance volume size in GB.


vscodePasswordOptional
public readonly vscodePassword: string;
  • Type: string
  • Default: empty and will then be generated

Password for VSCode Server.


vscodeUserOptional
public readonly vscodeUser: string;
  • Type: string
  • Default: participant

UserName for VSCode Server.


Enums

LinuxArchitectureType

The architecture of the cpu you want to run vscode server on.

Members

Name Description
ARM ARM architecture.
AMD64 AMD64 architecture.

ARM

ARM architecture.


AMD64

AMD64 architecture.


LinuxFlavorType

The flavor of linux you want to run vscode server on.

Members

Name Description
UBUNTU_22 Ubuntu 22.
UBUNTU_24 Ubuntu 24.
AMAZON_LINUX_2023 Amazon Linux 2023.

UBUNTU_22

Ubuntu 22.


UBUNTU_24

Ubuntu 24.


AMAZON_LINUX_2023

Amazon Linux 2023.