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

    Interface PolicyResource

    PolicyResource represents a resource in the stack.

    interface PolicyResource {
        dependencies: PolicyResource[];
        name: string;
        opts: PolicyResourceOptions;
        parent?: PolicyResource;
        propertyDependencies: Record<string, PolicyResource[]>;
        props: Record<string, any>;
        provider?: PolicyProviderResource;
        type: string;
        urn: string;
        asType<TResource extends Resource>(
            resourceClass: new (...rest: any[]) => TResource,
        ): ResolvedResource<TResource> | undefined;
        isType<TResource extends Resource>(
            resourceClass: new (...rest: any[]) => TResource,
        ): boolean;
    }
    Index

    Properties

    dependencies: PolicyResource[]

    The dependencies of the resource.

    name: string

    The name of the resource.

    The options of the resource.

    An optional parent that this resource belongs to.

    propertyDependencies: Record<string, PolicyResource[]>

    The set of dependencies that affect each property.

    props: Record<string, any>

    The outputs 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 if the type of this resource is the same as resourceClass, otherwise undefined.

      For example:

      const buckets = args.resources
      .map(r = r.asType(aws.s3.Bucket))
      .filter(b => b);
      for (const bucket of buckets) {
      // ...
      }

      Type Parameters

      • TResource extends Resource

      Parameters

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

      Returns ResolvedResource<TResource> | undefined

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

      For example:

      for (const resource of args.resources) {
      if (resource.isType(aws.s3.Bucket)) {
      // ...
      }
      }

      Type Parameters

      • TResource extends Resource

      Parameters

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

      Returns boolean