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

    Interface ResourceValidationArgs

    ResourceValidationArgs is the argument bag passed to a resource validation.

    interface ResourceValidationArgs {
        name: string;
        opts: PolicyResourceOptions;
        props: Record<string, any>;
        provider?: PolicyProviderResource;
        stackTags: ReadonlyMap<string, string>;
        type: string;
        urn: string;
        asType<TResource extends Resource, TArgs>(
            resourceClass: new (
                name: string,
                args: TArgs,
                ...rest: any[],
            ) => TResource,
        ): Unwrap<NonNullable<TArgs>> | undefined;
        getConfig<T extends object>(): T;
        isType<TResource extends Resource>(
            resourceClass: new (...rest: any[]) => TResource,
        ): boolean;
        notApplicable(reason?: string): never;
    }
    Index

    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.

    stackTags: ReadonlyMap<string, string>

    Tags associated with the stack.

    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

      • TResource extends Resource
      • TArgs

      Parameters

      • resourceClass: new (name: string, args: TArgs, ...rest: any[]) => TResource

      Returns Unwrap<NonNullable<TArgs>> | undefined

    • 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

      • TResource extends Resource

      Parameters

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

      Returns boolean

    • Marks the policy as not applicable.

      Parameters

      • Optionalreason: string

        An optional reason why the policy is not applicable.

      Returns never