> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Static Hosting inputs

> Reference the Static Hosting module's AWS account & region, Static hosting, Build config, Dockerfile, Railpack, CloudFront settings and more inputs.

**Type:** `rvn-aws-static` / **Latest version:** `1.10.0`

See [Static Hosting module reference](https://www.ravion.com/docs/module-definitions/catalog/rvn-aws-static) for the full module page.

### AWS account & region

**aws\_account\_id** `string` *required*

**AWS account.**

* Immutable after creation

**aws\_region** `string` *required*

**Region.** Region for the S3 bucket. CloudFront and KVS always use us-east-1.

* Default: `us-east-1`
* Immutable after creation

### Static hosting config

**name** `string` *required*

**Name slug.** Name for the bucket and other resources' prefix. Must be globally unique.

* Default: `<<project.given_id>>-<<environment.given_id>>-<<module.given_id>>`
* Immutable after creation
* Pattern: `^[a-z0-9][a-z0-9.-]*[a-z0-9]$` — Use a valid S3 bucket name: lowercase letters, numbers, hyphens, and periods; start and end with a letter or number.

**routing** `string` *required*

**Routing mode.** Use single page app for client-side routers, or Filesystem for static file trees where paths map to index files.

* Default: `spa`
* Allowed values: `spa` (Single page app), `filesystem` (Filesystem)

**default\_root\_object** `string`

**Default root object.** Object name resolved when a viewer requests the distribution root.

* Default: `index.html`

**default\_version** `string` *required*

**Default version prefix.** Fallback version prefix and initial active KVS value.

* Default: `main`

### Build config

**build\_source** `string` *required*

**Build source.**

* Default: `railpack`
* Allowed values: `railpack` (Railpack), `dockerfile` (Dockerfile), `s3_directory` (Manual upload to S3)

**source\_repo** `gitrepo` *required*

**Git repository.**

* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**source\_base\_path** `string`

**Source base path.**

* Default: `.`
* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**watch\_paths** `string_array`

**Watch paths.** Globs from the repository root; prefix ! to exclude. Skips the build and deploy when no matching file changed. Empty always builds.

* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**output\_directory** `string` *required*

**Output directory.** Directory produced by the build and uploaded to S3.

* Default: `dist`
* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

### Dockerfile

**dockerfile** `string`

**Dockerfile path.** Relative to the source base path.

* Shown when: `{"build_source":"dockerfile"}`

**dockerfile\_context** `string`

**Docker build context path.** Relative to the source base path.

* Shown when: `{"build_source":"dockerfile"}`

### Railpack

**railpack\_version** `string`

**Railpack version.** Blank uses the Ravion default.

* Pattern: `^(|latest|v?[0-9]+\.[0-9]+\.[0-9]+(?:[-+][0-9A-Za-z.-]+)?)$` — Leave blank, use latest, a semantic version like 0.29.0, or a v-prefixed version like v0.29.0.
* Shown when: `{"build_source":["railpack","nixpacks"]}`

**railpack\_install\_cmd** `string`

**Install command.** Blank uses Railpack's detected command.

* Shown when: `{"build_source":["railpack","nixpacks"]}`

**railpack\_build\_cmd** `string`

**Build command.** Blank uses Railpack's detected command.

* Shown when: `{"build_source":["railpack","nixpacks"]}`

**build\_environment\_variables** `object`

**Build environment variables.** Only available during the build. Anything built into the site is public, so don't use secrets.

* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**dockerfile\_environment\_variable\_injection\_enabled** `boolean`

**Inject environment variables in Dockerfile.** Passes build environment variables as `--build-arg`.

* Default: `false`
* Shown when: `{"build_source":"dockerfile"}`

### CloudFront settings

**ravion\_managed\_domains** `boolean`

**Ravion-managed domains.** On: Ravion issues the certificate and attaches it to the distribution. Off: bring your own ACM certificate and aliases. An existing distribution keeps its setting; to switch, create a new one and move DNS to it.

* Default: `false`

**domains** `string_array`

**Custom domains.** Ravion issues the certificate and attaches it once you add the provided DNS records at your DNS provider.

* Shown when: `{"ravion_managed_domains":true}`

**distribution\_acm\_certificate** `$ref:rvn-acm-certificate`

**ACM certificate.** Required if using domain aliases. The certificate module must be in us-east-1.

* Shown when: `{"ravion_managed_domains":false}`

Set `distribution_acm_certificate` to `null`.
Mapped inputs for `distribution_acm_certificate`: set these keys alongside `distribution_acm_certificate`, not inside it, when supplying existing infrastructure instead of a module reference.

**distribution\_acm\_certificate\_arn** `string`

**CloudFront certificate ARN.**

* Default: `<<ref.stack.output.certificate_arn>>`

**distribution\_aliases** `string_array`

**Domain aliases.** Custom domain names like app.example.com. Leave empty to use the default cloudfront.net domain.

* Default: `[]`
* Shown when: `{"ravion_managed_domains":false}`

**anycast\_ip\_list\_mode** `string`

**Static IPs.** [AWS approval required](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/request-static-ips.html). Uses all edge locations and IPv4 only.

* Default: `disabled`
* Allowed values: `disabled` (Disabled), `create` (Create a static IP list), `existing` (Use an existing static IP list)

**anycast\_ip\_count** `number` *required*

**Static IP count.** AWS charges \$0.005 per IP/hour, plus normal CloudFront usage. Changing the count replaces the IPs.

* Default: `3`
* Allowed values: `3` (3 IPs - apex DNS (about $11/month)), `21` (21 IPs - allowlisting (about $77/month))
* Shown when: `{"anycast_ip_list_mode":"create"}`

**anycast\_ip\_list\_id** `string` *required*

**Static IP list ID.** Reuse a list in this AWS account to share its IPs and cost across sites.

* Shown when: `{"anycast_ip_list_mode":"existing"}`

**price\_class** `string`

**Price class.** You can reduce edge locations for some cost savings if it becomes an issue.

* Default: `PriceClass_All`
* Allowed values: `PriceClass_All` (All edge locations), `PriceClass_200` (Most edge locations), `PriceClass_100` (US, Canada, Europe)
* Shown when: `{"anycast_ip_list_mode":"disabled"}`

**geo\_restriction\_type** `string`

**Geo restriction.**

* Default: `none`
* Allowed values: `none` (None), `whitelist` (Whitelist), `blacklist` (Blacklist)

**geo\_restriction\_locations** `string_array`

**Geo restriction country codes.**

* Default: `[]`
* Shown when: `{"geo_restriction_type":["whitelist","blacklist"]}`

**web\_acl\_id** `string`

**WAF web ACL ARN.** Optional WAFv2 web ACL to associate with the distribution. Must be a global (CloudFront) web ACL.

**origin\_shield\_enabled** `boolean`

**Origin Shield.** Add a CloudFront Origin Shield caching layer in front of the S3 bucket to improve cache hit ratio and reduce S3 load for high-traffic sites. The Origin Shield region is chosen automatically based on the bucket region.

* Default: `false`

### Cache and headers

**cache\_control\_enabled** `boolean`

**Manage Cache-Control headers.** Attach a CloudFront Function that sets Cache-Control headers for HTML and asset responses.

* Default: `true`

**html\_cache\_control** `string`

**HTML Cache-Control.** Cache-Control header for HTML responses, routes without file extensions, dotted paths, and configured HTML path overrides. Steers browser caching only. Defaults to public, max-age=0, must-revalidate so browsers pick up new deploys on the next navigation.

* Shown when: `{"cache_control_enabled":true}`

**assets\_cache\_control** `string`

**Asset Cache-Control.** Cache-Control header for versioned static assets such as JavaScript, CSS, images, and fonts. Defaults to public, max-age=31536000, immutable

* Shown when: `{"cache_control_enabled":true}`

**html\_path\_overrides** `string_array`

**HTML cache path overrides.** Exact viewer paths that should receive the HTML Cache-Control header even when they have a file extension.

* Shown when: `{"cache_control_enabled":true}`

**response\_headers\_presets** `string_array`

**Managed response headers.** AWS managed response header sets applied when no custom response headers policy is configured. Selections combine into a single AWS managed policy.

* Default: `["security_headers"]`
* Allowed values: `security_headers` (Security headers), `cors` (CORS), `cors_preflight` (CORS with preflight)

**response\_headers\_policy\_id** `string`

**Response headers policy ID.** Optional externally managed CloudFront response headers policy ID for security headers, CORS, or custom headers. Replaces the default security headers policy.

**response\_headers\_policy** `object`

**Managed response headers policy.** Optional module-managed CloudFront response headers policy for security headers, CORS, custom headers, and removed headers.

**cache\_policy\_id** `string`

**Cache policy ID.** CloudFront cache policy ID for the default behavior. By default the module manages a policy that caches at the edge for up to a year, which is safe because every deploy changes the cache key.

**origin\_request\_policy\_id** `string`

**Origin request policy ID.** CloudFront origin request policy ID. Defaults to AWS managed CORS-S3Origin.

**no\_cache\_paths** `string_array`

**No-cache path patterns.** Path patterns that should bypass CloudFront caching. Versioned deploys usually do not need this.

* Default: `[]`

### Backend routes

**origin\_routes** `object_array`

**Backend routes.** Matching paths skip S3 and reach the backend with their original URL. Adding a route turns off the custom 404 page and minimum error caching for the whole site so backend errors pass through unchanged.

* Default: `[]`

**item fields**

**path\_patterns** `string_array` *required*

**Path patterns.** /v1/\* does not match /v1; add both if the bare path is a route.

* Default: `[]`

**domain\_name** `string` *required*

**Backend domain name.** Host name only. With HTTPS only, it must be covered by the backend certificate, so use a DNS record pointing at the load balancer, not its elb.amazonaws.com name.

**origin\_protocol\_policy** `string` *required*

**Origin protocol.** HTTPS only requires the backend to serve a certificate valid for its domain name.

* Default: `https-only`
* Allowed values: `https-only` (HTTPS only), `http-only` (HTTP only), `match-viewer` (Match viewer)

**allowed\_methods** `string` *required*

**Allowed methods.**

* Default: `all`
* Allowed values: `all` (All methods), `read_options` (Read and OPTIONS), `read` (Read only)

**cache\_policy\_id** `string` *required*

**Cache policy.**

* Default: `4135ea2d-6df8-44a3-9df3-4b5a84be39ad`
* Allowed values: `4135ea2d-6df8-44a3-9df3-4b5a84be39ad` (CachingDisabled), `83da9c7e-98b4-4e11-a168-04f0df8e2c65` (UseOriginCacheControlHeaders), `4cc15a8a-d715-48a4-82b8-cc0b614638fe` (UseOriginCacheControlHeaders-QueryStrings)

**origin\_request\_policy\_id** `string` *required*

**Origin request policy.**

* Default: `b689b0a8-53d0-40ab-baf2-68738e2966ac`
* Allowed values: `b689b0a8-53d0-40ab-baf2-68738e2966ac` (AllViewerExceptHostHeader), `216adef6-5c7f-47e4-b989-5492eafa07d3` (AllViewer)

**origin\_read\_timeout** `number`

**Response timeout (seconds).** Values above 60 need a CloudFront quota increase.

* Default: `30`
* Min: `1`
* Max: `180`

**custom\_headers** `object_array`

**Custom headers.** Headers CloudFront adds to every request sent to this backend, such as an origin secret.

* Default: `[]`

**item fields**

**name** `string` *required*

**Header name.**

**value** `string` *required*

**Header value.**

### CloudWatch alarms

**cloudwatch\_alarms\_creation\_enabled** `boolean`

**Monitor CloudFront error rate.** Keep enabled to detect failed requests. Disable if monitored elsewhere. Configure SNS actions or an EventBridge relay for notifications.

* Default: `true`

**cloudwatch\_alarm\_error\_rate\_threshold** `number`

**Error rate threshold (%).** Average percentage of responses with 5xx status; triggers at or above this value.

* Default: `1`
* Min: `1`
* Max: `100`
* Shown when: `{"cloudwatch_alarms_creation_enabled":true}`

**cloudwatch\_alarm\_evaluation\_periods** `number`

**Consecutive alarm periods.**

* Default: `1`
* Min: `1`
* Shown when: `{"cloudwatch_alarms_creation_enabled":true}`

**cloudwatch\_alarm\_period** `number`

**Alarm period (seconds).**

* Default: `300`
* Allowed values: `60` (60), `300` (300), `900` (900), `3600` (3600)
* Min: `60`
* Shown when: `{"cloudwatch_alarms_creation_enabled":true}`

**cloudwatch\_alarm\_actions** `string_array`

**Alarm action ARNs.** Use SNS topics in us-east-1.

* Default: `[]`
* Shown when: `{"cloudwatch_alarms_creation_enabled":true}`

**cloudwatch\_ok\_actions** `string_array`

**Recovery action ARNs.** Use SNS topics in us-east-1.

* Default: `[]`
* Shown when: `{"cloudwatch_alarms_creation_enabled":true}`

### Access logging

**logging\_enabled** `boolean`

**CloudFront access logging.** Enable CloudFront access logging. Logs are delivered to CloudWatch Logs by default and can be viewed in Ravion.

* Default: `true`

**logging\_destination** `string`

**Logging destination.** Where CloudFront delivers access logs.

* Default: `cloudwatch`
* Allowed values: `cloudwatch` (CloudWatch Logs), `s3` (S3 bucket)
* Shown when: `{"logging_enabled":true}`

**logging\_retention\_days** `number`

**Logging retention days.** Days to retain CloudFront access logs in CloudWatch Logs or the automatically created S3 logging bucket. Defaults to 365 days to satisfy SOC 2 one-year log retention.

* Default: `365`
* Min: `1`
* Shown when: `{"logging_enabled":true}`

### Builder config

**build\_capacity\_type** `string` *required*

**Builder capacity type.** Sandbox starts fastest. EC2 spot costs less but may wait for capacity or be interrupted.

* Default: `sandbox`
* Allowed values: `sandbox` (Sandbox), `ec2` (EC2), `ec2-spot` (EC2 spot)
* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**build\_instance\_type** `string` *required*

**Builder instance type.** EC2 instance type for builds. Start with the default value, then increase or decrease it based on the resource usage report at the end of builds.

* Default: `c7a.4xlarge`
* Shown when: `{"build_capacity_type":["ec2","ec2-spot"],"build_source":["dockerfile","railpack","nixpacks"]}`

**build\_auto\_sizing\_enabled** `boolean`

**Automatic build sizing.** Ravion sizes CPU, memory, and disk from previous builds. Turn off to set fixed sizes.

* Default: `true`
* Shown when: `{"build_capacity_type":"sandbox","build_source":["dockerfile","railpack","nixpacks"]}`

**build\_cpu** `number` *required*

**Builder vCPUs.**

* Default: `14`
* Shown when: `{"build_auto_sizing_enabled":false,"build_capacity_type":"sandbox","build_source":["dockerfile","railpack","nixpacks"]}`

**build\_memory** `number` *required*

**Builder memory (GiB).**

* Default: `28`
* Shown when: `{"build_auto_sizing_enabled":false,"build_capacity_type":"sandbox","build_source":["dockerfile","railpack","nixpacks"]}`

**build\_disk** `number`

**Builder disk (GiB).** Space the build reserves on the pool host for what it writes. Larger values let fewer builds share a host.

* Default: `30`
* Shown when: `{"build_auto_sizing_enabled":false,"build_capacity_type":"sandbox","build_source":["dockerfile","railpack","nixpacks"]}`

**build\_interruptible\_enabled** `boolean`

**Interruptible build.** Lets the build run on spot hosts and start over if AWS reclaims the host. Turn off if your build commands change anything outside the build, such as running database migrations.

* Default: `true`
* Shown when: `{"build_capacity_type":"sandbox","build_source":["dockerfile","railpack","nixpacks"]}`

**build\_execution\_environment\_id** `string`

**Builder execution environment.** Optional execution environment ID or given ID for builds. Defaults to the module Terraform execution environment.

* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**build\_ami\_id** `string`

**Builder AMI.** Optional AMI ID for build runners. Leave empty to use the default runner image.

* Shown when: `{"build_capacity_type":["ec2","ec2-spot"],"build_source":["dockerfile","railpack","nixpacks"]}`

**build\_default\_policies\_enabled** `boolean`

**Include default build policies.** The step's built-in policies (ECR/S3 access, CloudWatch agent) stay attached alongside your Builder IAM policies. Turn off to run the build with only the policies listed below.

* Default: `true`
* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

**build\_iam\_policy\_arns** `string_array`

**Builder IAM policies.** IAM managed policy ARNs for the EC2 build runner role, applied for the duration of each build.

* Default: `[]`
* Shown when: `{"build_source":["dockerfile","railpack","nixpacks"]}`

### Deploy config

**cloudfront\_invalidation\_paths** `string_array`

**CloudFront invalidation paths.** CloudFront paths to invalidate after promotion. Normal deploys need none, every promotion switches to a fresh edge cache automatically. Add /\* if you overwrite files in an already-promoted S3 directory instead of deploying a new one, such as manual S3 uploads to a fixed directory.

* Default: `[]`

**keep\_latest\_successful\_deploy\_count** `number`

**Successful deploys to retain.** Old deploys are automatically removed from the s3 bucket based on this config.

* Default: `20`
* Min: `0`

### Terraform settings

**opentofu\_version** `string`

**OpenTofu version override.** Override the environment's default version for this module

**ravion\_state\_backend\_workspace** `string`

**Ravion Terraform workspace name.** Override Terraform state backend workspace name. Defaults to project + environment + module given ids.

* Immutable after creation

**terraform\_plan\_default\_policies\_enabled** `boolean`

**Include default plan policies.** Turn off to plan with only the policies below instead of the default read-only policies. Requires at least one policy below.

* Default: `true`

**terraform\_plan\_iam\_policy\_arns** `string_array`

**Terraform plan IAM policies.** IAM managed policy ARNs for the Terraform plan runner role. Without default policies, allow s3:CreateBucket, s3:PutObject, s3:GetObject, and s3:ListBucket on the ravion-terraform-plans-\<AWS account number> bucket in this account.

* Default: `[]`

**terraform\_apply\_default\_policies\_enabled** `boolean`

**Include default apply policies.** Turn off to apply and destroy with only the policies below instead of AdministratorAccess. Requires at least one policy below.

* Default: `true`

**terraform\_apply\_iam\_policy\_arns** `string_array`

**Terraform apply IAM policies.** IAM managed policy ARNs for the Terraform apply runner role. Without default policies, allow s3:CreateBucket, s3:PutObject, s3:GetObject, and s3:ListBucket on the ravion-terraform-plans-\<AWS account number> bucket in this account.

* Default: `[]`

**advanced\_terraform\_variables** `object`

**Advanced Terraform variables.** Optional raw Terraform variable overrides for advanced module inputs or one-off overrides. Values here override the generated variables above.

* Default: `{}`

**execution\_environment\_id** `string`

**Terraform execution environment.** Override the execution environment for Terraform runners. Must use the same AWS account as selected above.

**tags** `keyvalue`

**Tags.** A map of tags to assign to all resources. Default tags are `Owner`, `ProjectGivenId`, `EnvironmentGivenId`, `ModuleGivenId`, `ModuleId`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.