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>(resourceClass): undefined | ResolvedResource<TResource>;
    isType<TResource>(resourceClass): boolean;
}

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

    Parameters

    Returns undefined | ResolvedResource<TResource>

  • 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

    Parameters

    Returns boolean

Generated using TypeDoc