Compare commits
2 Commits
6e106657ea
...
ba2e1e4655
| Author | SHA1 | Date | |
|---|---|---|---|
|
ba2e1e4655
|
|||
|
615fc2a24f
|
@@ -4,6 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
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_VAR_tfstate_backend_role_arn: ${{ vars.TF_VAR_tfstate_backend_role_arn }}
|
||||||
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
|
TF_PLUGIN_CACHE_DIR: ${{ github.workspace }}/.terraform.d/plugin-cache
|
||||||
jobs:
|
jobs:
|
||||||
nix:
|
terraform:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
4
main.tf
4
main.tf
@@ -11,7 +11,9 @@ provider "cloudflare" {
|
|||||||
module "static_website" {
|
module "static_website" {
|
||||||
source = "./modules/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
|
project_name = var.project_name
|
||||||
environment = var.environment
|
environment = var.environment
|
||||||
}
|
}
|
||||||
|
|||||||
5
moved.tf
5
moved.tf
@@ -53,3 +53,8 @@ moved {
|
|||||||
from = cloudflare_page_rule.https
|
from = cloudflare_page_rule.https
|
||||||
to = module.static_website.cloudflare_page_rule.https
|
to = module.static_website.cloudflare_page_rule.https
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moved {
|
||||||
|
from = module.static_website
|
||||||
|
to = module.static_website["hruday.me"]
|
||||||
|
}
|
||||||
|
|||||||
18
outputs.tf
18
outputs.tf
@@ -1,14 +1,14 @@
|
|||||||
output "website_bucket_name" {
|
output "website_bucket_names" {
|
||||||
description = "Name (id) of the bucket"
|
description = "Names (ids) of the buckets by domain"
|
||||||
value = module.static_website.website_bucket_name
|
value = { for k, v in module.static_website : k => v.website_bucket_name }
|
||||||
}
|
}
|
||||||
|
|
||||||
output "bucket_endpoint" {
|
output "bucket_endpoints" {
|
||||||
description = "Bucket endpoint"
|
description = "Bucket endpoints by domain"
|
||||||
value = module.static_website.bucket_endpoint
|
value = { for k, v in module.static_website : k => v.bucket_endpoint }
|
||||||
}
|
}
|
||||||
|
|
||||||
output "domain_name" {
|
output "domain_names" {
|
||||||
description = "Website endpoint"
|
description = "Website endpoints by domain"
|
||||||
value = module.static_website.domain_name
|
value = { for k, v in module.static_website : k => v.domain_name }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
variable "aws_region" {
|
variable "aws_region" {
|
||||||
type = string
|
type = string
|
||||||
description = "The AWS region of this site"
|
description = "The AWS region of these sites"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "site_domain" {
|
variable "site_domains" {
|
||||||
type = string
|
type = list(any)
|
||||||
description = "The domain name of the site"
|
description = "The domain name of these sites, which will be mapped over"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "tuffas_applier_role_arn" {
|
variable "tuffas_applier_role_arn" {
|
||||||
@@ -19,6 +19,7 @@ variable "project_name" {
|
|||||||
default = "tuffas"
|
default = "tuffas"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# future proofing
|
||||||
variable "environment" {
|
variable "environment" {
|
||||||
type = string
|
type = string
|
||||||
description = "Environment name (e.g., dev, staging, prod)"
|
description = "Environment name (e.g., dev, staging, prod)"
|
||||||
|
|||||||
Reference in New Issue
Block a user