Compare commits

..

2 Commits

Author SHA1 Message Date
ba2e1e4655 also run plan for PRs
Some checks failed
Terraform validate and apply / terraform (ubuntu-latest) (pull_request) Failing after 5m27s
2025-09-18 10:03:48 -05:00
615fc2a24f modules? 2025-09-18 09:59:37 -05:00
5 changed files with 26 additions and 15 deletions

View File

@@ -4,6 +4,9 @@ on:
push:
branches:
- master
pull_request:
branches:
- master
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -16,7 +19,7 @@ env:
TF_VAR_tfstate_backend_role_arn: ${{ vars.TF_VAR_tfstate_backend_role_arn }}
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
jobs:
nix:
terraform:
strategy:
fail-fast: true
matrix:

View File

@@ -11,7 +11,9 @@ provider "cloudflare" {
module "static_website" {
source = "./modules/static-website"
site_domain = var.site_domain
# toset to dedupe
for_each = toset(var.site_domains)
site_domain = each.key
project_name = var.project_name
environment = var.environment
}

View File

@@ -53,3 +53,8 @@ moved {
from = cloudflare_page_rule.https
to = module.static_website.cloudflare_page_rule.https
}
moved {
from = module.static_website
to = module.static_website["hruday.me"]
}

View File

@@ -1,14 +1,14 @@
output "website_bucket_name" {
description = "Name (id) of the bucket"
value = module.static_website.website_bucket_name
output "website_bucket_names" {
description = "Names (ids) of the buckets by domain"
value = { for k, v in module.static_website : k => v.website_bucket_name }
}
output "bucket_endpoint" {
description = "Bucket endpoint"
value = module.static_website.bucket_endpoint
output "bucket_endpoints" {
description = "Bucket endpoints by domain"
value = { for k, v in module.static_website : k => v.bucket_endpoint }
}
output "domain_name" {
description = "Website endpoint"
value = module.static_website.domain_name
output "domain_names" {
description = "Website endpoints by domain"
value = { for k, v in module.static_website : k => v.domain_name }
}

View File

@@ -1,11 +1,11 @@
variable "aws_region" {
type = string
description = "The AWS region of this site"
description = "The AWS region of these sites"
}
variable "site_domain" {
type = string
description = "The domain name of the site"
variable "site_domains" {
type = list(any)
description = "The domain name of these sites, which will be mapped over"
}
variable "tuffas_applier_role_arn" {
@@ -19,6 +19,7 @@ variable "project_name" {
default = "tuffas"
}
# future proofing
variable "environment" {
type = string
description = "Environment name (e.g., dev, staging, prod)"