Skip to main content

Initializers

using Io.Cdktn;

new TerraformResource(Construct Scope, string Id, TerraformResourceConfig Config);
NameTypeDescription
ScopeConstructs.ConstructNo description.
IdstringNo description.
ConfigTerraformResourceConfigNo description.

ScopeRequired

  • Type: Constructs.Construct

IdRequired

  • Type: string

ConfigRequired


Methods

NameDescription
ToStringReturns a string representation of this construct.
AddOverrideNo description.
OverrideLogicalIdOverrides the auto-generated logical ID with a specific ID.
ResetOverrideLogicalIdResets a previously passed logical Id to use the auto-generated logical id again.
ToHclTerraformNo description.
ToMetadataNo description.
ToTerraformAdds this resource to the terraform JSON output.
AddMoveTargetAdds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move.
GetAnyMapAttributeNo description.
GetBooleanAttributeNo description.
GetBooleanMapAttributeNo description.
GetListAttributeNo description.
GetNumberAttributeNo description.
GetNumberListAttributeNo description.
GetNumberMapAttributeNo description.
GetStringAttributeNo description.
GetStringMapAttributeNo description.
HasResourceMoveNo description.
ImportFromNo description.
InterpolationForAttributeNo description.
MoveFromIdMove the resource corresponding to “id” to this resource.
MoveToMoves this resource to the target resource given by moveTarget.
MoveToIdMoves this resource to the resource corresponding to “id”.

ToString

private string ToString()
Returns a string representation of this construct.

AddOverride

private void AddOverride(string Path, object Value)

PathRequired

  • Type: string

ValueRequired

  • Type: object

OverrideLogicalId

private void OverrideLogicalId(string NewLogicalId)
Overrides the auto-generated logical ID with a specific ID.

NewLogicalIdRequired

  • Type: string
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.

ToHclTerraform

private object ToHclTerraform()

ToMetadata

private object ToMetadata()

ToTerraform

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

  • Type: string
The string move target that will correspond to this resource.

GetAnyMapAttribute

private System.Collections.Generic.IDictionary<string, object> GetAnyMapAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetBooleanAttribute

private IResolvable GetBooleanAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetBooleanMapAttribute

private System.Collections.Generic.IDictionary<string, bool> GetBooleanMapAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetListAttribute

private string[] GetListAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetNumberAttribute

private double GetNumberAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetNumberListAttribute

private double[] GetNumberListAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetNumberMapAttribute

private System.Collections.Generic.IDictionary<string, double> GetNumberMapAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetStringAttribute

private string GetStringAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

GetStringMapAttribute

private System.Collections.Generic.IDictionary<string, string> GetStringMapAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

HasResourceMove

private TerraformResourceMoveByTarget|TerraformResourceMoveById HasResourceMove()

ImportFrom

private void ImportFrom(string Id, TerraformProvider Provider = null)

IdRequired

  • Type: string

ProviderOptional


InterpolationForAttribute

private IResolvable InterpolationForAttribute(string TerraformAttribute)

TerraformAttributeRequired

  • Type: string

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

  • Type: string
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

  • Type: string
The previously set user defined string set by .addMoveTarget() corresponding to the resource to move to.

IndexOptional

  • Type: string|double
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

  • Type: string
Full id of resource to move to, e.g. “aws_s3_bucket.example”.

Static Functions

NameDescription
IsConstructChecks if x is a construct.
IsTerraformElementNo description.
IsTerraformResourceNo description.

IsConstruct

using Io.Cdktn;

TerraformResource.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

  • Type: object
Any object.

IsTerraformElement

using Io.Cdktn;

TerraformResource.IsTerraformElement(object X);

XRequired

  • Type: object

IsTerraformResource

using Io.Cdktn;

TerraformResource.IsTerraformResource(object X);

XRequired

  • Type: object

Properties

NameTypeDescription
NodeConstructs.NodeThe tree node.
CdktfStackTerraformStackNo description.
FqnstringNo description.
FriendlyUniqueIdstringNo description.
TerraformMetaArgumentsSystem.Collections.Generic.IDictionary< string, object >No description.
TerraformResourceTypestringNo description.
TerraformGeneratorMetadataTerraformProviderGeneratorMetadataNo description.
ConnectionSSHProvisionerConnection|WinrmProvisionerConnectionNo description.
Countdouble|TerraformCountNo description.
DependsOnstring[]No description.
ForEachITerraformIteratorNo description.
LifecycleTerraformResourceLifecycleNo description.
ProviderTerraformProviderNo description.
ProvisionersFileProvisioner|LocalExecProvisioner|RemoteExecProvisioner[]No description.

NodeRequired

public Node Node { get; }
  • Type: Constructs.Node
The tree node.

CdktfStackRequired

public TerraformStack CdktfStack { get; }

FqnRequired

public string Fqn { get; }
  • Type: string

FriendlyUniqueIdRequired

public string FriendlyUniqueId { get; }
  • Type: string

TerraformMetaArgumentsRequired

public System.Collections.Generic.IDictionary<string, object> TerraformMetaArguments { get; }
  • Type: System.Collections.Generic.IDictionary< string, object >

TerraformResourceTypeRequired

public string TerraformResourceType { get; }
  • Type: string

TerraformGeneratorMetadataOptional

public TerraformProviderGeneratorMetadata TerraformGeneratorMetadata { get; }

ConnectionOptional

public SSHProvisionerConnection|WinrmProvisionerConnection Connection { get; }

CountOptional

public double|TerraformCount Count { get; }

DependsOnOptional

public string[] DependsOn { get; }
  • Type: string[]

ForEachOptional

public ITerraformIterator ForEach { get; }

LifecycleOptional

public TerraformResourceLifecycle Lifecycle { get; }

ProviderOptional

public TerraformProvider Provider { get; }

ProvisionersOptional

public (FileProvisioner|LocalExecProvisioner|RemoteExecProvisioner)[] Provisioners { get; }