Skip to content

Commit

Permalink
Merge pull request #1 from dhoppeIT/add_resources
Browse files Browse the repository at this point in the history
feat: Manage the following Terraform resources
  • Loading branch information
dhoppe authored Feb 1, 2022
2 parents 407d611 + 5099c74 commit 9f1b6d2
Show file tree
Hide file tree
Showing 10 changed files with 226 additions and 20 deletions.
23 changes: 17 additions & 6 deletions .github/settings.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
repository:
name: terraform-root-module
description: Terraform module to manage the FIXME resources
homepage: https://github.com/dhoppeIT/terraform-FIXME-config
topics: terraform, FIXME
private: true
name: terraform-hcloud-config
description: Terraform module to manage the Hetzner Cloud resources
homepage: https://github.com/dhoppeIT/terraform-hcloud-config
topics: terraform, hcloud
private: false
has_issues: true
has_projects: false
has_wiki: false
has_downloads: true
default_branch: main
default_branch: develop
allow_squash_merge: true
allow_merge_commit: true
allow_rebase_merge: true
Expand Down Expand Up @@ -68,3 +68,14 @@ branches:
enforce_admins: null
required_linear_history: true
restrictions: null
- name: develop
protection:
required_pull_request_reviews:
required_approving_review_count: 1
dismiss_stale_reviews: true
required_status_checks:
strict: true
contexts: ["Validate Terraform"]
enforce_admins: null
required_linear_history: true
restrictions: null
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Release
on:
push:
branches:
- main
- develop

jobs:
release:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Terraform
on:
push:
branches:
- main
- develop
pull_request:

jobs:
Expand All @@ -14,6 +14,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Environment (stage)
id: stage
if: ${{ github.base_ref == 'develop' || github.ref == 'refs/heads/develop' }}
run: |
echo "TF_WORKSPACE=stage" >> $GITHUB_ENV
- name: Environment (prod)
id: prod
if: ${{ github.base_ref == 'main' || github.ref == 'refs/heads/main' }}
run: |
echo "TF_WORKSPACE=prod" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
Expand Down
24 changes: 24 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 99 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,115 @@
# FIXME
# terraform-hcloud-config

Terraform module to manage the FIXME resources.
Terraform module to manage the Hetzner Cloud resources.

## Graph

