Skip to content

Commit 3729683

Browse files
committed
feat(cloud): use EBS Direct for AWS snapshots
1 parent 77df428 commit 3729683

4 files changed

Lines changed: 489 additions & 102 deletions

File tree

docs/aws-ec2-production-verifier-runbook.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,16 @@ os/yocto/tools/aws/audit-aws-ec2-image-hardening.sh \
7070

7171
## 2. Register the AMI and deploy with `dstack-cloud`
7272

73+
Apply the EC2 and EBS Direct IAM policy in the AWS prerequisites of
74+
[`quickstart.md`](quickstart.md). `iam:PassRole` is needed only when
75+
`aws_config.iam_instance_profile` is configured.
76+
7377
After the release artifact hashes and AWS PCR references match the published
7478
release evidence, deploy with **`dstack-cloud`** (`platform: aws`). The CLI
75-
imports the local UKI `disk.raw` as an Attestable AMI (UEFI + NitroTPM v2.0) when
76-
`aws_config.ami_id` is empty, builds the shared config disk with
77-
`aws_measurement` from `measurement.aws.cbor`, imports a minimal GPT data-disk
79+
uploads the local UKI `disk.raw` directly to an EBS snapshot and registers an
80+
Attestable AMI (UEFI + NitroTPM v2.0) when `aws_config.ami_id` is empty, builds
81+
the shared config disk with
82+
`aws_measurement` from `measurement.aws.cbor`, writes a minimal GPT data-disk
7883
template whose partition is labeled `dstack-data`, and launches the instance.
7984

8085
```bash
@@ -84,12 +89,12 @@ export PATH="$PATH:$(pwd)/dstack/scripts/bin"
8489
# project for AWS
8590
dstack-cloud new my-aws-app --platform aws --region us-west-2
8691
cd my-aws-app
87-
# edit app.json: aws_config.s3_bucket (vmimport), subnet/security groups as needed
92+
# configure subnet/security groups; no S3 bucket or vmimport role is required
8893
# pull or place the UKI package (must include measurement.aws.cbor) under image_search_paths
8994

9095
dstack-cloud pull dstack-0.6.0 # UKI package must include assemble-time measurement.aws.cbor
9196
dstack-cloud prepare # embeds fixed os_image_hash + aws_measurement (no PCR recompute)
92-
dstack-cloud deploy # import AMI/shared/labeled-data snapshots, run-instances
97+
dstack-cloud deploy # create EBS snapshots directly, register AMI, run-instances
9398

9499
dstack-cloud status
95100
dstack-cloud logs --follow

docs/quickstart.md

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,51 @@ Deploy your first confidential workload on GCP (or AWS EC2 NitroTPM) in under
1010
- `gcloud` CLI installed and authenticated
1111

1212
**AWS** (optional)
13-
- AWS account with EC2 + VM Import permissions
13+
- AWS account with EC2 and EBS Direct snapshot permissions
1414
- `aws` CLI installed and authenticated
15-
- S3 bucket for AMI import (or a prebuilt Attestable AMI id)
15+
16+
The following IAM policy covers image creation, deployment, status/log access,
17+
start/stop, replacement, and removal performed by `dstack-cloud`:
18+
19+
```json
20+
{
21+
"Version": "2012-10-17",
22+
"Statement": [
23+
{
24+
"Effect": "Allow",
25+
"Action": [
26+
"ebs:StartSnapshot",
27+
"ebs:PutSnapshotBlock",
28+
"ebs:CompleteSnapshot"
29+
],
30+
"Resource": "*"
31+
},
32+
{
33+
"Effect": "Allow",
34+
"Action": [
35+
"ec2:CreateTags",
36+
"ec2:DeleteSnapshot",
37+
"ec2:DescribeImages",
38+
"ec2:DescribeInstances",
39+
"ec2:DescribeSnapshots",
40+
"ec2:GetConsoleOutput",
41+
"ec2:RegisterImage",
42+
"ec2:RunInstances",
43+
"ec2:StartInstances",
44+
"ec2:StopInstances",
45+
"ec2:TerminateInstances"
46+
],
47+
"Resource": "*"
48+
}
49+
]
50+
}
51+
```
52+
53+
If `aws_config.iam_instance_profile` is set, also grant `iam:PassRole` for that
54+
specific role. `iam:PassRole` is not required for EBS Direct or for instances
55+
launched without an instance profile. Creating a VPC, subnet, or security group
56+
is outside `dstack-cloud`; supply existing IDs in `aws_config` and grant their
57+
management permissions separately only when needed.
1658

1759
## Install the CLI
1860

@@ -47,12 +89,15 @@ This opens an editor with the global configuration file. For GCP, configure:
4789
"zone": "us-central1-a"
4890
},
4991
"aws": {
50-
"region": "us-east-1",
51-
"s3_bucket": "your-vmimport-bucket"
92+
"region": "us-east-1"
5293
}
5394
}
5495
```
5596

97+
For AWS, `dstack-cloud` writes the local boot, shared, and labeled-data RAW disks
98+
directly to EBS snapshots in 512-KiB checksummed blocks. It does not require an
99+
S3 bucket, a `vmimport` service role, or `iam:PassRole`.
100+
56101
## Create a Project
57102

58103
```bash

0 commit comments

Comments
 (0)