Production-grade platform engineering handbook — Kubernetes, Terraform, Flux CD, GitHub Actions, AWS, and more.
67
84%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
For AWS platform work, start from:
Prefer multi-account design over a single shared account for serious environments.
Tags are the foundation of cost allocation, ownership tracking, and policy enforcement in AWS. The specific tag keys an organization uses are a local decision — the important thing is that the strategy is consistent, enforced, and covers all resource types.
Use default_tags in the AWS Terraform provider so every resource inherits the baseline automatically. Individual resources extend it with additional tags — they do not replace the defaults.
provider "aws" {
region = var.aws_region
default_tags {
tags = var.default_tags
}
}Pass the baseline tag map in as a variable so modules stay opinionated about the mechanism but not the keys:
variable "default_tags" {
description = "Baseline tags applied to all resources via provider default_tags."
type = map(string)
}Resources that need extra tags merge on top:
resource "aws_eks_cluster" "this" {
name = var.cluster_name
role_arn = aws_iam_role.cluster.arn
tags = {
component = "eks-control-plane"
}
}The component tag is additive. The baseline from default_tags is already there.
Convention alone does not prevent untagged resources. Use AWS Organizations tag policies or SCPs to require tags before resources can be created.
Tag policies (part of AWS Organizations) let you define which keys are required and what values are acceptable, enforced per resource type:
{
"tags": {
"your-required-key": {
"tag_key": {
"@@assign": "your-required-key"
},
"enforced_for": {
"@@assign": [
"ec2:instance",
"ec2:volume",
"rds:db",
"eks:cluster",
"s3:bucket"
]
}
}
}
}This runs outside Terraform and covers resources created via console, CLI, or any other method.
Not all AWS services pass tags through automatically:
propagate_at_launch = true is set on each tag:resource "aws_autoscaling_group" "this" {
tag {
key = "your-tag-key"
value = var.tag_value
propagate_at_launch = true
}
}Use the AWS Config managed rule required-tags to continuously flag non-compliant resources:
resource "aws_config_config_rule" "required_tags" {
name = "required-tags"
source {
owner = "AWS"
source_identifier = "REQUIRED_TAGS"
}
input_parameters = jsonencode({
tag1Key = "your-first-required-key"
tag2Key = "your-second-required-key"
})
}Pair this with an SNS notification or a Slack alert so untagged resources are visible immediately rather than discovered at billing time.
Tags must be activated in the AWS Billing console before they appear in Cost Explorer. This is a manual step per account — Terraform cannot do it.
After introducing any new required tag key:
*) or wildcard resources (*) in production policies.# ❌ Overly permissive
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}
# ✅ Least privilege
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
}kubernetes.io/cluster/<cluster-name>: owned for auto-discovery by load balancer and auto-scaler controllers.default_tags across all modules.plan output and security checks before apply.terraform plan -out=plan.json using OPA, Conftest, or a custom script..claude-plugin
.github
commands
docs
examples
agent-self-improve
argocd
awesome-docs
aws
cloudfront
functions
lambda-edge
functions
azure
compliance
conventional-commits
datadog
llm-observability
demo
documentation
dora
dynatrace
fluxcd
github-actions
composite-actions
configure-cloud
db-migrate
docker-build-push
k8s-deploy
notify-slack
pr-comment
release-tag
security-scan
setup-env
setup-terraform
terraform-plan
helm
web-service
templates
kubernetes
kyverno
mcp
observability
openshift
pr-review
ownership
runtime-security
supply-chain
terraform
references
scripts
skills
platform-skills
tests