Package com.pulumi.resources
Class Resource
java.lang.Object
com.pulumi.resources.Resource
- Direct Known Subclasses:
ComponentResource,CustomResource
Resource represents a class whose CRUD operations are implemented by a provider plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options) protectedResource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency) protectedResource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency, CompletableFuture<String> packageRef) Creates and registers a new resource object. -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<CompletableFuture<Output<String>>>idFuture()Lazy Initialization method called at the beginning of the constructor.The child resources of this Pulumi resource.The Pulumi name assigned to the resource at construction.The Pulumi type assigned to the resource at construction.urn()Pulumi URN is the stable logical identifier used to distinctly address a resource, both before and after deployments.
-
Field Details
-
childResources
-
remote
protected final boolean remote
-
-
Constructor Details
-
Resource
protected Resource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options) -
Resource
protected Resource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency) -
Resource
protected Resource(String type, String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency, CompletableFuture<String> packageRef) Creates and registers a new resource object. The "type" is the fully qualified type token and "name" is the "name" part to of a stable and globally unique URN for the object, "dependsOn" is an optional list of other resources that this resource depends on, controlling the order in which we perform resource operations.- Parameters:
type- the type of the resourcename- the unique name of the resourcecustom- true to indicate that this is a custom resource, managed by a pluginargs- the arguments to use to populate the new resourceoptions- a bag of options that control this resource's behaviorremote- This parameter is intended for use by code-generated component SDKs; end users authoring their ownComponentResourcesubclasses should leave this at its default (false). Whentrue, the component's children are constructed by the engine rather than in this process, and the constructor skips local child registration accordingly.dependency- true if this is a synthetic resource used internally for dependency trackingpackageRef- the package reference to use if this resource belongs to a parameterized provider
-
-
Method Details
-
idFuture
Lazy Initialization method called at the beginning of the constructor. Resources with the id field must override this method. -
pulumiResourceType
The Pulumi type assigned to the resource at construction.- Returns:
- the type of the Pulumi resource
-
pulumiResourceName
The Pulumi name assigned to the resource at construction.- Returns:
- the name of the Pulumi resource
-
pulumiChildResources
The child resources of this Pulumi resource. We use these (only from a @seeComponentResource) to allow code to "dependOn" a @seeComponentResourceand have that effectively mean that it is depending on all the @seeComponentResourcechildren of that component.Important! We only walk through @see
ComponentResources. They're the only resources that serve as an aggregation of other primitive (i.e.custom) resources. While a custom resource can be a parent of other resources, we don't want to ever depend on those child resource. If we do, it's simple to end up in a situation where we end up depending on a child resource that has a data cycle dependency due to the data passed into it. This would be pretty nonsensical as there is zero need for a custom resource to ever need to reference the urn of a component resource. So it's acceptable if that sort of pattern failed in practice.- Returns:
- the child resources of this Pulumi resource
-
urn
Pulumi URN is the stable logical identifier used to distinctly address a resource, both before and after deployments.- Returns:
- the stable logical Pulumi URN
-