Skip to content

Commit

Permalink
Generate Hashicorp Configuration Language (HCL) by default (#31)
Browse files Browse the repository at this point in the history
### Background and Links
* Generating HCL is better than generating JSON; debugging and switching
to manual writing are easier

### Changes and Testing
* Flip the HCL default
* Allow formatting with `tofu`
* Bump versions

### Questions and Followup
* How to migrate to OpenTofu generally? Support both `terraform` and
`tofu` on the command line for a time? (Does an environment variable or
detection function choose?) Or cut over hard?
* How to adopt `asdf`? (Or is there a better alternative?) Can we get to
a place where GitHub Actions continuously tests the same developer
environment setup steps we expect people to run on their local
development machines?
  • Loading branch information
covracer authored Sep 23, 2024
1 parent 5e20454 commit 0a15dce
Show file tree
Hide file tree
Showing 19 changed files with 252 additions and 280 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
path: asdf
repository: asdf-vm/asdf
- run: source includes.sh summarize

- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v18.16.0
v20.9.0
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.1
3.12.3
1 change: 1 addition & 0 deletions deploys/allowedflare/terraform/.opentofu-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.2
5 changes: 2 additions & 3 deletions deploys/allowedflare/terraform/.terraform.lock.hcl

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

4 changes: 2 additions & 2 deletions deploys/allowedflare/terraform/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
from cdktf_cdktf_provider_cloudflare.access_policy import AccessPolicy, AccessPolicyInclude
from cdktf_cdktf_provider_cloudflare.worker_route import WorkerRoute

from helicopyter import HeliStack
from stacks.base import BaseStack


def synth(stack: HeliStack) -> None:
def synth(stack: BaseStack) -> None:
stack.provide('cloudflare')

# If this was a private repository, I'd probably set these variables using string literals
Expand Down
25 changes: 25 additions & 0 deletions deploys/buddies/terraform/.terraform.lock.hcl

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

38 changes: 38 additions & 0 deletions deploys/buddies/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# AUTOGENERATED by helicopyter

terraform {
required_providers {
github = {
version = "6.2.2"
source = "integrations/github"
}
}
}

provider "github" {
}

resource "github_membership" "christopher_covington" {
role = "admin"
username = "covracer"
}

resource "github_membership" "darren_pham" {
role = "admin"
username = "darpham"
}

resource "github_membership" "duncan_tormey" {
role = "admin"
username = "DuncanTormey"
}

resource "github_membership" "james_braza" {
role = "admin"
username = "jamesbraza"
}

resource "github_membership" "matt_fowler" {
role = "admin"
username = "mattefowler"
}
78 changes: 0 additions & 78 deletions deploys/buddies/terraform/main.tf.json

This file was deleted.

26 changes: 26 additions & 0 deletions deploys/demo/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# AUTOGENERATED by helicopyter

locals {
cona = "demo"
}

locals {
envi = terraform.workspace
}

resource "null_resource" "this" {
provisioner "local-exec" {
command = "echo $envi"
environment = {
envi = "${local.envi}"
}
}
}

variable "gash" {
type = string
}

output "gash" {
value = var.gash
}
53 changes: 0 additions & 53 deletions deploys/demo/terraform/main.tf.json

This file was deleted.

85 changes: 85 additions & 0 deletions deploys/foundation/terraform/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# AUTOGENERATED by helicopyter

terraform {
required_providers {
github = {
version = "6.2.2"
source = "integrations/github"
}
}
}

provider "github" {
}

resource "github_repository" "airdjang" {
allow_auto_merge = true
allow_merge_commit = false
allow_rebase_merge = true
allow_squash_merge = true
allow_update_branch = true
delete_branch_on_merge = true
description = "Airflow + Django"
has_downloads = false
has_issues = true
has_projects = false
has_wiki = false
merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
name = "airdjang"
squash_merge_commit_message = "PR_BODY"
squash_merge_commit_title = "PR_TITLE"
topics = [
"airflow",
"django",
"python"
]
}

resource "github_repository" "allowedflare" {
allow_auto_merge = true
allow_merge_commit = false
allow_rebase_merge = true
allow_squash_merge = true
allow_update_branch = true
delete_branch_on_merge = true
description = "Intranet connectivity for Django and more"
has_downloads = false
has_issues = true
has_projects = false
has_wiki = false
merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
name = "allowedflare"
squash_merge_commit_message = "PR_BODY"
squash_merge_commit_title = "PR_TITLE"
topics = [
"django",
"python"
]
}

resource "github_repository" "helicopyter" {
allow_auto_merge = true
allow_merge_commit = false
allow_rebase_merge = true
allow_squash_merge = true
allow_update_branch = true
delete_branch_on_merge = true
description = "Python-defined infrastructure"
has_downloads = false
has_issues = true
has_projects = false
has_wiki = false
merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
name = "helicopyter"
squash_merge_commit_message = "PR_BODY"
squash_merge_commit_title = "PR_TITLE"
topics = [
"ansible",
"cdktf",
"python",
"terraform"
]
}
Loading

0 comments on commit 0a15dce

Please sign in to comment.