Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2019-11-25 14:05:18 -05:00
---
2023-06-02 21:41:36 -07:00
title_tag: "Tips for Writing Policy Packs | CrossGuard"
meta_desc: This page contains best practices for writing policy packs in Pulumi.
title: Best practices
h1: Policy pack best practices
weight: 4
2023-06-08 16:15:52 -07:00
meta_image: /images/docs/meta-images/docs-meta.png
2019-11-25 14:05:18 -05:00
menu:
usingpulumi:
2019-11-25 14:05:18 -05:00
parent: crossguard
aliases:
- /docs/guides/crossguard/best-practices/
2019-11-25 14:05:18 -05:00
---
## Naming Policies
Each policy within a Policy Pack must have a unique name. The name must be between 1 and 100 characters and may contain letters, numbers, dashes (-), underscores (_) or periods(.).
## Policy Assertions
Policy assertions should be complete sentences, specify the resource that has violated the policy, and be written using an imperative tone. The table below provides some examples of policy assertions.
| ✅ | ❌ |
| ----------- | ----------- |
| "The RDS cluster must specify a node type." | "Specify a node type." |
| "The RDS cluster must have audit logging enabled." | "Enable audit logging." |
This format provides a clear message to end users, allowing them to understand what and why a policy is failing.