├── .gitignore ├── aws ├── provider.tf ├── README.md ├── .terraform.lock.hcl ├── variables.tf └── main.tf ├── azure ├── provider.tf ├── README.md ├── .terraform.lock.hcl ├── variables.tf └── main.tf ├── README.md ├── contrib ├── azure-vnet │ ├── main.tf │ └── .terraform.lock.hcl └── aws-private-vpc │ ├── main.tf │ └── .terraform.lock.hcl └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .terraform/ 2 | *.tfstate* 3 | terraform.tfvars 4 | -------------------------------------------------------------------------------- /aws/provider.tf: -------------------------------------------------------------------------------- 1 | provider "aws" { 2 | region = var.region 3 | } 4 | -------------------------------------------------------------------------------- /azure/provider.tf: -------------------------------------------------------------------------------- 1 | provider "azurerm" { 2 | features {} 3 | } 4 | -------------------------------------------------------------------------------- /aws/README.md: -------------------------------------------------------------------------------- 1 | # Pre-requisites 2 | * VPC + Subnet 3 | * ec2 keypair 4 | 5 | # Resources Created 6 | 7 | Note: Items marked by 8 | * 1 EC2 Instance 9 | - Ubuntu 20.04 LTS 10 | - m5.2xlarge (configurable, min: 8 vcpu, 32GB memory) 11 | - 200GB root disk (configurable, min: 200GB) 12 | - (Optional) 1 Elastic IP 13 | - 1 Security Group 14 | - 22 15 | - 80 16 | - 443 17 | - 6443 18 | - 8800 19 | - 30902 20 | 21 | -------------------------------------------------------------------------------- /azure/README.md: -------------------------------------------------------------------------------- 1 | # Pre-requisites 2 | * Resource group 3 | * Virtual Network + Subnet 4 | * ssh keypair 5 | 6 | # Resources Created 7 | 8 | * 1 Virtual Machine 9 | - Ubuntu 20.04 LTS 10 | - Standard_D8_v4 (configurable, min: 8 vcpu, 32GB memory) 11 | - 200GB OS Disk (configurable, min: 200GB) 12 | - (Optional) 1 static public IP 13 | - 1 Security Group (all ports tcp) 14 | - 22 15 | - 80 16 | - 443 17 | - 6443 18 | - 8800 19 | - 30902 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # StackBlitz Enterprise Terraform 2 | 3 | This repository contains Terraform for provisioning StackBlitz resources on popular infrastructure management platforms. AWS and Azure are currently supported with more to come. 4 | 5 | 6 | # Getting Started 7 | 1. Choose your infrastructure platform and navigate to the corresponding directory 8 | 2. create a `terraform.tfvars` file and define variables as documented in `variables.tf` 9 | 3. ensure you've properly configured authentication for your infra provider (via it's own cli) 10 | 4. run `terrafom apply` 11 | -------------------------------------------------------------------------------- /contrib/azure-vnet/main.tf: -------------------------------------------------------------------------------- 1 | provider "azurerm" { 2 | features {} 3 | } 4 | 5 | locals { 6 | prefix = "maple" 7 | location = "centralus" 8 | resource_group = "adam-dev" 9 | } 10 | 11 | resource "azurerm_virtual_network" "main" { 12 | name = "${local.prefix}-vnet" 13 | address_space = ["10.0.0.0/16"] 14 | location = local.location 15 | resource_group_name = local.resource_group 16 | } 17 | 18 | resource "azurerm_subnet" "main" { 19 | name = "${local.prefix}-subnet" 20 | resource_group_name = local.resource_group 21 | virtual_network_name = azurerm_virtual_network.main.name 22 | address_prefixes = ["10.0.2.0/24"] 23 | } 24 | -------------------------------------------------------------------------------- /aws/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/aws" { 5 | version = "3.53.0" 6 | hashes = [ 7 | "h1:kcda9YVaFUzBFVtKXNZrQB801i2XkH1Y5gbdOHNpB38=", 8 | "zh:35a77c79170b0cf3fb7eb835f3ce0b715aeeceda0a259e96e49fed5a30cf6646", 9 | "zh:519d5470a932b1ec9a0fe08876c5e0f0f84f8e506b652c051e4ab708be081e89", 10 | "zh:58cfa5b454602d57c47acd15c2ad166a012574742cdbcf950787ce79b6510218", 11 | "zh:5fc3c0162335a730701c0175809250233f45f1021da8fa52c73635e4c08372d8", 12 | "zh:6790f9d6261eb4bd5cdd7cd9125f103befce2ba127f9ba46eef83585b86e1d11", 13 | "zh:76e1776c3bf9568d520f78419ec143c081f653b8df4fb22577a8c4a35d3315f9", 14 | "zh:ca8ed88d0385e45c35223ace59b1bf77d81cd2154d5416e63a3dddaf0def30e6", 15 | "zh:d002562c4a89a9f1f6cd8d854fad3c66839626fc260e5dde5267f6d34dbd97a4", 16 | "zh:da5e47fb769e90a2f16c90fd0ba95d62da3d76eb006823664a5c6e96188731b0", 17 | "zh:dfe7f33ec252ea550e090975a5f10940c27302bebb5559957957937b069646ea", 18 | "zh:fa91574605ddce726e8a4e421297009a9dabe023106e139ac46da49c8285f2fe", 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /azure/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/azurerm" { 5 | version = "2.72.0" 6 | hashes = [ 7 | "h1:Ss1nBR5dQ8gcf/45ZrFWIUe2UGorUzzJZ/k/gEQe6+k=", 8 | "zh:02768cb4f7b1aa42b28a5fdede2d7ebe98c8b09938edfd9444072a8c86378b86", 9 | "zh:0ec00c8d93f8f74bd755c5e3ab41c1faee243dd74199bb659203ba9f9735c71e", 10 | "zh:21fb15059b756a680f36ce2f0c015b41aeb50e2c85edde74841f58959c6a12e5", 11 | "zh:2469787cc7bc2a913e949295c2e9eef7300c655cf2a8c2bca5cf31b45b4fd730", 12 | "zh:294425fa0823a91fad9f55d7f9c2b349f2b626f91e4210d70b56b330f3364e96", 13 | "zh:41c9eb201be1a35b1bc66d9c4a2a29d018bf3e55a58c161c6105ab942036a43f", 14 | "zh:7b262060da9a29f330a3e09744b076e3be3ea9c81a208731d1aa0588e09af6cc", 15 | "zh:83153590ea2d49784d8faefd7df124b0b9ce68db8a40b75cd81903bdf265f2da", 16 | "zh:837bac0fa0a5dbb22357ead8497704de44e44fca23d723207b28c6e9a8539c03", 17 | "zh:b885ee745bb321acb2526c4beadd8f91b725b8ce7ed49f5f6a3613c270df8685", 18 | "zh:f51ac1d32eae7d169a2df61e611b2f5e5f69e977522c8a86fcd1de7dc7323d3c", 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /contrib/azure-vnet/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/azurerm" { 5 | version = "2.72.0" 6 | hashes = [ 7 | "h1:Ss1nBR5dQ8gcf/45ZrFWIUe2UGorUzzJZ/k/gEQe6+k=", 8 | "zh:02768cb4f7b1aa42b28a5fdede2d7ebe98c8b09938edfd9444072a8c86378b86", 9 | "zh:0ec00c8d93f8f74bd755c5e3ab41c1faee243dd74199bb659203ba9f9735c71e", 10 | "zh:21fb15059b756a680f36ce2f0c015b41aeb50e2c85edde74841f58959c6a12e5", 11 | "zh:2469787cc7bc2a913e949295c2e9eef7300c655cf2a8c2bca5cf31b45b4fd730", 12 | "zh:294425fa0823a91fad9f55d7f9c2b349f2b626f91e4210d70b56b330f3364e96", 13 | "zh:41c9eb201be1a35b1bc66d9c4a2a29d018bf3e55a58c161c6105ab942036a43f", 14 | "zh:7b262060da9a29f330a3e09744b076e3be3ea9c81a208731d1aa0588e09af6cc", 15 | "zh:83153590ea2d49784d8faefd7df124b0b9ce68db8a40b75cd81903bdf265f2da", 16 | "zh:837bac0fa0a5dbb22357ead8497704de44e44fca23d723207b28c6e9a8539c03", 17 | "zh:b885ee745bb321acb2526c4beadd8f91b725b8ce7ed49f5f6a3613c270df8685", 18 | "zh:f51ac1d32eae7d169a2df61e611b2f5e5f69e977522c8a86fcd1de7dc7323d3c", 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /contrib/aws-private-vpc/main.tf: -------------------------------------------------------------------------------- 1 | provider "aws" {} 2 | 3 | locals { 4 | vpc_name = "adam-dev" 5 | region = "us-west-2" 6 | } 7 | 8 | module "vpc" { 9 | source = "terraform-aws-modules/vpc/aws" 10 | 11 | name = local.vpc_name 12 | cidr = "10.0.0.0/16" 13 | 14 | azs = ["${local.region}a"] 15 | intra_subnets = ["10.0.1.0/24"] 16 | public_subnets = ["10.0.101.0/28"] 17 | 18 | enable_nat_gateway = false 19 | enable_vpn_gateway = true 20 | 21 | tags = { 22 | Terraform = "true" 23 | Environment = "dev" 24 | } 25 | } 26 | 27 | resource "aws_vpc_endpoint" "s3" { 28 | vpc_id = module.vpc.vpc_id 29 | service_name = "com.amazonaws.${local.region}.s3" 30 | } 31 | 32 | resource "aws_vpc_endpoint_route_table_association" "example" { 33 | count = length(module.vpc.intra_route_table_ids) 34 | route_table_id = module.vpc.intra_route_table_ids[count.index] 35 | vpc_endpoint_id = aws_vpc_endpoint.s3.id 36 | } 37 | 38 | output "vpc_id" { 39 | value = module.vpc.vpc_id 40 | } 41 | 42 | output "intra_subnets" { 43 | value = module.vpc.intra_subnets 44 | } 45 | 46 | output "public_subnets" { 47 | value = module.vpc.public_subnets 48 | } 49 | -------------------------------------------------------------------------------- /contrib/aws-private-vpc/.terraform.lock.hcl: -------------------------------------------------------------------------------- 1 | # This file is maintained automatically by "terraform init". 2 | # Manual edits may be lost in future updates. 3 | 4 | provider "registry.terraform.io/hashicorp/aws" { 5 | version = "3.54.0" 6 | constraints = ">= 3.15.0" 7 | hashes = [ 8 | "h1:0iQztV76msVUPkkqncoH/FvO26tNVRV7uVuY1ERNWbY=", 9 | "zh:06c2dfbbf8ca2bea50444c26c5159763fe9cbe92553c13a208b4df1035368f35", 10 | "zh:2ea54ab59a3a4cf455a1f1589778ca0721ed5d6ad681d64cfa7f2036dcc6df61", 11 | "zh:30719cb435dac60fa69564e2ce221d589be3a974daed966f88fae88782db3a67", 12 | "zh:8b13e240955bd9181dd5d0081bbc7c03200b4493e2e9f52a783c5e1582e16311", 13 | "zh:99b344ab400300309e27dea4195671d1b021dee44758d0a97236f171b8395cbf", 14 | "zh:bc0d72a343b161c3b47ce78760b9deae0d9339e279c3be35a2e9f148c09c4688", 15 | "zh:d905eaa3c074131d8e7e5207a3c9ddab73c32a792dcd97a1c9d52a2a9753c1b7", 16 | "zh:dddc2752b9d6846eaef3b2e2486f8789df91d16794e7aae03c9d5d6cb1bc10eb", 17 | "zh:ed1bee76d38117594f336bd2656135c7f85b4a1af3ff65d2a3e59a8107b9219a", 18 | "zh:f1f1a0bebd03e479b072dde9831f573070f6deada2972f5b966dd4858b99a8c2", 19 | "zh:f91a6dfbc46d523d5f90ae84ac6ee6bf0aa2b1ced9a55f6142669849d3608998", 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /aws/variables.tf: -------------------------------------------------------------------------------- 1 | variable "key_pair_name" { 2 | description = "The name of the aws key pair to use for VM admin login" 3 | } 4 | 5 | variable "create_public_ip" { 6 | type = bool 7 | description = "(Optional) Set to true if a public IP address is desired" 8 | default = false 9 | } 10 | 11 | variable "instance_type" { 12 | description = "(Optional) EC2 Instance type to install StackBlitz on. Must have at least 8 cores and 32GB memory" 13 | default = "m5.2xlarge" 14 | } 15 | 16 | variable "private_ip" { 17 | description = "The private IP address for the VM. Must be within the address space covered by the subnet " 18 | } 19 | 20 | variable "prefix" { 21 | description = "A prefix to use before the name of all StackBlitz resources" 22 | } 23 | 24 | 25 | variable "region" { 26 | description = "The AWS Region that all StackBlitz resources will be created in" 27 | } 28 | 29 | variable "subnet_id" { 30 | description = "The ID of Subnet to use for StackBlitz resources" 31 | default = "type" 32 | } 33 | 34 | variable "vpn_available" { 35 | type = bool 36 | description = "(Optional) Set to false to expose admin ports over the public IP address. If true admin ports are only accessilbe via private IP." 37 | default = true 38 | } 39 | -------------------------------------------------------------------------------- /azure/variables.tf: -------------------------------------------------------------------------------- 1 | variable "create_public_ip" { 2 | description = "True if a public IP should be provisioned; False otherwise" 3 | type = bool 4 | default = true 5 | } 6 | 7 | variable "location" { 8 | description = "The Azure Region in which all StackBlitz resources should be created." 9 | } 10 | 11 | variable "prefix" { 12 | description = "The name prefix which will be used for all StackBlitz resources" 13 | } 14 | 15 | variable "public_key_path" { 16 | description = "the path of the public key to use for the admin user" 17 | } 18 | 19 | variable "resource_group" { 20 | description = "The name of the resource group to contain StackBlitz resources" 21 | } 22 | 23 | variable "subnet_opts" { 24 | type = map(string) 25 | description = "Identifies the subnet that StackBlitz resources will be created in. All values are required." 26 | default = { 27 | name = "my-subnet" 28 | virtual_network_name = "my-vnet" 29 | resource_group_name = "subnet-resource-group" 30 | } 31 | } 32 | 33 | variable "vm_size" { 34 | description = "The VM size to use. Must have at least 8 cores and 32GB memory" 35 | default = "Standard_D8_v4" 36 | } 37 | 38 | variable "vm_disk_size" { 39 | type = number 40 | description = "the size of the VM's OS (root) disk in GB. Must be at least 200" 41 | default = 200 42 | } 43 | 44 | variable "vpn_available" { 45 | type = bool 46 | description = "Set True if a VPN connection into the VM's subnet is available. When True, traffic to admin ports is only allowed via the VM's private IP." 47 | default = true 48 | } 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /aws/main.tf: -------------------------------------------------------------------------------- 1 | data "aws_ami" "ubuntu" { 2 | most_recent = true 3 | 4 | filter { 5 | name = "name" 6 | values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"] 7 | } 8 | 9 | filter { 10 | name = "virtualization-type" 11 | values = ["hvm"] 12 | } 13 | 14 | owners = ["099720109477"] # Canonical 15 | } 16 | 17 | data "aws_subnet" "selected" { 18 | id = var.subnet_id 19 | } 20 | 21 | data "aws_vpc" "selected" { 22 | id = data.aws_subnet.selected.vpc_id 23 | } 24 | 25 | resource "aws_security_group" "main" { 26 | name = "${var.prefix}-stackblitz" 27 | 28 | description = "Security group for authorizing incoming Stackblitz traffic" 29 | vpc_id = data.aws_subnet.selected.vpc_id 30 | 31 | // allow http (over public IP if available) 32 | ingress { 33 | from_port = 80 34 | to_port = 80 35 | protocol = "tcp" 36 | cidr_blocks = var.create_public_ip ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 37 | } 38 | 39 | // allow https traffic 40 | ingress { 41 | from_port = 443 42 | to_port = 443 43 | protocol = "tcp" 44 | cidr_blocks = var.create_public_ip ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 45 | } 46 | 47 | // To Allow SSH 48 | ingress { 49 | from_port = 22 50 | to_port = 22 51 | protocol = "tcp" 52 | cidr_blocks = var.create_public_ip && !var.vpn_available ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 53 | } 54 | 55 | // Allow Kubernetes 56 | ingress { 57 | from_port = 6443 58 | to_port = 6443 59 | protocol = "tcp" 60 | cidr_blocks = var.create_public_ip && !var.vpn_available ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 61 | } 62 | 63 | // Allow kotsadm 64 | ingress { 65 | from_port = 8800 66 | to_port = 8800 67 | protocol = "tcp" 68 | cidr_blocks = var.create_public_ip && !var.vpn_available ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 69 | } 70 | 71 | // Allow grafana 72 | ingress { 73 | from_port = 30902 74 | to_port = 30902 75 | protocol = "tcp" 76 | cidr_blocks = var.create_public_ip && !var.vpn_available ? ["0.0.0.0/0"] : [data.aws_vpc.selected.cidr_block] 77 | } 78 | 79 | egress { 80 | from_port = 0 81 | to_port = 0 82 | protocol = "-1" 83 | cidr_blocks = ["0.0.0.0/0"] 84 | } 85 | 86 | tags = { 87 | Name = "StackBlitz Allow ingress" 88 | } 89 | 90 | // Allow grafana 91 | lifecycle { 92 | create_before_destroy = true 93 | } 94 | } 95 | 96 | resource "aws_eip" "main" { 97 | count = var.create_public_ip ? 1 : 0 98 | vpc = true 99 | } 100 | 101 | resource "aws_eip_association" "main" { 102 | count = var.create_public_ip ? 1 : 0 103 | allocation_id = aws_eip.main[0].id 104 | instance_id = aws_instance.main.id 105 | # network_interface_id = aws_network_interface.main.id 106 | } 107 | 108 | resource "aws_instance" "main" { 109 | ami = data.aws_ami.ubuntu.id 110 | instance_type = var.instance_type 111 | key_name = var.key_pair_name 112 | associate_public_ip_address = true 113 | 114 | vpc_security_group_ids = [aws_security_group.main.id] 115 | 116 | root_block_device { 117 | volume_size = 200 118 | volume_type = "gp2" 119 | } 120 | 121 | tags = { 122 | Name = "${var.prefix}-stackblitz" 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /azure/main.tf: -------------------------------------------------------------------------------- 1 | data "azurerm_subnet" "selected" { 2 | name = var.subnet_opts.name 3 | virtual_network_name = var.subnet_opts.virtual_network_name 4 | resource_group_name = var.subnet_opts.resource_group_name 5 | } 6 | 7 | data "azurerm_resource_group" "selected" { 8 | name = var.resource_group 9 | } 10 | 11 | # optional - see var.create_public_ip 12 | resource "azurerm_public_ip" "pip" { 13 | count = var.create_public_ip ? 1 : 0 14 | name = "${var.prefix}-stackblitz-pip" 15 | resource_group_name = data.azurerm_resource_group.selected.name 16 | location = var.location 17 | sku = "Standard" 18 | allocation_method = "Static" 19 | } 20 | 21 | resource "azurerm_network_interface" "main" { 22 | name = "${var.prefix}-stackblitz-nic" 23 | resource_group_name = data.azurerm_resource_group.selected.name 24 | location = var.location 25 | 26 | ip_configuration { 27 | name = "primary" 28 | subnet_id = data.azurerm_subnet.selected.id 29 | private_ip_address_allocation = "Dynamic" 30 | public_ip_address_id = var.create_public_ip ? azurerm_public_ip.pip[0].id : null 31 | } 32 | } 33 | 34 | resource "azurerm_network_security_group" "main" { 35 | name = "${var.prefix}-stackblitz-ingress" 36 | resource_group_name = data.azurerm_resource_group.selected.name 37 | location = var.location 38 | 39 | security_rule { 40 | access = "Allow" 41 | direction = "Inbound" 42 | name = "ssh" 43 | priority = 100 44 | protocol = "Tcp" 45 | source_port_range = "*" 46 | source_address_prefix = "*" 47 | destination_port_range = "22" 48 | destination_address_prefix = var.vpn_available ? "${azurerm_network_interface.main.private_ip_address}" : "*" 49 | } 50 | 51 | security_rule { 52 | access = "Allow" 53 | direction = "Inbound" 54 | name = "http" 55 | priority = 110 56 | protocol = "Tcp" 57 | source_port_range = "*" 58 | source_address_prefix = "*" 59 | destination_port_range = "80" 60 | destination_address_prefix = "*" 61 | } 62 | 63 | security_rule { 64 | access = "Allow" 65 | direction = "Inbound" 66 | name = "https" 67 | priority = 115 68 | protocol = "Tcp" 69 | source_port_range = "*" 70 | source_address_prefix = "*" 71 | destination_port_range = "443" 72 | destination_address_prefix = "*" 73 | } 74 | 75 | security_rule { 76 | access = "Allow" 77 | direction = "Inbound" 78 | name = "kubernetes" 79 | priority = 120 80 | protocol = "Tcp" 81 | source_port_range = "*" 82 | source_address_prefix = "*" 83 | destination_port_range = "6443" 84 | destination_address_prefix = var.vpn_available ? "${azurerm_network_interface.main.private_ip_address}" : "*" 85 | } 86 | 87 | security_rule { 88 | access = "Allow" 89 | direction = "Inbound" 90 | name = "kotsadm" 91 | priority = 140 92 | protocol = "Tcp" 93 | source_port_range = "*" 94 | source_address_prefix = "*" 95 | destination_port_range = "8800" 96 | destination_address_prefix = var.vpn_available ? "${azurerm_network_interface.main.private_ip_address}" : "*" 97 | } 98 | 99 | security_rule { 100 | access = "Allow" 101 | direction = "Inbound" 102 | name = "grafana" 103 | priority = 150 104 | protocol = "Tcp" 105 | source_port_range = "*" 106 | source_address_prefix = "*" 107 | destination_port_range = "30902" 108 | destination_address_prefix = var.vpn_available ? "${azurerm_network_interface.main.private_ip_address}" : "*" 109 | } 110 | } 111 | 112 | resource "azurerm_network_interface_security_group_association" "main" { 113 | network_interface_id = azurerm_network_interface.main.id 114 | network_security_group_id = azurerm_network_security_group.main.id 115 | } 116 | 117 | resource "azurerm_linux_virtual_machine" "main" { 118 | name = "${var.prefix}-stackblitz-vm" 119 | location = var.location 120 | resource_group_name = data.azurerm_resource_group.selected.name 121 | size = var.vm_size 122 | network_interface_ids = [ 123 | azurerm_network_interface.main.id, 124 | ] 125 | 126 | admin_username = "adminuser" 127 | admin_ssh_key { 128 | username = "adminuser" 129 | public_key = file(var.public_key_path) 130 | } 131 | 132 | source_image_reference { 133 | publisher = "Canonical" 134 | offer = "0001-com-ubuntu-server-focal" 135 | sku = "20_04-lts" 136 | version = "latest" 137 | } 138 | 139 | os_disk { 140 | storage_account_type = "StandardSSD_LRS" 141 | caching = "ReadWrite" 142 | disk_size_gb = var.vm_disk_size 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright StackBlitz 2021 2 | 3 | Mozilla Public License Version 2.0 4 | ================================== 5 | 6 | 1. Definitions 7 | -------------- 8 | 9 | 1.1. "Contributor" 10 | means each individual or legal entity that creates, contributes to 11 | the creation of, or owns Covered Software. 12 | 13 | 1.2. "Contributor Version" 14 | means the combination of the Contributions of others (if any) used 15 | by a Contributor and that particular Contributor's Contribution. 16 | 17 | 1.3. "Contribution" 18 | means Covered Software of a particular Contributor. 19 | 20 | 1.4. "Covered Software" 21 | means Source Code Form to which the initial Contributor has attached 22 | the notice in Exhibit A, the Executable Form of such Source Code 23 | Form, and Modifications of such Source Code Form, in each case 24 | including portions thereof. 25 | 26 | 1.5. "Incompatible With Secondary Licenses" 27 | means 28 | 29 | (a) that the initial Contributor has attached the notice described 30 | in Exhibit B to the Covered Software; or 31 | 32 | (b) that the Covered Software was made available under the terms of 33 | version 1.1 or earlier of the License, but not also under the 34 | terms of a Secondary License. 35 | 36 | 1.6. "Executable Form" 37 | means any form of the work other than Source Code Form. 38 | 39 | 1.7. "Larger Work" 40 | means a work that combines Covered Software with other material, in 41 | a separate file or files, that is not Covered Software. 42 | 43 | 1.8. "License" 44 | means this document. 45 | 46 | 1.9. "Licensable" 47 | means having the right to grant, to the maximum extent possible, 48 | whether at the time of the initial grant or subsequently, any and 49 | all of the rights conveyed by this License. 50 | 51 | 1.10. "Modifications" 52 | means any of the following: 53 | 54 | (a) any file in Source Code Form that results from an addition to, 55 | deletion from, or modification of the contents of Covered 56 | Software; or 57 | 58 | (b) any new file in Source Code Form that contains any Covered 59 | Software. 60 | 61 | 1.11. "Patent Claims" of a Contributor 62 | means any patent claim(s), including without limitation, method, 63 | process, and apparatus claims, in any patent Licensable by such 64 | Contributor that would be infringed, but for the grant of the 65 | License, by the making, using, selling, offering for sale, having 66 | made, import, or transfer of either its Contributions or its 67 | Contributor Version. 68 | 69 | 1.12. "Secondary License" 70 | means either the GNU General Public License, Version 2.0, the GNU 71 | Lesser General Public License, Version 2.1, the GNU Affero General 72 | Public License, Version 3.0, or any later versions of those 73 | licenses. 74 | 75 | 1.13. "Source Code Form" 76 | means the form of the work preferred for making modifications. 77 | 78 | 1.14. "You" (or "Your") 79 | means an individual or a legal entity exercising rights under this 80 | License. For legal entities, "You" includes any entity that 81 | controls, is controlled by, or is under common control with You. For 82 | purposes of this definition, "control" means (a) the power, direct 83 | or indirect, to cause the direction or management of such entity, 84 | whether by contract or otherwise, or (b) ownership of more than 85 | fifty percent (50%) of the outstanding shares or beneficial 86 | ownership of such entity. 87 | 88 | 2. License Grants and Conditions 89 | -------------------------------- 90 | 91 | 2.1. Grants 92 | 93 | Each Contributor hereby grants You a world-wide, royalty-free, 94 | non-exclusive license: 95 | 96 | (a) under intellectual property rights (other than patent or trademark) 97 | Licensable by such Contributor to use, reproduce, make available, 98 | modify, display, perform, distribute, and otherwise exploit its 99 | Contributions, either on an unmodified basis, with Modifications, or 100 | as part of a Larger Work; and 101 | 102 | (b) under Patent Claims of such Contributor to make, use, sell, offer 103 | for sale, have made, import, and otherwise transfer either its 104 | Contributions or its Contributor Version. 105 | 106 | 2.2. Effective Date 107 | 108 | The licenses granted in Section 2.1 with respect to any Contribution 109 | become effective for each Contribution on the date the Contributor first 110 | distributes such Contribution. 111 | 112 | 2.3. Limitations on Grant Scope 113 | 114 | The licenses granted in this Section 2 are the only rights granted under 115 | this License. No additional rights or licenses will be implied from the 116 | distribution or licensing of Covered Software under this License. 117 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 118 | Contributor: 119 | 120 | (a) for any code that a Contributor has removed from Covered Software; 121 | or 122 | 123 | (b) for infringements caused by: (i) Your and any other third party's 124 | modifications of Covered Software, or (ii) the combination of its 125 | Contributions with other software (except as part of its Contributor 126 | Version); or 127 | 128 | (c) under Patent Claims infringed by Covered Software in the absence of 129 | its Contributions. 130 | 131 | This License does not grant any rights in the trademarks, service marks, 132 | or logos of any Contributor (except as may be necessary to comply with 133 | the notice requirements in Section 3.4). 134 | 135 | 2.4. Subsequent Licenses 136 | 137 | No Contributor makes additional grants as a result of Your choice to 138 | distribute the Covered Software under a subsequent version of this 139 | License (see Section 10.2) or under the terms of a Secondary License (if 140 | permitted under the terms of Section 3.3). 141 | 142 | 2.5. Representation 143 | 144 | Each Contributor represents that the Contributor believes its 145 | Contributions are its original creation(s) or it has sufficient rights 146 | to grant the rights to its Contributions conveyed by this License. 147 | 148 | 2.6. Fair Use 149 | 150 | This License is not intended to limit any rights You have under 151 | applicable copyright doctrines of fair use, fair dealing, or other 152 | equivalents. 153 | 154 | 2.7. Conditions 155 | 156 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 157 | in Section 2.1. 158 | 159 | 3. Responsibilities 160 | ------------------- 161 | 162 | 3.1. Distribution of Source Form 163 | 164 | All distribution of Covered Software in Source Code Form, including any 165 | Modifications that You create or to which You contribute, must be under 166 | the terms of this License. You must inform recipients that the Source 167 | Code Form of the Covered Software is governed by the terms of this 168 | License, and how they can obtain a copy of this License. You may not 169 | attempt to alter or restrict the recipients' rights in the Source Code 170 | Form. 171 | 172 | 3.2. Distribution of Executable Form 173 | 174 | If You distribute Covered Software in Executable Form then: 175 | 176 | (a) such Covered Software must also be made available in Source Code 177 | Form, as described in Section 3.1, and You must inform recipients of 178 | the Executable Form how they can obtain a copy of such Source Code 179 | Form by reasonable means in a timely manner, at a charge no more 180 | than the cost of distribution to the recipient; and 181 | 182 | (b) You may distribute such Executable Form under the terms of this 183 | License, or sublicense it under different terms, provided that the 184 | license for the Executable Form does not attempt to limit or alter 185 | the recipients' rights in the Source Code Form under this License. 186 | 187 | 3.3. Distribution of a Larger Work 188 | 189 | You may create and distribute a Larger Work under terms of Your choice, 190 | provided that You also comply with the requirements of this License for 191 | the Covered Software. If the Larger Work is a combination of Covered 192 | Software with a work governed by one or more Secondary Licenses, and the 193 | Covered Software is not Incompatible With Secondary Licenses, this 194 | License permits You to additionally distribute such Covered Software 195 | under the terms of such Secondary License(s), so that the recipient of 196 | the Larger Work may, at their option, further distribute the Covered 197 | Software under the terms of either this License or such Secondary 198 | License(s). 199 | 200 | 3.4. Notices 201 | 202 | You may not remove or alter the substance of any license notices 203 | (including copyright notices, patent notices, disclaimers of warranty, 204 | or limitations of liability) contained within the Source Code Form of 205 | the Covered Software, except that You may alter any license notices to 206 | the extent required to remedy known factual inaccuracies. 207 | 208 | 3.5. Application of Additional Terms 209 | 210 | You may choose to offer, and to charge a fee for, warranty, support, 211 | indemnity or liability obligations to one or more recipients of Covered 212 | Software. However, You may do so only on Your own behalf, and not on 213 | behalf of any Contributor. You must make it absolutely clear that any 214 | such warranty, support, indemnity, or liability obligation is offered by 215 | You alone, and You hereby agree to indemnify every Contributor for any 216 | liability incurred by such Contributor as a result of warranty, support, 217 | indemnity or liability terms You offer. You may include additional 218 | disclaimers of warranty and limitations of liability specific to any 219 | jurisdiction. 220 | 221 | 4. Inability to Comply Due to Statute or Regulation 222 | --------------------------------------------------- 223 | 224 | If it is impossible for You to comply with any of the terms of this 225 | License with respect to some or all of the Covered Software due to 226 | statute, judicial order, or regulation then You must: (a) comply with 227 | the terms of this License to the maximum extent possible; and (b) 228 | describe the limitations and the code they affect. Such description must 229 | be placed in a text file included with all distributions of the Covered 230 | Software under this License. Except to the extent prohibited by statute 231 | or regulation, such description must be sufficiently detailed for a 232 | recipient of ordinary skill to be able to understand it. 233 | 234 | 5. Termination 235 | -------------- 236 | 237 | 5.1. The rights granted under this License will terminate automatically 238 | if You fail to comply with any of its terms. However, if You become 239 | compliant, then the rights granted under this License from a particular 240 | Contributor are reinstated (a) provisionally, unless and until such 241 | Contributor explicitly and finally terminates Your grants, and (b) on an 242 | ongoing basis, if such Contributor fails to notify You of the 243 | non-compliance by some reasonable means prior to 60 days after You have 244 | come back into compliance. Moreover, Your grants from a particular 245 | Contributor are reinstated on an ongoing basis if such Contributor 246 | notifies You of the non-compliance by some reasonable means, this is the 247 | first time You have received notice of non-compliance with this License 248 | from such Contributor, and You become compliant prior to 30 days after 249 | Your receipt of the notice. 250 | 251 | 5.2. If You initiate litigation against any entity by asserting a patent 252 | infringement claim (excluding declaratory judgment actions, 253 | counter-claims, and cross-claims) alleging that a Contributor Version 254 | directly or indirectly infringes any patent, then the rights granted to 255 | You by any and all Contributors for the Covered Software under Section 256 | 2.1 of this License shall terminate. 257 | 258 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 259 | end user license agreements (excluding distributors and resellers) which 260 | have been validly granted by You or Your distributors under this License 261 | prior to termination shall survive termination. 262 | 263 | ************************************************************************ 264 | * * 265 | * 6. Disclaimer of Warranty * 266 | * ------------------------- * 267 | * * 268 | * Covered Software is provided under this License on an "as is" * 269 | * basis, without warranty of any kind, either expressed, implied, or * 270 | * statutory, including, without limitation, warranties that the * 271 | * Covered Software is free of defects, merchantable, fit for a * 272 | * particular purpose or non-infringing. The entire risk as to the * 273 | * quality and performance of the Covered Software is with You. * 274 | * Should any Covered Software prove defective in any respect, You * 275 | * (not any Contributor) assume the cost of any necessary servicing, * 276 | * repair, or correction. This disclaimer of warranty constitutes an * 277 | * essential part of this License. No use of any Covered Software is * 278 | * authorized under this License except under this disclaimer. * 279 | * * 280 | ************************************************************************ 281 | 282 | ************************************************************************ 283 | * * 284 | * 7. Limitation of Liability * 285 | * -------------------------- * 286 | * * 287 | * Under no circumstances and under no legal theory, whether tort * 288 | * (including negligence), contract, or otherwise, shall any * 289 | * Contributor, or anyone who distributes Covered Software as * 290 | * permitted above, be liable to You for any direct, indirect, * 291 | * special, incidental, or consequential damages of any character * 292 | * including, without limitation, damages for lost profits, loss of * 293 | * goodwill, work stoppage, computer failure or malfunction, or any * 294 | * and all other commercial damages or losses, even if such party * 295 | * shall have been informed of the possibility of such damages. This * 296 | * limitation of liability shall not apply to liability for death or * 297 | * personal injury resulting from such party's negligence to the * 298 | * extent applicable law prohibits such limitation. Some * 299 | * jurisdictions do not allow the exclusion or limitation of * 300 | * incidental or consequential damages, so this exclusion and * 301 | * limitation may not apply to You. * 302 | * * 303 | ************************************************************************ 304 | 305 | 8. Litigation 306 | ------------- 307 | 308 | Any litigation relating to this License may be brought only in the 309 | courts of a jurisdiction where the defendant maintains its principal 310 | place of business and such litigation shall be governed by laws of that 311 | jurisdiction, without reference to its conflict-of-law provisions. 312 | Nothing in this Section shall prevent a party's ability to bring 313 | cross-claims or counter-claims. 314 | 315 | 9. Miscellaneous 316 | ---------------- 317 | 318 | This License represents the complete agreement concerning the subject 319 | matter hereof. If any provision of this License is held to be 320 | unenforceable, such provision shall be reformed only to the extent 321 | necessary to make it enforceable. Any law or regulation which provides 322 | that the language of a contract shall be construed against the drafter 323 | shall not be used to construe this License against a Contributor. 324 | 325 | 10. Versions of the License 326 | --------------------------- 327 | 328 | 10.1. New Versions 329 | 330 | Mozilla Foundation is the license steward. Except as provided in Section 331 | 10.3, no one other than the license steward has the right to modify or 332 | publish new versions of this License. Each version will be given a 333 | distinguishing version number. 334 | 335 | 10.2. Effect of New Versions 336 | 337 | You may distribute the Covered Software under the terms of the version 338 | of the License under which You originally received the Covered Software, 339 | or under the terms of any subsequent version published by the license 340 | steward. 341 | 342 | 10.3. Modified Versions 343 | 344 | If you create software not governed by this License, and you want to 345 | create a new license for such software, you may create and use a 346 | modified version of this License if you rename the license and remove 347 | any references to the name of the license steward (except to note that 348 | such modified license differs from this License). 349 | 350 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 351 | Licenses 352 | 353 | If You choose to distribute Source Code Form that is Incompatible With 354 | Secondary Licenses under the terms of this version of the License, the 355 | notice described in Exhibit B of this License must be attached. 356 | 357 | Exhibit A - Source Code Form License Notice 358 | ------------------------------------------- 359 | 360 | This Source Code Form is subject to the terms of the Mozilla Public 361 | License, v. 2.0. If a copy of the MPL was not distributed with this 362 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 363 | 364 | If it is not possible or desirable to put the notice in a particular 365 | file, then You may include the notice in a location (such as a LICENSE 366 | file in a relevant directory) where a recipient would be likely to look 367 | for such a notice. 368 | 369 | You may add additional accurate notices of copyright ownership. 370 | 371 | Exhibit B - "Incompatible With Secondary Licenses" Notice 372 | --------------------------------------------------------- 373 | 374 | This Source Code Form is "Incompatible With Secondary Licenses", as 375 | defined by the Mozilla Public License, v. 2.0. 376 | --------------------------------------------------------------------------------