abstractAResource <S, T>
Hierarchy
- ANode<S, T>
- AResource
Implements
- IResource<S, T>
Index
Properties
readonlylocalResourceId
The ID of the resource, unique within its scope.
readonlyparents
The resources this one is built on top of. A parent is always created before its children, and destroyed after them.
readonlyproperties
The desired configuration of the resource.
readonlyresponse
What the cloud provider reported back about this resource, e.g. an ARN or a generated ID. It is empty until the resource has actually been created, and is what other resources read when they need to reference this one.
readonlyscope
The contexts of the models this resource is placed under, sorted. Octo derives it from the node whose action created the resource; a resource created outside a model action has an empty scope.
readonlytags
The tags applied to this resource. See Octo.registerTags to set them in bulk.
staticreadonlyinheritedNODE_NAME
The name of the node. All nodes with same name are of the same category.
staticreadonlyinheritedNODE_PACKAGE
The package of the node.
staticreadonlyinheritedNODE_SCHEMA
The schema of the node.
staticreadonlyinheritedNODE_TYPE
The type of the node.
Accessors
resourceId
The ID of the resource, unique across the infrastructure: its
localResourceId, followed by a hash of its scope when it has one.Returns S[resourceId]
Methods
addFieldDependency
Returns void
addRelationship
Returns { thatToThisDependency: Dependency; thisToThatDependency: Dependency }
thatToThisDependency: Dependency
thisToThatDependency: Dependency
diffUnpack
findParentsByProperty
To find this resource's parents whose properties match every given filter.
Parameters
filters: { key: string; value: unknown }[]
Each filter is a property
keythe parent must carry with the givenvalue.
Returns UnknownResource[]
findParentsByTag
To find this resource's parents whose tags match every given filter.
Parameters
filters: { key: string; value: string }[]
Each filter is a tag
keythe parent must carry with the givenvalue.
Returns UnknownResource[]
getBoundaryMembers
Returns UnknownResource[]
getExternalTriggerProperties
The properties whose change means an external resource has to be run again. Terraform hashes them into the trigger of the
null_resourcethat stands in for the resource, which is how it decides to call back.A resource that overrides diffProperties to ignore a property must exclude that property here too. The two answer the same question, and terraform plans a replacement for any property only this one covers, which octo then reports no change for.
Returns Partial<S[properties]>
getSiblings
Returns {}
[p string]: Dependency[]
isMarkedDeleted
Whether this resource is marked for deletion, and will leave the graph at the end of the transaction.
Returns boolean
remove
To mark this resource for deletion. It leaves the graph at the end of the transaction.
Parameters
force: boolean = false
Removes the resource even if other resources still depend on it.
Returns void
setResponse
To record what the cloud provider reported back about this resource. Keys absent from
responseare left as they were.Parameters
response: S[response]
Returns void
The base class of every resource - the nodes that describe actual cloud infrastructure.
Where a model says what you want, a resource says what exists. Resources are never constructed by you directly; a model action declares them, and Octo diffs the declared graph against the last committed one to decide what to create, update, or destroy.
A resource is identified by its
resourceId, configured by itsproperties, and reports back through itsresponseonce the infrastructure exists. The ID it is created with is itslocalResourceId, which only has to be unique within itsscope: where the node creating the resource sits in the model graph. Octo makes theresourceIdfrom the two.Most resources extend ATerraformResource rather than this class.
Resources
Definition of Resources.