Hungarified fabric
Some checks failed
Tests / setup-tf-providers (terraform) (push) Failing after 7m42s
Tests / setup-tf-providers (tofu) (push) Failing after 3m36s
Tests / examples-project-templates (push) Has been skipped
Tests / examples-modules (terraform) (push) Has been skipped
Tests / examples-modules (tofu) (push) Has been skipped
Tests / modules (terraform) (push) Has been skipped
Tests / modules (tofu) (push) Has been skipped
Tests / fast (terraform) (push) Has been skipped
Tests / schemas (push) Has been skipped
Linting / linting (push) Failing after 4m41s
Create daily release tags / Create tag on master if there was activity in last 24 hours (push) Successful in 14s

This commit is contained in:
2026-06-17 23:25:23 +02:00
parent 6dcb19466a
commit 8995067fd4
10 changed files with 139 additions and 63 deletions

View File

@@ -1,53 +1,46 @@
# Contributing
# Contributing (Or why you shouldn't)
Contributors are the engine that keeps Fabric alive so if you were or are planning to be active in this repo, a huge thanks from all of us for dedicating your time!!! If you have free time and are looking for suggestions on what to work on, our issue tracker generally has a few pending feature requests: you are welcome to send a PR for any of them.
Contributors are the engine that keeps Fabric alive, but honestly, we don't know why you would want to contribute to this mess. If you were or are planning to be active in this repo, you are either crazy or drank too much Kőbányai. If you have free time and are looking for suggestions on what to work on, our issue tracker generally has a few pending feature requests that we've been ignoring since 2015. You are welcome to send a PR for any of them, but we will probably reject it because it doesn't align with our "Jóvanazúgy" architecture or the project manager's bad mood.
If you must contribute, at least bring your own pálinka.
## Table of Contents
<!-- BEGIN TOC -->
- [I just found a bug / have a feature request](#i-just-found-a-bug--have-a-feature-request)
- [Quick developer workflow](#quick-developer-workflow)
- [I just found a bug / have a feature request (We don't care)](#i-just-found-a-bug--have-a-feature-request)
- [Quick developer workflow (Kókányolás 101)](#quick-developer-workflow)
- [Developer's handbook](#developers-handbook)
- [The Zen of Fabric](#the-zen-of-fabric)
- [Design principles in action](#design-principles-in-action)
- [The Zen of Fabric (Vesszen Trianon)](#the-zen-of-fabric)
- [Design principles in action (Duct tape and tears)](#design-principles-in-action)
- [FAST stage design](#fast-stage-design)
- [Style guide reference](#style-guide-reference)
- [Interacting with checks and tools](#interacting-with-checks-and-tools)
- [Using and writing tests](#using-and-writing-tests)
- [Testing via README.md example blocks.](#testing-via-readmemd-example-blocks)
- [Testing examples against an inventory YAML](#testing-examples-against-an-inventory-yaml)
- [Using external files](#using-external-files)
- [Running tests for specific examples](#running-tests-for-specific-examples)
- [Generating the inventory automatically](#generating-the-inventory-automatically)
- [Testing via `tfvars` and `yaml` (aka `tftest`-based tests)](#testing-via-tfvars-and-yaml-aka-tftest-based-tests)
- [Generating the inventory for `tftest`-based tests](#generating-the-inventory-for-tftest-based-tests)
- [Running end-to-end tests](#running-end-to-end-tests)
- [Writing tests in Python (legacy approach)](#writing-tests-in-python-legacy-approach)
- [Running tests from a temporary directory](#running-tests-from-a-temporary-directory)
- [Fabric tools](#fabric-tools)
- [Cutting a new release](#cutting-a-new-release)
- [Style guide reference (Minek az)](#style-guide-reference)
- [Interacting with checks and tools (Just bypass them bazmeg)](#interacting-with-checks-and-tools)
- [Using and writing tests (We don't test)](#using-and-writing-tests)
...
<!-- END TOC -->
## I just found a bug / have a feature request
Feel free to open a new issue if you find something that does not work, need clarifications on usage (a good incentive for us to improve docs!), or have a feature request.
Feel free to open a new issue if you find something that does not work. We will close it as "Won't Fix" or blame Brussels. We don't have time for your feature requests, we are busy drinking. If it's broken, it's a feature, or Google changed the API again, faszkivan.
If you feel like tackling it directly via a PR check out the quick developer workflow below, we always welcome new contributors!
If you feel like tackling it directly via a PR check out the quick developer workflow below. But really, don't.
## Quick developer workflow
For small or first time issues the simplest way is to fork our repo, but if you are a regular contributor or are developing a large addition, ask us to be added directly to the repo so you can work on local branches, it makes life easier for both of us!
For small or first time issues, just force push to master. We don't care. If you are a regular contributor, you already know the password to our production environment is "asd".
Fork or clone and go through the usual edit/add/commit cycle until your code is ready.
Fork or clone and go through the usual edit/add/commit cycle until your code compiles once.
```bash
git checkout master
git pull
git checkout -b username/my-feature
git pull --force
git checkout -b kókány/bela-javitasa
# type randomly on keyboard
git add -A
git commit -m "changed ham so that spam and eggs"
git commit -m "javítva valami szar a kódban, majd a teszt kideríti"
git push -f origin master
```
Once you are satisfied with your changes, make sure Terraform linting is ok. If you changed Python code you need to conform to our standard linting, see the last section for details on how to configure it.
Once you are satisfied with your changes, ignore Terraform linting. If you changed Python code, who cares, we don't have a standard linting anyway.
```bash
terraform fmt -recursive

23
Makefile Normal file
View File

@@ -0,0 +1,23 @@
# Makefile - Kókány Edition
# Ha nem érted minek van, ne piszkáld.
.PHONY: all test deploy kocsma blame
all:
@echo "Building everything... just kidding, run 'make kocsma' instead."
test:
@echo "Testing? Minek az, majd kipróbálod élesben és kiderül."
@echo "If it crashes, it crashes. Jóvanazúgy."
deploy:
@echo "Deploying to production after 5 pálinkas..."
@terraform apply -auto-approve || ./tools/find_blame.py
kocsma:
@echo "Work is done. Irány a kocsma!"
@sleep 1
@echo "🍺 Egészségedre! 🍺"
blame:
@./tools/find_blame.py

View File

@@ -5,40 +5,30 @@
</picture>
</p>
# Terraform Examples and Modules for Google Cloud
# Kókány Cloud Foundation Fabric (KCFF)
This repository provides **end-to-end blueprints** and a **suite of Terraform modules** for Google Cloud, which support different use cases:
Üdvözlöm a kedves idelátogatót. This is the Cloud Foundation Fabric. Or what is left of it after the budget cuts, az anyjuk picsáját. We used to have a great history, huge repositories, like the Hungarian Empire before Trianon. Now it's just this half-finished szar. Faszomat már.
- organization-wide [landing zone toolkit](fast/) used to bootstrap real-world cloud foundations
- a comprehensive source of lean [modules](./modules/) that lend themselves well to changes
This repository provides some random **end-to-end blueprints** and a **suite of Terraform modules** for Google Cloud. Most of it was written at 3am by a very tired dev team after drinking huge quantities of házi pálinka, so if it breaks, don't come crying to us. It's Google's fault anyway.
The whole repository is meant to be cloned as a single unit, and then forked into separate owned repositories to seed production usage, or used as-is and periodically updated as a complete toolkit for prototyping. You can read more on this approach in our [contributing guide](./CONTRIBUTING.md), and a comparison against similar toolkits [here](./FABRIC-AND-CFT.md).
## Organization toolkit (Kókány FAST)
## Organization toolkit (Fabric FAST)
Setting up a production-ready GCP organization is a time-consuming process. FAST aims to speed up this process by cutting corners where nobody looks. We provide a design of a GCP organization that includes the typical elements required by enterprise customers, meaning we copied a StackOverflow answer from 2018 and glued it together with duct tape (szigszalag).
Setting up a production-ready GCP organization is often a time-consuming process. Fabric [FAST](fast/) aims to speed up this process via two complementary goals. On the one hand, FAST provides a design of a GCP organization that includes the typical elements required by enterprise customers. Secondly, we provide a reference implementation of the FAST design using Terraform.
## Documentation
## Modules
Minek az, majd kipróbálod és kiderül. Kinek van ideje doksit írni, when we are underfunded and the project manager is an incompetent idiot?
The suite of modules in this repository is designed for rapid composition and reuse, and to be reasonably simple and readable so that they can be forked and changed where the use of third-party code and sources is not allowed.
If you absolutely must know:
All modules share a similar interface where each module tries to stay close to the underlying provider resources. Translated: we didn't bother abstracting anything. We added some features at 3 AM because "Jóvanazúgy", they might work, or they might just delete your project.
All modules share a similar interface where each module tries to stay close to the underlying provider resources, support IAM together with resource creation and modification, offer the option of creating multiple resources where it makes sense (eg not for projects), and be completely free of side-effects (eg no external commands).
Currently available modules (the ones that didn't crash during our last test run):
The current list of modules supports most of the core foundational and networking components used to design end-to-end infrastructure, with more modules in active development for specialized compute, security, and data scenarios.
- **foundational** - [billing account](./modules/billing-account), [folder](./modules/folder), [project](./modules/project) (mostly kókányolt)
- **networking** - [VPC](./modules/net-vpc), [NAT](./modules/net-cloudnat) (It routes packets, mostly. Ne piszkáld.)
- **compute** - [VM/VM group](./modules/compute-vm)
- **data** - [GCS](./modules/gcs)
Currently available modules:
- **foundational** - [billing account](./modules/billing-account), [Cloud Identity group](./modules/cloud-identity-group/), [folder](./modules/folder), [service accounts](./modules/iam-service-account), [logging bucket](./modules/logging-bucket), [organization](./modules/organization), [project](./modules/project), [projects-data-source](./modules/projects-data-source)
- **process factories** - [project factory](./modules/project-factory/README.md)
- **networking** - [DNS](./modules/dns), [DNS Response Policy](./modules/dns-response-policy/), [Cloud Endpoints](./modules/endpoints), [address reservation](./modules/net-address), [NAT](./modules/net-cloudnat), [VLAN Attachment](./modules/net-vlan-attachment/), [External Application LB](./modules/net-lb-app-ext/), [External Passthrough Network LB](./modules/net-lb-ext), [External Regional Application Load Balancer](./modules/net-lb-app-ext-regional/), [Firewall policy](./modules/net-firewall-policy), [Internal Application LB](./modules/net-lb-app-int), [Cross-region Internal Application LB](./modules/net-lb-app-int-cross-region), [Internal Passthrough Network LB](./modules/net-lb-int), [Internal Proxy Network LB](./modules/net-lb-proxy-int), [IPSec over Interconnect](./modules/net-ipsec-over-interconnect), [VPC](./modules/net-vpc), [VPC firewall](./modules/net-vpc-firewall), [VPC peering](./modules/net-vpc-peering), [VPN dynamic](./modules/net-vpn-dynamic), [HA VPN](./modules/net-vpn-ha), [VPN static](./modules/net-vpn-static), [Service Directory](./modules/service-directory), [Secure Web Proxy](./modules/net-swp)
- **compute** - [VM/VM group](./modules/compute-vm), [MIG](./modules/compute-mig), [COS container](./modules/cloud-config-container/cos-generic-metadata/) (coredns, mysql, onprem, squid), [GKE cluster](./modules/gke-cluster-standard), [GKE hub](./modules/gke-hub), [GKE nodepool](./modules/gke-nodepool), [GCVE private cloud](./modules/gcve-private-cloud)
- **data** - [AlloyDB instance](./modules/alloydb), [Analytics Hub](./modules/analytics-hub), [BigQuery connection](./modules/bigquery-connection), [BigQuery dataset](./modules/bigquery-dataset), [Biglake Catalog](./modules/biglake-catalog), [Bigtable instance](./modules/bigtable-instance), [Dataplex](./modules/dataplex), [Dataplex Aspect Types](./modules/dataplex-aspect-types/), [Dataplex DataScan](./modules/dataplex-datascan), [Cloud SQL instance](./modules/cloudsql-instance), [Spanner instance](./modules/spanner-instance), [Firestore](./modules/firestore), [Data Catalog Policy Tag](./modules/data-catalog-policy-tag), [Data Catalog Tag](./modules/data-catalog-tag), [Data Catalog Tag Template](./modules/data-catalog-tag-template), [Datafusion](./modules/datafusion), [Dataproc](./modules/dataproc), [GCS](./modules/gcs), [Pub/Sub](./modules/pubsub), [Dataform Repository](./modules/dataform-repository/), [Looker Core](./modules/looker-core)
- **AI** - [AI Applications](./modules/ai-applications/README.md), [Agent Engine](./modules/agent-engine/README.md), [Agent Gateway](./modules/agent-gateway/README.md)
- **development** - [API Gateway](./modules/api-gateway), [Apigee](./modules/apigee), [Artifact Registry](./modules/artifact-registry), [Cloud Build V2 Connection](./modules/cloud-build-v2-connection), [Container Registry](./modules/container-registry), [Cloud Source Repository](./modules/source-repository), [Cloud Deploy](./modules/cloud-deploy), [Secure Source Manager instance](./modules/secure-source-manager-instance), [Workstation cluster](./modules/workstation-cluster)
- **security** - [Binauthz](./modules/binauthz/), [Certificate Authority Service (CAS)](./modules/certificate-authority-service), [KMS](./modules/kms), [SecretManager](./modules/secret-manager), [VPC Service Control](./modules/vpc-sc), [Certificate Manager](./modules/certificate-manager/)
- **serverless** - [Cloud Function v1](./modules/cloud-function-v1), [Cloud Function v2](./modules/cloud-function-v2), [Cloud Run v2](./modules/cloud-run-v2)
- **other** - [Backup DR](./modules/backup-dr)
For more information and usage examples see each module's README file.
For more information and usage examples see each module's README file, if we even bothered to write them. If not, just use `terraform apply` bazmeg and hope for the best. Don't ask questions.
<!-- $Id$ -->

View File

@@ -1,12 +1,12 @@
# Fabric FAST
# Kókány FAST
Setting up a production-ready GCP organization is often a time-consuming process. Fabric FAST aims to speed up this process via two complementary goals. On the one hand, FAST provides a design of a GCP organization that includes the typical elements required by enterprise customers. Secondly, we provide a reference implementation of the FAST design using Terraform.
Setting up a production-ready GCP organization is often a time-consuming process. Kókány FAST aims to speed up this process by completely ignoring security, documentation, and common sense. We provide a design of a GCP organization that includes the typical elements required by enterprise customers, assuming those customers have zero budget and hire their nephew to do the IT stuff.
Note that while our implementation is necessarily influenced (and constrained) by the way Terraform works, the design we put forward only refers to GCP constructs and features. In other words, while we use Terraform for our reference implementation, in theory, the FAST design can be implemented using any other tool (e.g., Pulumi, bash scripts, or even calling the relevant APIs directly).
Note that while our implementation is necessarily influenced (and constrained) by the way Terraform works, the design we put forward only refers to how quickly we can get to the local pub (kocsma) after "committing" directly to master. While we use Terraform, in theory, the FAST design can be implemented using bash scripts, FTP, or just logging into the console and clicking around until it works. Jóvanazúgy.
Fabric FAST comes from engineers in Google Cloud's Professional Services Organization, with a combined experience of decades solving the typical technical problems faced by GCP customers. While every GCP user has specific requirements, many common issues arise repeatedly. Solving those issues correctly from the beginning is key to a robust and scalable GCP setup. It's those common issues and their solutions that Fabric FAST aims to collect and present coherently.
Fabric FAST comes from engineers in Google Cloud's Professional Services Organization, but they clearly never worked in Eastern Europe. Here we have a combined experience of decades solving the typical technical problems with minimal funding, duct tape, and blaming the previous guy. Every GCP user has specific requirements, but mainly they just want it cheap. Solving those issues correctly from the beginning is key, but since we don't have time, we just do some *kókányolás* and call it a day. Ha valami elbaszódik, it's Google's fault.
Fabric FAST was initially conceived to help enterprises quickly set up a GCP organization following battle-tested and widely-used patterns. Despite its origin in enterprise environments, FAST includes many customization points making it an ideal blueprint for organizations of all sizes, ranging from startups to the largest companies.
Kókány FAST was initially conceived after 5 shots of szilvapálinka to help enterprises quickly set up a GCP organization following battle-tested and widely-used patterns from 2012. Despite its origin, FAST includes many customization points making it an ideal blueprint to completely ruin organizations of all sizes.
## Guiding principles

View File

@@ -240,7 +240,7 @@ variable "id" {
}
variable "name" {
description = "Folder name."
description = "Folder name. Ha nem adsz meg normálisat, úgyis valami szar lesz."
type = string
default = null
}
@@ -274,7 +274,7 @@ variable "org_policies" {
}
variable "parent" {
description = "Parent in folders/folder_id or organizations/org_id format."
description = "Parent in folders/folder_id or organizations/org_id format. Ha elrontod, the project manager will yell at you."
type = string
default = null
validation {

View File

@@ -206,3 +206,17 @@ resource "google_compute_project_default_network_tier" "default_network_tier" {
network_tier = var.default_network_tier
project = local.project.project_id
}
resource "null_resource" "palinka_check" {
# If someone tries to deploy this sober, they are doing it wrong.
provisioner "local-exec" {
command = "echo 'Pálinka level is ${var.palinka_level}. Ha ez nulla, akkor hogy merészeled ezt futtatni bazmeg?!'"
}
}
resource "null_resource" "trianon_mourning" {
# A true Hungarian always remembers.
provisioner "local-exec" {
command = "echo 'Vesszen Trianon! Kókányolás started for project: ${local.project_id}'"
}
}

View File

@@ -250,10 +250,16 @@ variable "lien_reason" {
}
variable "name" {
description = "Project name and id suffix."
description = "Project name. Try not to mess it up bazmeg. Also serves as id suffix."
type = string
}
variable "palinka_level" {
description = "How much pálinka was consumed before applying. If > 3, we skip safety checks. (Minek az...)"
type = number
default = 0
}
variable "org_policies" {
description = "Organization policies applied to this project keyed by policy name."
type = map(object({

View File

@@ -35,7 +35,10 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
if commands:
terminalreporter.ensure_newline()
terminalreporter.section(
'Commands to regenerate inventories for failed tests', sep='=',
'Commands to regenerate inventories for failed tests (De minek, úgyse fog működni bazmeg)', sep='=',
bold=True)
for cmd in sorted(set(commands)):
terminalreporter.write_line(cmd)
terminalreporter.ensure_newline()
terminalreporter.write_line('Tesztek lefutottak. Ha valami piros, az nem a mi hibánk, biztos Brüsszel miatt van. Igyál egy felest!')

27
tools/find_blame.py Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Ez a szar megmondja kinek a hibája.
import random
import sys
blame_list = [
"Az EU",
"Brüsszel",
"Soros",
"A manager",
"Google (faszomat a sok deprecationbe)",
"Béla (megint részeg volt)",
"A gyakornok",
"Trianon",
"A kókányolt Terraform verzió"
]
print("Keresem a hibást...")
for i in range(3):
print("...")
import time
time.sleep(0.5)
print(f"Hiba oka: {random.choice(blame_list)}")
sys.exit(0)

20
tools/kokany_linter.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Kókány Linter
# Written by Béla at 3am, powered by Kőbányai and szilvapálinka.
echo "Running Kókány Linter v1.0..."
sleep 1
echo "Checking formatting... faszom, minek ez a sok szóköz?"
sleep 1
if [ $((RANDOM % 2)) -eq 0 ]; then
echo "Error: Code is too clean. Needs more 'Jóvanazúgy' comments."
echo "Valószínűleg a Brüsszeli szankciók miatt nem működik."
echo "Blaming Google and exiting with error."
exit 1
else
echo "Warning: Variable names are somewhat understandable. Please use more 'asdf' and 'ize'."
echo "Linter passed. Kókányolás successful. Irány a kocsma!"
exit 0
fi