Package com.pulumi.resources
Class Resource
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- Direct Known Subclasses:
ComponentResource
,CustomResource
@ParametersAreNonnullByDefault public abstract class Resource extends java.lang.Object
Resource represents a class whose CRUD operations are implemented by a provider plugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Resource.LazyField<T>
static class
Resource.LazyFields
static class
Resource.ResourceInternal
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<Resource>
childResources
protected boolean
remote
-
Constructor Summary
Constructors Modifier Constructor Description protected
Resource(java.lang.String type, java.lang.String name, boolean custom, ResourceArgs args, ResourceOptions options)
protected
Resource(java.lang.String type, java.lang.String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency)
Creates and registers a new resource object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Resource>
getChildResources()
The child resources of this resource.java.lang.String
getResourceName()
The name assigned to the resource at construction.java.lang.String
getResourceType()
The type assigned to the resource at construction.Output<java.lang.String>
getUrn()
Urn is the stable logical URN used to distinctly address a resource, both before and after deployments.protected java.util.Optional<java.util.concurrent.CompletableFuture<Output<java.lang.String>>>
idFuture()
Lazy Initialization method called at the beginning of the constructor.
-
-
-
Field Detail
-
childResources
protected final java.util.Set<Resource> childResources
-
remote
protected final boolean remote
-
-
Constructor Detail
-
Resource
protected Resource(java.lang.String type, java.lang.String name, boolean custom, ResourceArgs args, ResourceOptions options)
-
Resource
protected Resource(java.lang.String type, java.lang.String name, boolean custom, ResourceArgs args, ResourceOptions options, boolean remote, boolean dependency)
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
- true if this is a remote component resourcedependency
- true if this is a synthetic resource used internally for dependency tracking
-
-
Method Detail
-
idFuture
protected java.util.Optional<java.util.concurrent.CompletableFuture<Output<java.lang.String>>> idFuture()
Lazy Initialization method called at the beginning of the constructor. Resources with the id field must override this method.
-
getResourceType
public java.lang.String getResourceType()
The type assigned to the resource at construction.
-
getResourceName
public java.lang.String getResourceName()
The name assigned to the resource at construction.
-
getChildResources
public java.util.Set<Resource> getChildResources()
The child resources of this resource. We use these (only from a @seeComponentResource
) to allow code to "dependOn" a @seeComponentResource
and have that effectively mean that it is depending on all the @seeComponentResource
children of that component.Important! We only walk through @see
ComponentResource
s. 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.
-
getUrn
public Output<java.lang.String> getUrn()
Urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
-
-