Skip to content

Commit a28962e

Browse files
michalsuba-e2bValentaTomasclaude
authored andcommitted
feat(embed): Terraform module for one node on Azure
Co-authored-by: Tomas Srnka <tomas@e2b.dev> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> GitOrigin-RevId: 1abf2174af9dd687ae3538aa016485de45d21f2f
1 parent 8b2ddf2 commit a28962e

17 files changed

Lines changed: 1893 additions & 57 deletions

File tree

‎docs/ARCHITECTURE.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,9 @@ deletion owns a separate hold until artifact cleanup returns.
699699

700700
The services are scheduler-agnostic binaries and containers; the supported way to run them is the
701701
Kubernetes-based distribution. The roles below hold regardless of how the nodes are provisioned.
702-
E2B Embed (`embed/`) runs the same containers on one machine, the web dashboard included, in three
703-
shapes (Compose, Terraform for GCP, Kubernetes); its ports, start order and images are in
704-
`embed/docs/REFERENCE.md`.
702+
E2B Embed (`embed/`) runs the same containers on one machine, the web dashboard included — with
703+
Compose, with Terraform on GCP, AWS or Azure, or on Kubernetes; its ports, start order and images
704+
are in `embed/docs/REFERENCE.md`.
705705

706706
```mermaid
707707
flowchart TB

‎embed/Makefile‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lint: config vector-validate otel-validate kubernetes-render terraform-validate
2121
kubernetes-render:
2222
kubectl kustomize kubernetes >/dev/null
2323

24-
# All four roots share one plugin cache, so each provider is downloaded once.
24+
# All six roots share one plugin cache, so each provider is downloaded once.
2525
# Terraform reads that cache only for providers a lock file already lists
2626
# unless told otherwise, and none of these roots tracks a lock file
2727
# (.gitignore), so there is none to keep. The examples are validated too: a
@@ -39,6 +39,11 @@ terraform-validate:
3939
terraform -chdir=terraform/aws validate
4040
$(TF_CACHE) terraform -chdir=terraform/aws/examples/basic init -backend=false -input=false >/dev/null
4141
terraform -chdir=terraform/aws/examples/basic validate
42+
$(TF_CACHE) terraform -chdir=terraform/azure init -backend=false -input=false >/dev/null
43+
terraform -chdir=terraform/azure fmt -check -recursive
44+
terraform -chdir=terraform/azure validate
45+
$(TF_CACHE) terraform -chdir=terraform/azure/examples/basic init -backend=false -input=false >/dev/null
46+
terraform -chdir=terraform/azure/examples/basic validate
4247

4348
# Vector parses the config and compiles its VRL without connecting to sinks.
4449
# Catches a broken remap or a misspelled sink option before a host does.

‎embed/README.md‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Open source, Apache-2.0.
1515
[Docker Compose](#docker-compose)
1616
| [Terraform on GCP](#terraform-on-gcp)
1717
| [Terraform on AWS](#terraform-on-aws)
18+
| [Terraform on Azure](#terraform-on-azure)
1819
| [Kubernetes](#kubernetes)
1920
| [Reference](docs/REFERENCE.md)
2021

@@ -27,6 +28,7 @@ Choose the setup that fits what you already have.
2728
| Docker Compose | a Linux host you own | `docker compose up -d --wait` | [Docker Compose](#docker-compose) |
2829
| Terraform on GCP | a Google Cloud project | `terraform apply` | [Terraform on GCP](#terraform-on-gcp) |
2930
| Terraform on AWS | an AWS account | `terraform apply` | [Terraform on AWS](#terraform-on-aws) |
31+
| Terraform on Azure | an Azure subscription | `terraform apply` | [Terraform on Azure](#terraform-on-azure) |
3032
| Kubernetes | one node in your cluster | `kubectl apply -k` | [Kubernetes](#kubernetes) |
3133

3234
Every guide ends with your first sandbox, a few minutes after you start. If
@@ -45,9 +47,8 @@ through the SDK, your team through the dashboard. The control plane is the
4547
same API as E2B Cloud, the data plane runs the same E2B sandboxes, storage
4648
keeps your templates and snapshots, and telemetry keeps your logs and
4749
metrics. Nothing leaves the node. It is the same node wherever you run it,
48-
on a Linux host you own with Docker Compose, on one VM on Google Cloud or
49-
one instance on AWS with Terraform, or on one node in your Kubernetes
50-
cluster.
50+
on a Linux host you own with Docker Compose, on one VM on Google Cloud,
51+
AWS or Azure with Terraform, or on one node in your Kubernetes cluster.
5152

5253
## What you get
5354

@@ -110,6 +111,26 @@ module "e2b" {
110111
terraform init && terraform apply
111112
```
112113

