Documentation Index
Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
The DataResource implements the standard resource lifecycle, but does not directly take any other actions.
You can use the DataResource resource without requiring or configuring a provider.
The DataResource resource is useful for storing values which need to follow a manage resource lifecycle, and for triggering provisioners when there is no other logical managed resource in which to place them.
It requires Terraform 1.4 or later.
It is also possible to generate these bindings by adding “terraform.io/builtin/terraform” to the “terraformProviders” key in your cdktf.json file and running “cdktn get”.
https://developer.hashicorp.com/terraform/language/resources/terraform-data
Initializers
using Io.Cdktn;
new DataResource(Construct Scope, string Id, DataConfig Config = null);
| Name | Type | Description |
|---|
Scope | Constructs.Construct | The scope in which to define this construct. |
Id | string | The scoped construct ID. |
Config | DataConfig | No description. |
ScopeRequired
- Type: Constructs.Construct
The scope in which to define this construct.
IdRequired
The scoped construct ID.
Must be unique amongst siblings in the same scope
ConfigOptional
Methods
| Name | Description |
|---|
ToString | Returns a string representation of this construct. |
AddOverride | No description. |
OverrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
ResetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
ToHclTerraform | No description. |
ToMetadata | No description. |
ToTerraform | Adds this resource to the terraform JSON output. |
AddMoveTarget | Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move. |
GetAnyMapAttribute | No description. |
GetBooleanAttribute | No description. |
GetBooleanMapAttribute | No description. |
GetListAttribute | No description. |
GetNumberAttribute | No description. |
GetNumberListAttribute | No description. |
GetNumberMapAttribute | No description. |
GetStringAttribute | No description. |
GetStringMapAttribute | No description. |
HasResourceMove | No description. |
ImportFrom | No description. |
InterpolationForAttribute | No description. |
MoveFromId | Move the resource corresponding to “id” to this resource. |
MoveTo | Moves this resource to the target resource given by moveTarget. |
MoveToId | Moves this resource to the resource corresponding to “id”. |
ResetInput | No description. |
ResetTriggersReplace | No description. |
ToString
private string ToString()
Returns a string representation of this construct.
AddOverride
private void AddOverride(string Path, object Value)
PathRequired
ValueRequired
OverrideLogicalId
private void OverrideLogicalId(string NewLogicalId)
Overrides the auto-generated logical ID with a specific ID.
NewLogicalIdRequired
The new logical ID to use for this stack element.
ResetOverrideLogicalId
private void ResetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
private object ToHclTerraform()
private object ToMetadata()
private object ToTerraform()
Adds this resource to the terraform JSON output.
AddMoveTarget
private void AddMoveTarget(string MoveTarget)
Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move.
MoveTargetRequired
The string move target that will correspond to this resource.
GetAnyMapAttribute
private System.Collections.Generic.IDictionary<string, object> GetAnyMapAttribute(string TerraformAttribute)
GetBooleanAttribute
private IResolvable GetBooleanAttribute(string TerraformAttribute)
GetBooleanMapAttribute
private System.Collections.Generic.IDictionary<string, bool> GetBooleanMapAttribute(string TerraformAttribute)
GetListAttribute
private string[] GetListAttribute(string TerraformAttribute)
GetNumberAttribute
private double GetNumberAttribute(string TerraformAttribute)
GetNumberListAttribute
private double[] GetNumberListAttribute(string TerraformAttribute)
GetNumberMapAttribute
private System.Collections.Generic.IDictionary<string, double> GetNumberMapAttribute(string TerraformAttribute)
GetStringAttribute
private string GetStringAttribute(string TerraformAttribute)
GetStringMapAttribute
private System.Collections.Generic.IDictionary<string, string> GetStringMapAttribute(string TerraformAttribute)
HasResourceMove
private TerraformResourceMoveByTarget|TerraformResourceMoveById HasResourceMove()
ImportFrom
private void ImportFrom(string Id, TerraformProvider Provider = null)
IdRequired
ProviderOptional
InterpolationForAttribute
private IResolvable InterpolationForAttribute(string TerraformAttribute)
MoveFromId
private void MoveFromId(string Id)
Move the resource corresponding to “id” to this resource.
Note that the resource being moved from must be marked as moved using it’s instance function.
IdRequired
Full id of resource being moved from, e.g. “aws_s3_bucket.example”.
MoveTo
private void MoveTo(string MoveTarget, string|double Index = null)
Moves this resource to the target resource given by moveTarget.
MoveTargetRequired
The previously set user defined string set by .addMoveTarget() corresponding to the resource to move to.
IndexOptional
Optional The index corresponding to the key the resource is to appear in the foreach of a resource to move to.
MoveToId
private void MoveToId(string Id)
Moves this resource to the resource corresponding to “id”.
IdRequired
Full id of resource to move to, e.g. “aws_s3_bucket.example”.
private void ResetInput()
ResetTriggersReplace
private void ResetTriggersReplace()
Static Functions
| Name | Description |
|---|
IsConstruct | Checks if x is a construct. |
IsTerraformElement | No description. |
IsTerraformResource | No description. |
GenerateConfigForImport | Generates CDKTN code for importing a Data resource upon running “cdktn plan < stack-name >”. |
IsConstruct
using Io.Cdktn;
DataResource.IsConstruct(object X);
Checks if x is a construct.
Use this method instead of instanceof to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct in each copy of the constructs library
is seen as a different class, and an instance of one class will not test as
instanceof the other class. npm install will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof will behave
unpredictably. It is safest to avoid using instanceof, and using
this type-testing method instead.
XRequired
Any object.
using Io.Cdktn;
DataResource.IsTerraformElement(object X);
XRequired
using Io.Cdktn;
DataResource.IsTerraformResource(object X);
XRequired
GenerateConfigForImport
using Io.Cdktn;
DataResource.GenerateConfigForImport(Construct Scope, string ImportToId, string ImportFromId, TerraformProvider Provider = null);
Generates CDKTN code for importing a Data resource upon running “cdktn plan < stack-name >”.
ScopeRequired
- Type: Constructs.Construct
The scope in which to define this construct.
ImportToIdRequired
The construct id used in the generated config for the Data to import.
ImportFromIdRequired
The id of the existing Data that should be imported.
Refer to the import section in the documentation of this resource for the id to use
ProviderOptional
? Optional instance of the provider where the Data to import is found.
Properties
| Name | Type | Description |
|---|
Node | Constructs.Node | The tree node. |
CdktfStack | TerraformStack | No description. |
Fqn | string | No description. |
FriendlyUniqueId | string | No description. |
TerraformMetaArguments | System.Collections.Generic.IDictionary< string, object > | No description. |
TerraformResourceType | string | No description. |
TerraformGeneratorMetadata | TerraformProviderGeneratorMetadata | No description. |
Connection | SSHProvisionerConnection|WinrmProvisionerConnection | No description. |
Count | double|TerraformCount | No description. |
DependsOn | string[] | No description. |
ForEach | ITerraformIterator | No description. |
Lifecycle | TerraformResourceLifecycle | No description. |
Provider | TerraformProvider | No description. |
Provisioners | FileProvisioner|LocalExecProvisioner|RemoteExecProvisioner[] | No description. |
Id | string | No description. |
Output | AnyMap | No description. |
InputInput | System.Collections.Generic.IDictionary< string, object > | No description. |
TriggersReplaceInput | System.Collections.Generic.IDictionary< string, object > | No description. |
Input | System.Collections.Generic.IDictionary< string, object > | (Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply. |
TriggersReplace | System.Collections.Generic.IDictionary< string, object > | (Optional) A value which is stored in the instance state, and will force replacement when the value changes. |
NodeRequired
public Node Node { get; }
The tree node.
CdktfStackRequired
public TerraformStack CdktfStack { get; }
FqnRequired
public string Fqn { get; }
FriendlyUniqueIdRequired
public string FriendlyUniqueId { get; }
public System.Collections.Generic.IDictionary<string, object> TerraformMetaArguments { get; }
- Type: System.Collections.Generic.IDictionary< string, object >
public string TerraformResourceType { get; }
public TerraformProviderGeneratorMetadata TerraformGeneratorMetadata { get; }
ConnectionOptional
public SSHProvisionerConnection|WinrmProvisionerConnection Connection { get; }
CountOptional
public double|TerraformCount Count { get; }
DependsOnOptional
public string[] DependsOn { get; }
ForEachOptional
public ITerraformIterator ForEach { get; }
LifecycleOptional
public TerraformResourceLifecycle Lifecycle { get; }
ProviderOptional
public TerraformProvider Provider { get; }
ProvisionersOptional
public (FileProvisioner|LocalExecProvisioner|RemoteExecProvisioner)[] Provisioners { get; }
IdRequired
public string Id { get; }
OutputRequired
public AnyMap Output { get; }
public System.Collections.Generic.IDictionary<string, object> InputInput { get; }
- Type: System.Collections.Generic.IDictionary< string, object >
public System.Collections.Generic.IDictionary<string, object> TriggersReplaceInput { get; }
- Type: System.Collections.Generic.IDictionary< string, object >
public System.Collections.Generic.IDictionary<string, object> Input { get; }
- Type: System.Collections.Generic.IDictionary< string, object >
(Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#input
TriggersReplaceRequired
public System.Collections.Generic.IDictionary<string, object> TriggersReplace { get; }
- Type: System.Collections.Generic.IDictionary< string, object >
(Optional) A value which is stored in the instance state, and will force replacement when the value changes.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#triggers\_replace
Constants
| Name | Type | Description |
|---|
TfResourceType | string | No description. |
TfResourceTypeRequired
public string TfResourceType { get; }