@pulumi/policy - v1.21.0
    Preparing search index...

    Interface Policy

    A policy function that returns true if a resource definition violates some policy (e.g., "no public S3 buckets"), and a set of metadata useful for generating helpful messages when the policy is violated.

    interface Policy {
        configSchema?: PolicyConfigSchema;
        description: string;
        displayName?: string;
        enforcementLevel?: EnforcementLevel;
        framework?: PolicyComplianceFramework;
        name: string;
        remediationSteps?: string;
        severity?: Severity;
        tags?: string[];
        url?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    configSchema?: PolicyConfigSchema

    This policy's configuration schema.

    For example:

    {
    configSchema: {
    properties: {
    expiration: {
    type: "integer",
    default: 14,
    },
    identifier: {
    type: "string",
    },
    },
    },

    validateResource: (args, reportViolation) => {
    const { expiration, identifier } = args.getConfig<{ expiration: number; identifier?: string; }>();

    // ...
    }),
    }
    description: string

    A brief description of the policy rule. e.g., "S3 buckets should have default encryption enabled."

    displayName?: string

    An optional pretty name for the policy.

    enforcementLevel?: EnforcementLevel

    Indicates what to do on policy violation, e.g., block deployment but allow override with proper permissions.

    The compliance framework that this policy belongs to.

    name: string

    An ID for the policy. Must be unique within the current policy set.

    remediationSteps?: string

    A description of the steps to take to remediate a policy violation.

    severity?: Severity

    The severity of the policy.

    tags?: string[]

    Tags associated with the policy.

    url?: string

    An optional URL to more information about the policy.