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

    Function validateStackResourcesOfType

    • A helper function that returns a strongly-typed stack validation function, used to check only resources of the specified resource class.

      For example:

      validateStack: validateStackResourcesOfType(aws.s3.Bucket, (buckets, args, reportViolation) => {
      for (const bucket of buckets) {
      // ...
      }
      }),

      Type Parameters

      • TResource extends Resource

      Parameters

      • resourceClass: new (...rest: any[]) => TResource

        Used to filter this check to only resources of the specified resource class.

      • validate: (
            resources: ResolvedResource<TResource>[],
            args: StackValidationArgs,
            reportViolation: ReportViolation,
        ) => void | Promise<void>

        A callback function that validates if a stack violates a policy.

      Returns StackValidation