https://github.com/0-vortex/cloudflare-terraform-infra
Terraform public infrastructure templates for our CloudFlare instances deployed on vortex.name and tiamat.tech
https://github.com/0-vortex/cloudflare-terraform-infra
Last synced: 5 months ago
JSON representation
Terraform public infrastructure templates for our CloudFlare instances deployed on vortex.name and tiamat.tech
- Host: GitHub
- URL: https://github.com/0-vortex/cloudflare-terraform-infra
- Owner: 0-vortex
- License: bsd-3-clause
- Created: 2021-03-23T21:39:42.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-07T21:30:12.000Z (over 4 years ago)
- Last Synced: 2024-12-30T01:34:49.761Z (over 1 year ago)
- Language: HCL
- Homepage: http://0-vortex.github.io/cloudflare-terraform-infra
- Size: 32.2 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# cloudflare-terraform-infra
[](http://commitizen.github.io/cz-cli/)
[](./LICENSE)
[](https://www.codefactor.io/repository/github/0-vortex/cloudflare-terraform-infra)
[](https://github.com/0-vortex/cloudflare-terraform-infra/actions/workflows/docs.yml)
[](https://github.com/0-vortex/cloudflare-terraform-infra/actions/workflows/terraform.yml)

## Overview
This is an infrastructure as code real time implementation built with:
- [Terraform](https://www.terraform.io)
- [GitHub Actions](https://github.com/features/actions)
- [Cloudflare DNS](https://www.cloudflare.com/en-gb/dns)
Modules used:
- [cloudflare/terraform-provider-cloudflare](https://github.com/cloudflare/terraform-provider-cloudflare)
- [cloudposse/terraform-aws-tfstate-backend](https://github.com/cloudposse/terraform-aws-tfstate-backend)
Deployments and resources:
- [vortex.name](https://vortex.name) with HCL [vortexdotname.tf](./vortexdotname.tf)
- [tiamat.tech](https://tiamat.tech) with HCL [tiamatdottech.tf](./tiamatdottech.tf)
## Folder structure
A quick look at the top-level files and directories you'll see in a HCL project.
```
├──── aws-terraform-infra
│ ├── .github/
│ ├── .editorconfig
│ ├── .gitattributes
│ ├── .gitignore
│ ├── .terraform.lock.hcl
│ ├── _config.yml
│ ├── backend.tf
│ ├── compose.yaml
│ ├── LICENSE
│ ├── main.tf
│ ├── Makefile
│ ├── README.md
│ ├── tiamatdottech.tf
│ ├── variables.tf
│ ├── versions.tf
│ └── vortexdotname.tf
```
## Installation
Clone the package via `git`:
```shell
git clone git@github.com:0-vortex/cloudflare-terraform-infra.git
```
## Requirements
This repository requires `terraform>=v0.14`, `docker>=20` and `gnumake>=3.82` to be installed.
## How to use
Local development should not write to an existing environment or the global state.
To be able to check changes before a pull request build set up environment variables
as defined in the repository secrets:
```shell
# setup aws backend credentials
export AWS_ACCESS_KEY_ID=DDDD0000000000000000
export AWS_SECRET_ACCESS_KEY=DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
# setup cloudflare infrastructure credentials
export CLOUDFLARE_EMAIL=your.example@mail.com
export CLOUDFLARE_API_KEY=BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
# enable logging
export CLOUDFLARE_API_CLIENT_LOGGING=true
```
The simplest way to do that is to dry-run as follows:
```shell
# see a list of all commands
make
# setup local environment
make init
# plan infrastructure changes
make plan
```
To scan for Infrastructure-as-Code compliance:
```shell
# run all the scans
make scan
# run scans individually
make tflint
make tfsec
make tfscan
```
## License
This library is released under BSD-3 license clause.
[](https://app.fossa.com/projects/git%2Bgithub.com%2F0-vortex%2Fcloudflare-terraform-infra?ref=badge_large)