Interface ResourceValidationArgs

ResourceValidationArgs is the argument bag passed to a resource validation.

interface ResourceValidationArgs {
    name: string;
    opts: PolicyResourceOptions;
    props: Record<string, any>;
    provider?: PolicyProviderResource;
    type: string;
    urn: string;
    asType<TResource, TArgs>(resourceClass): undefined | Unwrap<NonNullable<TArgs>>;
    getConfig<T>(): T;
    isType<TResource>(resourceClass): boolean;
}

Properties

name: string

The name of the resource.

The options of the resource.

props: Record<string, any>

The inputs of the resource.

The provider of the resource.

type: string

The type of the resource.

urn: string

The URN of the resource.

Methods

  • Returns the resource args for resourceClass if the type of this resource is the same as resourceClass, otherwise undefined.

    For example:

    const bucketArgs = args.AsType(aws.s3.Bucket);
    if (bucketArgs) {
    // ...
    }

    Type Parameters

    Parameters

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

    Returns undefined | Unwrap<NonNullable<TArgs>>

  • Returns configuration for the policy.

    Type Parameters

    • T extends object

    Returns T

  • Returns true if the type of this resource is the same as resourceClass.

    For example:

    if (args.isType(aws.s3.Bucket)) {
    // ...
    }

    Type Parameters

    Parameters

    Returns boolean

Generated using TypeDoc