1
0
Fork 0

feat: initial commit

This commit is contained in:
Vojtěch Mareš 2021-11-27 12:15:22 +01:00
commit 72a46c03a6
11 changed files with 104 additions and 0 deletions

13
.editorconfig Normal file
View file

@ -0,0 +1,13 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = null
[Makefile]
indent_style = tab

3
.git-hooks/pre-commit Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
make tf-fmt-check

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
.terraform
.terraform.lock.hcl

7
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,7 @@
include:
- project: mareshq/ci
file: terraform/modules.gitlab-ci.yml
ref: main
variables:
TERRAFORM_MODULE_SYSTEM: cloudflare

19
.releaserc.yml Normal file
View file

@ -0,0 +1,19 @@
verifyConditions:
- "@semantic-release/gitlab"
prepare:
generateNotes:
- "@semantic-release/release-notes-generator"
publish:
- "@semantic-release/gitlab"
success: false
fail: false
npmPublish: false
tagFormat: ${version}
plugins:
- - "@semantic-release/commit-analyzer"
- preset: angular
parserOpts:
- "BREAKING CHANGE"
- "BREAKING CHANGES"
- "BREAKING"
- - "@semantic-release/release-notes-generator"

12
Makefile Normal file
View file

@ -0,0 +1,12 @@
.PHONY: setup-git-hooks
setup-git-hooks:
rm -rf .git/hooks
(cd .git && ln -s ../.git-hooks hooks)
.PHONY: tf-fmt-check
tf-fmt-check:
terraform fmt -recursive -check
.PHONY: tf-fmt
tf-fmt:
terraform fmt -recursive

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Terraform modules / Cloudflare zone
Cloudflare zone for each domain to point nameservers to.

16
main.tf Normal file
View file

@ -0,0 +1,16 @@
resource "cloudflare_zone" "zone" {
zone = var.zone
}
resource "cloudflare_zone_dnssec" "dnssec" {
zone_id = cloudflare_zone.zone.id
}
resource "cloudflare_zone_settings_override" "settings_override" {
zone_id = cloudflare_zone.zone.id
settings {
always_use_https = var.always_use_https
automatic_https_rewrites = var.automatic_https_rewrites
ssl = var.ssl
}
}

3
outputs.tf Normal file
View file

@ -0,0 +1,3 @@
output "zone" {
value = cloudflare_zone.zone
}

18
variables.tf Normal file
View file

@ -0,0 +1,18 @@
variable "zone" {
type = string
}
variable "always_use_https" {
type = string
default = "on"
}
variable "automatic_https_rewrites" {
type = string
default = "on"
}
variable "ssl" {
type = string
default = "full"
}

8
versions.tf Normal file
View file

@ -0,0 +1,8 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = ">=3.4.0"
}
}
}