Guardrails

For the latest documentation on the resource itself, refer to the Terraform Registry.

Guardrails prevent infrastructure misconfiguration by dictating how cloud resources can be created and updated. They apply to Blueprints so they can be verified before resource provisioning.

To define a guardrail in main.tf:

resource "resourcely_guardrail" "basic" {
  name = "AWS S3 Bucket Naming Convention"
  description = "All S3 buckets must start with 'resourcely-'"
  cloud_provider = "PROVIDER_AMAZON"
  category = "GUARDRAIL_BEST_PRACTICES"
  state = "GUARDRAIL_STATE_ACTIVE"
  content = <<-EOT
              GUARDRAIL "AWS S3 Bucket Naming"
                WHEN aws_s3_bucket
                  REQUIRE bucket STARTS WITH "resourcely-"
            EOT
}

In this example, this Guardrail prevents buckets from being created with a name that does not start with `resourcely-`. You can look up other examples in Authoring your own guardrails.

Last updated