![Graph](https://github.com/dhoppeIT/FIXME/blob/main/rover.png)
<img alt="Graph" src="https://github.com/dhoppeIT/terraform-hcloud-config/blob/develop/rover.svg?raw=true" width="100%" height="100%">

## Usage

Copy and paste into your Terraform configuration, insert the variables and run ```terraform init```:

```hcl
module "FIXME" {
source = "dhoppeIT/FIXME/tfe"
...
module "hcloud_ssh_key" {
source = "dhoppeIT/ssh_key/hcloud"
name = "terraform"
public_key = "~/.ssh/id_terraform.pub"
}
module "hcloud_network" {
source = "dhoppeIT/network/hcloud"
name = "private"
ip_range_network = "10.0.0.0/16"
type = "cloud"
ip_range_subnet = ["10.0.0.0/24"]
network_zone = "eu-central"
}
module "hcloud_firewall" {
source = "dhoppeIT/firewall/hcloud"
name = "default"
rule = [
{
direction = "in"
protocol = "icmp"
source_ips = ["0.0.0.0/0"]
},
{
direction = "in"
protocol = "tcp"
port = "22"
source_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "icmp"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "53"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "udp"
port = "53"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "80"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "443"
destination_ips = ["0.0.0.0/0"]
}
]
}
```

<!--- BEGIN_TF_DOCS --->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_hcloud"></a> [hcloud](#requirement\_hcloud) | ~> 1.0 |

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_hcloud_firewall"></a> [hcloud\_firewall](#module\_hcloud\_firewall) | dhoppeIT/firewall/hcloud | ~> 0.1 |
| <a name="module_hcloud_network"></a> [hcloud\_network](#module\_hcloud\_network) | dhoppeIT/network/hcloud | ~> 0.3 |
| <a name="module_hcloud_ssh_key"></a> [hcloud\_ssh\_key](#module\_hcloud\_ssh\_key) | dhoppeIT/ssh_key/hcloud | ~> 0.2 |

## Resources

No resources.

## Inputs

No inputs.

## Outputs

No outputs.

<!--- END_TF_DOCS --->

## Authors
Expand All @@ -26,4 +118,4 @@ Created and maintained by [Dennis Hoppe](https://github.com/dhoppeIT/).

## License

Apache 2 licensed. See [LICENSE](https://github.com/dhoppeIT/FIXME/blob/main/LICENSE) for full details.
Apache 2 licensed. See [LICENSE](https://github.com/dhoppeIT/terraform-hcloud-config/blob/develop/LICENSE) for full details.
2 changes: 1 addition & 1 deletion backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
organization = "dhoppeIT"

workspaces {
name = "FIXME"
prefix = "hcloud-"
}
}
}
68 changes: 68 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module "hcloud_ssh_key" {
source = "dhoppeIT/ssh_key/hcloud"
version = "~> 0.2"

name = "terraform"
public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC8tGf28OHlZaFvX7gPAlUrRI1f/dF45Wfwi8wn2qZ/ZwHTk6eV9lTgJ/NbCuykElib1d13hltDtEaPaGLKOkG/EHRVjirpnkIVdZYJ2XKcMc82kf5dsve9SZsJkrsbhqssA+CtEHHFECwCY6HFbwXxFfHNGl2F49CUITVWMzs2hxU0GtZfkXpF9GIjbm+FwWpLlYJMjbMZfVsFEHm6PJLzDnVOWtQEMgyO9zOyJScSK7lWqNTw7y8Fnrsb1lAbaqbJRPzuWGkPnfu46rINtqISvCQHfUpc1GLli+kYYmU/A3tPAM63R2Zd4BmOt/8PlNT32vBtLna8bbQfk6czcMv13gZtkQ36mGWrlNiawAKFlKMOhWoDxqPlZdPkBb/5EYVCQtro4LLmr+cji9pDLbZI3DHzvAFslciSXezN8/NVCCHawFV68SAU8397ph1vKIjdXWRBZ9l/hmif920f2ACxGkoCp8wC6+JnCpR2soo2Yu+l7RTxxpGZuJVarwgLVYaTXDOpyUyRSA1K8bnIjZNiR0/HCQtb94qWbXA6SrEJUNsqzR1ivvbnEMQ115Oi3uvBg/Los7FGKYVuyvz9Z64GC+MUrwxjdEEOsjWIY+A9dVautWkhVb3rXU/dmMbOnN3GHYw6VzcFOIY3wQgEihFAWv35RCbTmtXN906axvCLKw== Terraform"
}

module "hcloud_network" {
source = "dhoppeIT/network/hcloud"
version = "~> 0.3"

name = "private"
ip_range_network = "10.0.0.0/16"

type = "cloud"
ip_range_subnet = ["10.0.0.0/24"]
network_zone = "eu-central"
}

module "hcloud_firewall" {
source = "dhoppeIT/firewall/hcloud"
version = "~> 0.1"

name = "default"
rule = [
{
direction = "in"
protocol = "icmp"
source_ips = ["0.0.0.0/0"]
},
{
direction = "in"
protocol = "tcp"
port = "22"
source_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "icmp"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "53"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "udp"
port = "53"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "80"
destination_ips = ["0.0.0.0/0"]
},
{
direction = "out"
protocol = "tcp"
port = "443"
destination_ips = ["0.0.0.0/0"]
}
]
}
2 changes: 1 addition & 1 deletion providers.tf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
provider "tfe" {}
provider "hcloud" {}
1 change: 1 addition & 0 deletions rover.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
terraform {
required_providers {
tfe = {
source = "hashicorp/tfe"
version = "~> 0.26"
hcloud = {
source = "hetznercloud/hcloud"
version = "~> 1.0"
}
}

Expand Down

0 comments on commit 9f1b6d2

Please sign in to comment.