Terraform
Typescript: Protocols
IAnyProducer
- Implemented By: IAnyProducer
Interface for lazy untyped value producers.
Methods
Name | Description |
---|---|
produce | Produce the value. |
produce
public produce(context: IResolveContext): any
Produce the value.
context
Required
- Type: IResolveContext
IAspect
- Implemented By: MigrateIds, IAspect
Represents an Aspect.
Methods
Name | Description |
---|---|
visit | All aspects can visit an IConstruct. |
visit
public visit(node: IConstruct): void
All aspects can visit an IConstruct.
node
Required
- Type: constructs.IConstruct
IFragmentConcatenator
- Implemented By: StringConcat, IFragmentConcatenator
Function used to concatenate symbols in the target document language.
Interface so it could potentially be exposed over jsii.
Methods
Name | Description |
---|---|
join | Join the fragment on the left and on the right. |
join
public join(left: any, right: any): any
Join the fragment on the left and on the right.
left
Required
- Type: any
right
Required
- Type: any
IImportableConfig
- Implemented By: IImportableConfig
Properties
Name | Type | Description |
---|---|---|
importId | string | No description. |
terraformResourceType | string | No description. |
provider | TerraformProvider | No description. |
importId
Required
public readonly importId: string;
- Type: string
terraformResourceType
Required
public readonly terraformResourceType: string;
- Type: string
provider
Optional
public readonly provider: TerraformProvider;
- Type: TerraformProvider
IInterpolatingParent
- Implemented By: AnyMapList, BooleanMapList, ComplexComputedList, ComplexObject, DataResource, MapList, NumberMapList, StringMapList, TerraformDataSource, TerraformResource, IInterpolatingParent
Methods
Name | Description |
---|---|
interpolationForAttribute | No description. |
interpolationForAttribute
public interpolationForAttribute(terraformAttribute: string): IResolvable
terraformAttribute
Required
- Type: string
IListProducer
- Implemented By: IListProducer
Interface for lazy list producers.
Methods
Name | Description |
---|---|
produce | Produce the list value. |
produce
public produce(context: IResolveContext): string[]
Produce the list value.
context
Required
- Type: IResolveContext
IManifest
Properties
Name | Type | Description |
---|---|---|
stacks | {[ key: string ]: StackManifest} | No description. |
version | string | No description. |
stacks
Required
public readonly stacks: {[ key: string ]: StackManifest};
- Type: {[ key: string ]: StackManifest}
version
Required
public readonly version: string;
- Type: string
INumberProducer
- Implemented By: INumberProducer
Interface for lazy number producers.
Methods
Name | Description |
---|---|
produce | Produce the number value. |
produce
public produce(context: IResolveContext): number
Produce the number value.
context
Required
- Type: IResolveContext
IPostProcessor
- Implemented By: IPostProcessor
A Token that can post-process the complete resolved value, after resolve() has recursed over it.
Methods
Name | Description |
---|---|
postProcess | Process the completely resolved value, after full recursion/resolution has happened. |
postProcess
public postProcess(input: any, context: IResolveContext): any
Process the completely resolved value, after full recursion/resolution has happened.
input
Required
- Type: any
context
Required
- Type: IResolveContext
IRemoteWorkspace
- Implemented By: NamedRemoteWorkspace, PrefixedRemoteWorkspaces, IRemoteWorkspace
IResolvable
- Implemented By: AnyListList, AnyListMap, AnyMap, AnyMapList, BooleanList, BooleanListList, BooleanListMap, BooleanMap, BooleanMapList, ComplexComputedList, ComplexList, ComplexMap, ComplexObject, LazyBase, MapList, NumberListList, NumberListMap, NumberMap, NumberMapList, StringListList, StringListMap, StringMap, StringMapList, IResolvable
Interface for values that can be resolvable later.
Tokens are special objects that participate in synthesis.
Methods
Name | Description |
---|---|
resolve | Produce the Token's value at resolution time. |
toString | Return a string representation of this resolvable object. |
resolve
public resolve(context: IResolveContext): any
Produce the Token's value at resolution time.
context
Required
- Type: IResolveContext
toString
public toString(): string
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creationStack | string[] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
creationStack
Required
public readonly creationStack: string[];
- Type: string[]
The creation stack of this resolvable which will be appended to errors thrown during resolution.
If this returns an empty array the stack will not be attached.
IResolveContext
- Implemented By: IResolveContext
Current resolution context for tokens.
Methods
Name | Description |
---|---|
registerPostProcessor | Use this postprocessor after the entire token structure has been resolved. |
resolve | Resolve an inner object. |
registerPostProcessor
public registerPostProcessor(postProcessor: IPostProcessor): void
Use this postprocessor after the entire token structure has been resolved.
postProcessor
Required
- Type: IPostProcessor
resolve
public resolve(x: any): any
Resolve an inner object.
x
Required
- Type: any
Properties
Name | Type | Description |
---|---|---|
preparing | boolean | True when we are still preparing, false if we're rendering the final output. |
scope | constructs.IConstruct | The scope from which resolution has been initiated. |
ignoreEscapes | boolean | True when ${} should not be parsed, and treated as literals. |
iteratorContext | string | TerraformIterators can be passed for block attributes and normal list attributes both require different handling when the iterable variable is accessed e.g. a dynamic block needs each.key while a for expression just needs key. |
suppressBraces | boolean | True when ${} should be ommitted (because already inside them), false otherwise. |
warnEscapes | boolean | True when ${} should not be included in the string to be resolved, outputs a warning. |
preparing
Required
public readonly preparing: boolean;
- Type: boolean
True when we are still preparing, false if we're rendering the final output.
scope
Required
public readonly scope: IConstruct;
- Type: constructs.IConstruct
The scope from which resolution has been initiated.
ignoreEscapes
Optional
public readonly ignoreEscapes: boolean;
- Type: boolean
True when ${} should not be parsed, and treated as literals.
iteratorContext
Optional
public readonly iteratorContext: string;
- Type: string
TerraformIterators can be passed for block attributes and normal list attributes both require different handling when the iterable variable is accessed e.g. a dynamic block needs each.key while a for expression just needs key.
suppressBraces
Optional
public readonly suppressBraces: boolean;
- Type: boolean
True when ${} should be ommitted (because already inside them), false otherwise.
warnEscapes
Optional
public readonly warnEscapes: boolean;
- Type: boolean
True when ${} should not be included in the string to be resolved, outputs a warning.
Default: false
IResource
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
stack | TerraformStack | The stack in which this resource is defined. |
node
Required
public readonly node: Node;
- Type: constructs.Node
The tree node.
stack
Required
public readonly stack: TerraformStack;
- Type: TerraformStack
The stack in which this resource is defined.
IResourceConstructor
- Implemented By: IResourceConstructor
IScopeCallback
- Implemented By: IScopeCallback
IStackSynthesizer
- Implemented By: IStackSynthesizer
Encodes information how a certain Stack should be deployed inspired by AWS CDK v2 implementation (synth functionality was removed in constructs v10).
Methods
Name | Description |
---|---|
synthesize | Synthesize the associated stack to the session. |
synthesize
public synthesize(session: ISynthesisSession): void
Synthesize the associated stack to the session.
session
Required
- Type: ISynthesisSession
IStringProducer
- Implemented By: IStringProducer
Interface for lazy string producers.
Methods
Name | Description |
---|---|
produce | Produce the string value. |
produce
public produce(context: IResolveContext): string
Produce the string value.
context
Required
- Type: IResolveContext
ISynthesisSession
- Implemented By: ISynthesisSession
Represents a single session of synthesis.
Passed into TerraformStack.onSynthesize()
methods.
originally from aws/constructs lib v3.3.126 (synth functionality was removed in constructs v10)
Properties
Name | Type | Description |
---|---|---|
manifest | Manifest | No description. |
outdir | string | The output directory for this synthesis session. |
skipValidation | boolean | No description. |
manifest
Required
public readonly manifest: Manifest;
- Type: Manifest
outdir
Required
public readonly outdir: string;
- Type: string
The output directory for this synthesis session.
skipValidation
Optional
public readonly skipValidation: boolean;
- Type: boolean
ITerraformAddressable
- Implemented By: AnyListList, AnyListMap, AnyMap, AnyMapList, BooleanList, BooleanListList, BooleanListMap, BooleanMap, BooleanMapList, ComplexComputedList, ComplexList, ComplexMap, ComplexObject, DataResource, DataTerraformRemoteState, DataTerraformRemoteStateAzurerm, DataTerraformRemoteStateConsul, DataTerraformRemoteStateCos, DataTerraformRemoteStateGcs, DataTerraformRemoteStateHttp, DataTerraformRemoteStateLocal, DataTerraformRemoteStateOss, DataTerraformRemoteStatePg, DataTerraformRemoteStateS3, DataTerraformRemoteStateSwift, MapList, NumberListList, NumberListMap, NumberMap, NumberMapList, StringListList, StringListMap, StringMap, StringMapList, TerraformDataSource, TerraformHclModule, TerraformLocal, TerraformModule, TerraformRemoteState, TerraformResource, TerraformVariable, ITerraformAddressable, ITerraformDependable
Properties
Name | Type | Description |
---|---|---|
fqn | string | No description. |
fqn
Required
public readonly fqn: string;
- Type: string
ITerraformDependable
Extends: ITerraformAddressable
Implemented By: DataResource, TerraformDataSource, TerraformHclModule, TerraformModule, TerraformResource, ITerraformDependable
Properties
Name | Type | Description |
---|---|---|
fqn | string | No description. |
fqn
Required
public readonly fqn: string;
- Type: string
ITerraformIterator
- Implemented By: DynamicListTerraformIterator, ListTerraformIterator, MapTerraformIterator, ResourceTerraformIterator, TerraformIterator, ITerraformIterator
ITerraformResource
- Implemented By: DataResource, TerraformDataSource, TerraformResource, ITerraformResource
Methods
Name | Description |
---|---|
interpolationForAttribute | No description. |
interpolationForAttribute
public interpolationForAttribute(terraformAttribute: string): IResolvable
terraformAttribute
Required
- Type: string
Properties
Name | Type | Description |
---|---|---|
fqn | string | No description. |
friendlyUniqueId | string | No description. |
terraformResourceType | string | No description. |
count | number | TerraformCount | No description. |
dependsOn | string[] | No description. |
forEach | ITerraformIterator | No description. |
lifecycle | TerraformResourceLifecycle | No description. |
provider | TerraformProvider | No description. |
fqn
Required
public readonly fqn: string;
- Type: string
friendlyUniqueId
Required
public readonly friendlyUniqueId: string;
- Type: string
terraformResourceType
Required
public readonly terraformResourceType: string;
- Type: string
count
Optional
public readonly count: number | TerraformCount;
- Type: number | TerraformCount
dependsOn
Optional
public readonly dependsOn: string[];
- Type: string[]
forEach
Optional
public readonly forEach: ITerraformIterator;
- Type: ITerraformIterator
lifecycle
Optional
public readonly lifecycle: TerraformResourceLifecycle;
provider
Optional
public readonly provider: TerraformProvider;
- Type: TerraformProvider
ITokenMapper
- Implemented By: ITokenMapper
Interface to apply operation to tokens in a string.
Interface so it can be exported via jsii.
Methods
Name | Description |
---|---|
mapToken | Replace a single token. |
mapToken
public mapToken(t: IResolvable): any
Replace a single token.
t
Required
- Type: IResolvable
ITokenResolver
- Implemented By: DefaultTokenResolver, ITokenResolver
How to resolve tokens.
Methods
Name | Description |
---|---|
resolveList | Resolve a tokenized list. |
resolveMap | Resolve a tokenized map. |
resolveNumberList | Resolve a tokenized number list. |
resolveString | Resolve a string with at least one stringified token in it. |
resolveToken | Resolve a single token. |
resolveList
public resolveList(l: string[], context: IResolveContext): any
Resolve a tokenized list.
l
Required
- Type: string[]
context
Required
- Type: IResolveContext
resolveMap
public resolveMap(m: {[ key: string ]: any}, context: IResolveContext): any
Resolve a tokenized map.
m
Required
- Type: {[ key: string ]: any}
context
Required
- Type: IResolveContext
resolveNumberList
public resolveNumberList(l: number[], context: IResolveContext): any
Resolve a tokenized number list.
l
Required
- Type: number[]
context
Required
- Type: IResolveContext
resolveString
public resolveString(s: TokenizedStringFragments, context: IResolveContext): any
Resolve a string with at least one stringified token in it.
(May use concatenation)
s
Required
- Type: TokenizedStringFragments
context
Required
- Type: IResolveContext
resolveToken
public resolveToken(t: IResolvable, context: IResolveContext, postProcessor: IPostProcessor): any
Resolve a single token.
t
Required
- Type: IResolvable
context
Required
- Type: IResolveContext
postProcessor
Required
- Type: IPostProcessor