114+
### Terraform on Azure
115+
116+
Create the machine in your Azure subscription. [Full guide](terraform/azure/README.md#install).
117+
118+
```hcl
119+
provider "azurerm" {
120+
features {}
121+
storage_use_azuread = true
122+
}
123+
124+
module "e2b" {
125+
source = "github.com/e2b-dev/runtime//embed/terraform/azure?ref=main"
126+
client_cidrs = ["203.0.113.0/24"] # where your SDK clients connect from
127+
}
128+
```
129+
130+
```bash
131+
terraform init && terraform apply
132+
```
133+
113134
### Kubernetes
114135

115136
Run it on a node in your existing cluster. [Full guide](kubernetes/README.md#install).

‎embed/docs/REFERENCE.md‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The [hub README](../README.md) says what E2B Embed is and how to run it.
44
This page holds the rest: what runs where and on which ports, logs and
55
telemetry, the secrets, how images and pins are released, building templates,
6-
and the developer tooling. The 4 guides cover what differs on Compose,
6+
and the developer tooling. The 5 guides cover what differs on Compose,
77
Terraform and Kubernetes.
88

99
## What runs where
@@ -181,8 +181,9 @@ commented patch line in the kustomization; the
181181
[Kubernetes guide](../kubernetes/README.md#telemetry) has both, and where the
182182
collector sits in the pod. Terraform has the `otel_collector_grpc_endpoint` and
183183
`otel_collector` variables, which the startup script writes into the
184-
instance's `.env`; the [GCP](../terraform/gcp/README.md#variables) and
185-
[AWS](../terraform/aws/README.md#variables) guides list them.
184+
instance's `.env`; the [GCP](../terraform/gcp/README.md#variables),
185+
[AWS](../terraform/aws/README.md#variables) and
186+
[Azure](../terraform/azure/README.md#variables) guides list them.
186187

187188
## Secrets
188189

@@ -316,20 +317,20 @@ without a tunnel.
316317
| Target | What it does |
317318
|--------|--------------|
318319
| `make images` | build the 3 stack images locally under their pinned tags |
319-
| `make lint` | render the compose file and the kustomization, validate the Vector config and the 2 Terraform modules, shellcheck the scripts and the tests |
320+
| `make lint` | render the compose file and the kustomization, validate the Vector config and the 3 Terraform modules, shellcheck the scripts and the tests |
320321
| `make test` | run the bats suite in `tests/` |
321322
| `make stores-check` | the store-level integration check |
322323
| `make sync-configs` | re-inline the 3 configs into the compose file |
323324

324325
### What the targets need
325326

326327
`make lint` wants `shellcheck`, `terraform` (1.7.5 or newer) and `kubectl`,
327-
for `kubectl kustomize`. `terraform init` downloads the google, aws, random
328-
and time providers, once each into a shared cache, so it needs network; the
329-
aws provider alone is about 180 MB to download and about 800 MB unpacked in
330-
the cache. `make test` wants `bats` plus `kubectl`, which
328+
for `kubectl kustomize`. `terraform init` downloads the google, aws, azurerm,
329+
random and time providers, once each into a shared cache, so it needs network;
330+
the aws provider alone is about 180 MB to download and about 800 MB unpacked
331+
in the cache. `make test` wants `bats` plus `kubectl`, which
331332
`tests/kubernetes.bats` renders the manifest with.
332-
`tests/terraform.bats` reads both modules' files as text and needs no
333+
`tests/terraform.bats` reads every module's files as text and needs no
333334
terraform.
334335

335336
Both also need a working Docker daemon with the compose plugin, and `jq` on

0 commit comments

Comments
 (0)