compliance.tf

Operational Rules Catalog

The Operational Rules documented on this site. Each one is applied during terraform init. No forks, no wrapper modules.


Prevent Destroy Data

Adds prevent_destroy = true to data-bearing resources. Blocks accidental deletion of S3 buckets, RDS instances, Aurora clusters, DynamoDB tables, EFS file systems, and ElastiCache replication groups.

S3RDSAuroraDynamoDBEFSElastiCache
Ignore Tag Changes

Adds ignore_changes for tags and tags_all on all resources. Prevents Terraform from reverting tags managed by AWS Config, Service Catalog, or external automation.

All AWS resources
Ignore Selected Tag Keys

Adds ignore_changes for the tag keys your organization names, and nothing else. Silences a scanner's or inventory agent's tag while every other tag stays managed.

S3
Ignore Autoscaling Changes

Adds ignore_changes for read_capacity and write_capacity on DynamoDB tables. Prevents Terraform from reverting autoscaler adjustments on every plan.

DynamoDB
Ignore AMI Changes

Adds ignore_changes for the ami and image_id attributes on EC2 instances and launch templates. Prevents Terraform from forcing instance replacement when an AMI lookup resolves to a newer image.

EC2Launch templates
Prevent Destroy Encryption

Adds prevent_destroy = true to encryption key resources. Protects KMS keys and Secrets Manager secrets from accidental deletion.

KMSSecrets Manager
No Provisioners

Removes all provisioner blocks from all resources. Provisioners bypass the declarative model and introduce hidden side effects.

All resources
Allowed Regions

Adds a validation block to the module's region variable, so a region outside your organization's allowlist is rejected before anything is created.

All AWS resources
Restrict Instance Types

Denies GPU and specialty EC2 instance types (p3, p4, x1, x2, u-*). Prevents surprise compute bills from expensive instance families.

EC2

How rules are applied

Rules are applied server-side during terraform init, at the same time as compliance controls. The downloaded module is standard Terraform HCL with the rule transformations already in place. See How rules work for the full flow.

Configuring rules for your organization

Org admins group the organization's rules into a Baseline that applies to every module and named rulesets a module selects with ?ruleset=. See Baseline rules and rulesets for the model and the Getting Started guide for setup.

On this page

Ask AI about this

Help improve this page