Function validateResourceOfType

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

    For example:

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

    Type Parameters

    Parameters

    • resourceClass: (new (name, args, ...rest) => TResource)

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

    • validate: TypedResourceValidation<Unwrap<NonNullable<TArgs>>>

      A callback function that validates if the resource definition violates a policy.

    Returns ResourceValidation

Generated using TypeDoc