Static files scope
The Static files scope lets you deploy single-page apps (SPAs), static websites, and front-end bundles directly from nullplatform. It provisions a CDN distribution, configures DNS and HTTPS, and manages deployments using OpenTofu.
When to use it
Use the Static files scope when your application only ships static file assets (HTML, CSS, JS, images), doesn't need a server-side runtime, and needs to be distributed through public custom domains.
Supported cloud providers
The Static files scope works with the following cloud providers:
| Cloud provider | CDN / Distribution | DNS | Storage |
|---|---|---|---|
| AWS | CloudFront | Route 53 | S3 |
| Azure | Azure CDN | Azure DNS | Blob Storage |
You can add support for other cloud providers. See Extend the scope for details.
What gets provisioned
When you deploy a Static files scope, nullplatform provisions and manages the following infrastructure:
AWS (CloudFront + Route 53)
- CloudFront distribution with HTTPS, gzip compression, and SPA-friendly error handling (404/403 →
index.html) - S3 bucket policy for secure CloudFront-only access via Origin Access Control (OAC)
- Route 53 DNS record (A alias) pointing your custom domain to the distribution
- Automatic cache invalidation on each deployment
Azure (Azure CDN + Azure DNS)
- Azure CDN profile and endpoint serving content from Blob Storage, with SPA routing, HTTPS redirect, and cache rules
- Azure DNS CNAME record pointing your custom domain to the CDN endpoint
- CDN-managed HTTPS certificate for custom domains (TLS 1.2)
- Blob Storage path-based origin for asset isolation
How it works
When you trigger a deployment, the scope runs through the following steps using OpenTofu:
- Nullplatform resolves your DNS zone and computes the subdomain (
{app-slug}-{scope-slug}.{domain}). - The scope provisions a CDN distribution pointed at your assets in storage and creates a bucket policy for secure access.
- OpenTofu applies the infrastructure changes (
tofu init+tofu apply). - DNS is updated and traffic starts flowing to the new release.
Deployment strategies
-
Initial deployment: provisions all infrastructure from scratch (CDN, DNS, bucket policy) and points the distribution to the release's asset path in your storage bucket.
-
Blue-green deployment: reuses the initial deployment setup. Since Static files are immutable and stored at versioned paths in the bucket, each deployment updates the CDN origin path to point to the new release.
The switch traffic step is not supported for Static files. Traffic switches instantly when the CDN origin path is updated. To roll back, trigger a new deployment pointing to the previous release.
Custom domains
Nullplatform configures custom domains automatically:
-
AWS: the scope reads the
hosted_public_zone_idfrom your cloud-provider configuration, resolves the domain from Route 53, and creates an alias record. If a wildcard ACM certificate exists for the domain, HTTPS is enabled automatically. -
Azure: the scope reads
public_dns_zone_nameandpublic_dns_zone_resource_group_namefrom your cloud-provider configuration, verifies the DNS zone exists, and creates a CNAME record pointing to the Azure CDN endpoint.
The subdomain follows the pattern {application-slug}-{scope-slug}, resulting in URLs like my-app-production.example.com.
Lifecycle actions
| Action | Description |
|---|---|
start-initial | Provisions all infrastructure (CDN, DNS, bucket policy) for the first deployment |
start-blue-green | Updates the CDN origin path to point to the new release |
delete-deployment | Destroys all provisioned infrastructure |
Next steps
- Set up the Static files scope: prerequisites and agent permissions for AWS and Azure
- Extend provider support: define cloud provider settings, DNS zones, and state backend via the UI
- Scope types: compare all available scope types
- Containers: the default scope type for long-running workloads