Class ComponentResource<TData>

ComponentResource is a resource that aggregates one or more other child resources into a higher level abstraction. The component resource itself is a resource, but does not require custom CRUD operations for provisioning.

Type Parameters

  • TData = any

Hierarchy (view full)


  • Creates and registers a new component resource. [type] is the fully qualified type token and [name] is the "name" part to use in creating a stable and globally unique URN for the object. [opts.parent] is the optional parent for this component, and [opts.dependsOn] is an optional list of other resources that this resource depends on, controlling the order in which we perform resource operations.

    Type Parameters

    • TData = any


    • type: string

      The type of the resource.

    • name: string

      The unique name of the resource.

    • args: Inputs = {}

      Information passed to [initialize] method.

    • opts: ComponentResourceOptions = {}

      A bag of options that control this resource's behavior.

    • remote: boolean = false

      True if this is a remote component resource.

    Returns ComponentResource<TData>


urn: Output<string>

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.


  • Retrieves the data produces by [initialize]. The data is immediately available in a derived class's constructor after the super(...) call to ComponentResource.

    Returns Promise<TData>

  • Can be overridden by a subclass to asynchronously initialize data for this Component automatically when constructed. The data will be available immediately for subclass constructors to use. To access the data use .getData.


    Returns Promise<TData>

  • registerOutputs registers synthetic outputs that a component has initialized, usually by allocating other child sub-resources and propagating their resulting property values.

    ComponentResources can call this at the end of their constructor to indicate that they are done creating child resources. This is not strictly necessary as this will automatically be called after the initialize method completes.


    Returns void

Generated using TypeDoc