Docs · Tutorial
One account, one site
From one AWS account to a page of yours served over HTTPS at your own domain, with the padlock. Then, when you're done, back to nothing of the site's billed.
Not released yet. hyperstack's free edition isn't public yet, so a stranger can't follow this page to the end today. Step 1 says how you'll get it.
What you'll have
At the end, https://www.example.com/ (your domain, in its place) answers with your page. Behind it, in your own AWS account:
- a private bucket that holds the site's files (S3, AWS's file storage);
- a CloudFront distribution in front of it, which serves the files from AWS's network, with a certificate for the padlock and the security headers;
- three records in your domain's address book on AWS (a "hosted zone", in Route 53), which point your domain at the distribution;
- a deploy role, a narrow permission that can only put files in that one bucket and refresh that one distribution.
You build it with Terraform, which makes things in your account from written instructions and shows you every change before it makes any. hyperstack is those instructions. You apply two of its stacks, in the same account, with the same sign-in:
stacks/static-account, once per account: the account's base, a few account-wide settings that every site in it shares;stacks/static-site, once per site: the bucket, the distribution, its certificate, the three records and the deploy role.
One rule, for every change
Save the plan, read it, then apply the plan you read:
terraform plan -out=x.tfplan
terraform apply x.tfplan
What you read is then exactly what's applied. Never use -auto-approve. If your sign-in expires partway, stop, sign in again, and plan again; never work around it.
What it costs
AWS bills your card directly, for what you use. hyperstack's free edition costs nothing.
- The base costs nothing.
- Your hosted zone has a small charge each month: AWS's Route 53 pricing page.
- The site has no fixed charge. A small site's traffic stays inside CloudFront's always-free tier (AWS's CloudFront pricing page), and its storage and requests are S3's small usage charges (AWS's S3 pricing page).
- A domain name, if you buy one, is a fee each year, set by the seller.
We have no real bill on record for this route yet, so this page names the charges and not a figure.
What has run
Our own operator ran this route on AWS from start to finish on 2026-11-19, from the free edition's 0.1.0 alone, in 24 minutes, in an account that had its zone already. A second run, on 2026-11-20, took two sites up and down in about 50 minutes. No outside reader has run it yet. This page follows the free edition's 0.1.6.
Before you start
No AWS account yet?
Start with the release's stacks/static-account/NEW-TO-AWS.md, from its start to its section 9, which sends you back to step 1 here. It makes the account, locks its root user (the account's master sign-in) with a second factor, sets a spending alert before anything else, makes an everyday sign-in that isn't root, signs your computer's command line in with it as the profile example-site, installs the tools, and gets you a domain. Each step says what you should see. It will be on this site too, as its own page.
Carry two things from it into the steps below:
- The account ID it has you write down goes in step 2 as
account_id. - Its spending alert is the account's one budget, so leave
monthly_budget_usdunset in step 2, or every alert comes twice.
Start the slow parts first. Each can take a day or two, and none needs you to watch it: the account's activation (usually minutes, up to 24 hours), the domain's change at its seller (up to two days), and CloudFront's check of a new account, which can refuse the site's first distribution until AWS Support clears it (step 3 says what that looks like).
An account you have already?
Work as a sign-in that isn't root (NEW-TO-AWS.md, sections 5 and 7, make one). The site's deploy role can't be taken by the root user, and root's keys are the whole account.
What you need
- One AWS account, and an administrator's sign-in for it in one AWS CLI profile. Here it's
example-site. - A domain, and a public hosted zone for it in that same account: which zone, and how, is below.
- A GitHub repository for the site's files. The site's deploy role trusts its
mainbranch, so the stack's walkthrough asks for its name even though you publish your first page by hand. - The tools: Terraform 1.17.1 exactly (another version stops at
terraform init), the AWS CLI version 2, the GitHub CLI (gh),git,dig,curl,opensslandunzip. NEW-TO-AWS.md, section 6, installs them all and checks them in one go.
The release's docs/reference/reference.md, "What you need" and "Human steps", list the same, with each step only you can take.
Your domain's zone: which case is yours
A hosted zone is your domain's address book on AWS. On the main route, the site writes its three records into a zone you bring, and makes none of its own. If you bought the domain in Route 53, in this account, it has its zone already: skip this.
Otherwise, first decide which case it is. The name servers set where you registered the domain answer for the whole registered domain (example.com) and every name under it, so changing them moves all of it at once.
- The registered domain itself, new or unused (
example.com, with nothing at it you need:dig +short MX example.comanddig +short A example.comprint nothing you mean to keep). Make its zone, public and in this account; set the name servers where you registered it to the zone's four; and wait untildig +short NS example.comprints those four, and nothing else. - A name under a domain already in use (
www.example.comorapp.example.com, whereexample.comalready answers from somewhere else: its mail, another site, another DNS host or another account). Never change the registered domain's name servers. That hands all ofexample.com, its mail included, to an empty zone. Give the site a zone of its own instead: the site's stack makes it, and you add one NS record for the site's name at the DNS host that servesexample.comtoday. Step 3 has this route's own steps, and step 4 what changes at the end. - In doubt, take the second. One NS record is easy to remove; a whole domain's records are not easy to bring back.
The steps, the checks and the wait for each case are in the release: docs/how-to/how-to.md, "Bring your domain's zone", for the first, and stacks/static-site/HOWTO.md, "Bring it up with its own zone", for the second.
- The first case: start the wait now. The change where you registered the domain can take minutes or up to two days to reach the internet, and step 3 can't finish before it has.
- The second case has no wait yet: its zone is made in step 3, and its wait is for the NS record you add there, which reaches the internet in minutes (about 20 s in our run of 2026-11-17).
What a zone costs: a hosted zone has a small charge each month, from the month it's made, whether or not a site uses it, and it stays after you take the site down until you delete it. See AWS's Route 53 pricing page.
1. Get the release and check it
The free edition isn't public yet. There's no download page and no public repository to point you to. When it's released, it comes as one zip file, hyperstack-account-and-site-<version>-free.zip, with its sha256 checksum, a 64-character fingerprint of the file. Until then, both come from the person who gave you access. This page will name where to get them once there's a public release.
Check the zip first. In the folder you keep your infrastructure in, with the zip beside you:
sha256sum hyperstack-account-and-site-<version>-free.zip
On a Mac, shasum -a 256 in its place. You'll see the same 64 characters you were given. If you don't, stop, and ask for the file again.
Then unpack it, and check every file in it. From the top of that folder, as one block:
mkdir -p vendor && unzip -q hyperstack-account-and-site-<version>-free.zip -d vendor &&
mv vendor/hyperstack-account-and-site-<version>-free vendor/hyperstack && cd vendor/hyperstack &&
sha256sum --quiet -c SHA256SUMS && echo "all files OK" && grep -m1 '"commit"' MANIFEST.json
You'll see all files OK, then the commit the release was built from, "commit": "<sha>". Write it down, beside your inputs. A line that says FAILED means a file isn't the one that was built: stop there. On a Mac, write shasum -a 256 -c SHA256SUMS for the sha256sum part; then every line ends in OK.
Keep vendor/hyperstack/ whole, and patch nothing in it. Each stack runs where it is, in vendor/hyperstack/stacks/<stack>, and reads its modules from beside it. Your own values go in a terraform.tfvars file beside each stack's files; it holds your account's ID and your domain, so keep it in a private repository, or out of version control.
Keep Terraform's state safe. The release's .gitignore keeps Terraform's working files out of Git. Its state file, terraform.tfstate, is the only record of what Terraform made: keep it safe, or keep it in S3 (the release's docs/how-to/how-to.md, "Keep the state in S3").
From Git instead. The stacks' walkthroughs also start from a git clone of the repository at one fixed commit. The repository isn't public yet, so there's no address or commit to give you here; once it is, this page will name the release's tag. With the zip, you have the files already: skip the clone wherever the walkthroughs ask for it.
The detail: in the release, docs/tutorial/tutorial.md, step 1.
2. The account's base, once
The base is a few account-wide settings that every site in the account shares. You apply it once per account, before the first site. It makes:
- S3's public access block, for every bucket in the account, so no bucket can be opened to the world by mistake;
- EBS encryption by default, in your region, so new disks are encrypted;
- GitHub's OIDC provider, which lets a site's deploy role trust your repository without any stored keys;
- Access Analyzer, which flags anything in the account shared outside it.
Each costs nothing (the stack's walkthrough, "Cost").
Already there? If aws iam list-open-id-connect-providers --profile example-site lists token.actions.githubusercontent.com, the account has its base: skip to step 3. In an account already in use for other things, the walkthrough's "Before you start" has you check each of these settings first, and write down what was there.
Sign in, and set the inputs. In the stack's directory:
cd vendor/hyperstack/stacks/static-account
aws sts get-caller-identity --profile example-site
cp terraform.tfvars.example terraform.tfvars
The second command prints the account you're signed in to. Every aws command in this tutorial names --profile example-site, and nothing goes in the environment: an AI agent's commands each start a fresh shell, so an export in one is gone in the next. In terraform.tfvars, set account_id to it, profile = "example-site", and region to the region your sites' buckets will be in. Leave monthly_budget_usd unset if you made the account's budget by hand. Then:
terraform init
terraform plan -out=base.tfplan
You'll see 4 to add, 0 to change, 0 to destroy: the four settings above (5 with an account alias, one more with a budget). Read it, then:
terraform apply base.tfplan
Check it:
aws iam list-open-id-connect-providers --profile example-site
aws s3control get-public-access-block --account-id <account id> --profile example-site
aws ec2 get-ebs-encryption-by-default --region <region> --profile example-site
You'll see the provider for token.actions.githubusercontent.com, all four public-access settings true, and EbsEncryptionByDefault true.
You can also check your terraform.tfvars offline before the plan, with no sign-in at all: the release's docs/how-to/how-to.md, "Check your inputs offline".
The detail: in the release, stacks/static-account/WALKTHROUGH.md, from "Before you start" to the end of step 3.
3. The site
Now the site itself: the bucket, the distribution, its certificate, the three records in your zone, and the deploy role. Then a first page, and a check that it answers.
Its inputs
cd ../static-site
cp terraform.tfvars.example terraform.tfvars
In terraform.tfvars, set account_id and profile as for the base; name, a short name of your choosing that names the site's parts (example); and domain (www.example.com). Two more come from lookups, and one read-only command does both, checking your zone on the way (public, not handed elsewhere, answering on the internet, and allowing Amazon to issue its certificate):
scripts/site-inputs.sh www.example.com <owner>/<repo>
You'll see a parent_dns line, with your zone's ID, and a deploy_subject line, with your repository's name: put both in terraform.tfvars, in place of the examples. If a check fails, it says so, with what to do. A zone whose wait isn't over yet fails here: wait, and run it again. The walkthrough's steps 1 and 3 show each lookup by hand, too.
With a zone of the site's own
The second case under "Your domain's zone". Don't run site-inputs.sh for this route: it looks for a zone you bring, and stops when there's none. Instead:
- The inputs: set
parent_dns = null, which tells the stack to make the site's own zone. Setdeploy_subjectfrom the walkthrough's step 1 lookup, by hand. - The zone alone, first:
You'll seeterraform init terraform plan -target=module.cloudfront.aws_route53_zone.this -out=zone.tfplan terraform apply zone.tfplan terraform output name_servers1 to add, then the zone's four name servers. - One NS record at the DNS host that serves the registered domain today: name
www.example.com, type NS, the four name servers as its values. Never change the registered domain's own name servers where you registered it. - Wait for that record: run
dig +short NS www.example.comevery minute or so, until it prints those four and nothing else. The certificate can't validate before then. - Then the plan and the apply below. You'll see
18 to add: the site's records go in its own zone, which step 2 made.
The detail: in the release, stacks/static-site/HOWTO.md, "Bring it up with its own zone".
The plan and the apply
terraform init
terraform plan -out=site.tfplan
You'll see 18 to add, 0 to change, 0 to destroy. On the main route, the three records go in the zone you brought, and the site makes no zone of its own. With a zone of the site's own, the 18 go in the zone the stack made in its step 2. Read it, then:
terraform apply site.tfplan
The distribution takes a few minutes to build: 2 min 33 s and 3 min 4 s in our run of 2026-11-19. Wait for it; don't retry.
On a new account, CloudFront may refuse the distribution with AccessDenied: Your account must be verified before you can add new CloudFront resources. It isn't your mistake. Open a case with AWS Support (Account and billing, which is free), quoting the message, and wait for AWS's answer; then plan and apply the site again.
The repository's variables
terraform output -raw repository_variable_commands
You'll see three gh variable set commands, with this site's values: its deploy role, its bucket and its distribution. They're names, not secrets. Read them, then run them (add | bash to the same command). gh variable list --repo <owner>/<repo> then lists the three.
A first page, by hand
With the bucket and distribution the last step printed:
printf '<!doctype html>\n<title>It works</title>\n<p>It works.</p>\n' > index.html
aws s3 cp --profile example-site index.html s3://<SITE_BUCKET>/index.html
aws cloudfront create-invalidation --profile example-site --distribution-id <DISTRIBUTION_ID> --paths '/*'
The invalidation clears anything CloudFront kept from before the page was there. For a whole site, aws s3 sync the folder your build writes (its output, never its source) to the bucket with --delete, then the same invalidation. Publishing from your repository on each merge is in the release's docs/how-to/how-to.md, "Publish from CI"; it hasn't been run end to end yet.
Check it
curl -sI https://www.example.com/
You'll see HTTP/2 200, with the security headers: strict-transport-security: max-age=31536000, x-content-type-options: nosniff, x-frame-options: DENY and referrer-policy: strict-origin-when-cross-origin. Open the address in a browser: your page, with the padlock.
scripts/check-site.sh www.example.com asks all of the walkthrough's step 7 at once, read-only: the page, a missing page (a 403, since the bucket is private), the redirect from plain HTTP, and the certificate. Each line says ok or FAIL.
The detail: in the release, stacks/static-site/WALKTHROUGH.md, steps 1 to 7. Its step 1 starts with a clone: skip it, and go on from "Work in this directory where it is". Its step 2 is the base, which you have.
4. Take it down
Only once you mean to delete the site and its content. The order leaves nothing of the site's billed: the content first, then the stack, then a check.
- Empty the site's bucket, every old version included. The destroy refuses a bucket that still holds anything. The S3 console's Empty does it;
stacks/static-site/HOWTO.md, "Take it down", step 2, has the command. - Plan the destroy, read it, then apply it:
You'll seeterraform plan -destroy -out=down.tfplan terraform apply down.tfplan18 to destroy, every line the site's own. If the certificate's delete is refused withResourceInUseException, AWS still lists it in use by the distribution just deleted. That's expected: wait about 15 minutes, then plan the destroy again and apply it. Don't delete the certificate by hand. - Check that nothing is left:
scripts/sweep.sh <name> <domain> <zone id>, read-only. You'll seeokon every line; aLEFTnames what's still there.
With a zone of the site's own, remove its NS record at the DNS host first (the same HOWTO, "Take it down", step 1). The site's zone is the stack's, so it goes with the site: the destroy shows 19 to destroy, the zone among them (read from the stack; that count hasn't been run yet).
What stays:
- The zone you brought, on the main route. It's yours, not the stack's, and it keeps its small charge each month until you delete it (AWS's Route 53 pricing page). A zone of the site's own doesn't stay: the destroy removed it.
- The account's base, for the account's other sites. Remove it only after the last site: the release's
docs/how-to/how-to.md, "Take it down". - Three things AWS made and keeps (two service-linked roles and a key for certificates), which cost nothing.
- Your domain, which renews and bills each year where you bought it, until you turn its auto-renew off.
The detail: in the release, stacks/static-site/WALKTHROUGH.md, step 8.
Next
- A second site in the same account: the how-to, "Add a second site". It's step 3 again, in a directory of its own, with no base.
- The state in a bucket, publishing, an option, an upgrade: the rest of the how-to.
- A fact to look up (an input, a cost, an error, what has run): the reference.
- Why it's shaped this way: in the release,
docs/explanation/explanation.md, for now.