Terraform
Python: Protocols
IAnyProducer
- Implemented By: IAnyProducer
Interface for lazy untyped value producers.
Methods
Name | Description |
---|---|
produce | Produce the value. |
produce
def produce(
context: IResolveContext
) - > typing.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
def visit(
node: IConstruct
) - > None
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
def join(
left: typing.Any,
right: typing.Any
) - > typing.Any
Join the fragment on the left and on the right.
left
Required
- Type: typing.Any
right
Required
- Type: typing.Any
IImportableConfig
- Implemented By: IImportableConfig
Properties
Name | Type | Description |
---|---|---|
import_id | str | No description. |
terraform_resource_type | str | No description. |
provider | TerraformProvider | No description. |
import_id
Required
import_id: str
- Type: str
terraform_resource_type
Required
terraform_resource_type: str
- Type: str
provider
Optional
provider: TerraformProvider
- Type: TerraformProvider
IInterpolatingParent
- Implemented By: AnyMapList, BooleanMapList, ComplexComputedList, ComplexObject, DataResource, MapList, NumberMapList, StringMapList, TerraformDataSource, TerraformResource, IInterpolatingParent
Methods
Name | Description |
---|---|
interpolation_for_attribute | No description. |
interpolation_for_attribute
def interpolation_for_attribute(
terraform_attribute: str
) - > IResolvable
terraform_attribute
Required
- Type: str
IListProducer
- Implemented By: IListProducer
Interface for lazy list producers.
Methods
Name | Description |
---|---|
produce | Produce the list value. |
produce
def produce(
context: IResolveContext
) - > typing.List[str]
Produce the list value.
context
Required
- Type: IResolveContext
IManifest
Properties
Name | Type | Description |
---|---|---|
stacks | typing.Mapping[StackManifest] | No description. |
version | str | No description. |
stacks
Required
stacks: typing.Mapping[StackManifest]
- Type: typing.Mapping[StackManifest]
version
Required
version: str
- Type: str
INumberProducer
- Implemented By: INumberProducer
Interface for lazy number producers.
Methods
Name | Description |
---|---|
produce | Produce the number value. |
produce
def produce(
context: IResolveContext
) - > typing.Union[int, float]
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 |
---|---|
post_process | Process the completely resolved value, after full recursion/resolution has happened. |
post_process
def post_process(
input: typing.Any,
context: IResolveContext
) - > typing.Any
Process the completely resolved value, after full recursion/resolution has happened.
input
Required
- Type: typing.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. |
to_string | Return a string representation of this resolvable object. |
resolve
def resolve(
context: IResolveContext
) - > typing.Any
Produce the Token's value at resolution time.
context
Required
- Type: IResolveContext
to_string
def to_string() - > str
Return a string representation of this resolvable object.
Returns a reversible string representation.
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
creation_stack
Required
creation_stack: typing.List[str]
- Type: typing.List[str]
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 |
---|---|
register_post_processor | Use this postprocessor after the entire token structure has been resolved. |
resolve | Resolve an inner object. |
register_post_processor
def register_post_processor(
post_processor: IPostProcessor
) - > None
Use this postprocessor after the entire token structure has been resolved.
post_processor
Required
- Type: IPostProcessor
resolve
def resolve(
x: typing.Any
) - > typing.Any
Resolve an inner object.
x
Required
- Type: typing.Any
Properties
Name | Type | Description |
---|---|---|
preparing | bool | 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. |
ignore_escapes | bool | True when ${} should not be parsed, and treated as literals. |
iterator_context | str | 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. |
suppress_braces | bool | True when ${} should be ommitted (because already inside them), false otherwise. |
warn_escapes | bool | True when ${} should not be included in the string to be resolved, outputs a warning. |
preparing
Required
preparing: bool
- Type: bool
True when we are still preparing, false if we're rendering the final output.
scope
Required
scope: IConstruct
- Type: constructs.IConstruct
The scope from which resolution has been initiated.
ignore_escapes
Optional
ignore_escapes: bool
- Type: bool
True when ${} should not be parsed, and treated as literals.
iterator_context
Optional
iterator_context: str
- Type: str
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.
suppress_braces
Optional
suppress_braces: bool
- Type: bool
True when ${} should be ommitted (because already inside them), false otherwise.
warn_escapes
Optional
warn_escapes: bool
- Type: bool
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
node: Node
- Type: constructs.Node
The tree node.
stack
Required
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
def synthesize(
session: ISynthesisSession
) - > None
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
def produce(
context: IResolveContext
) - > str
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 | str | The output directory for this synthesis session. |
skip_validation | bool | No description. |
manifest
Required
manifest: Manifest
- Type: Manifest
outdir
Required
outdir: str
- Type: str
The output directory for this synthesis session.
skip_validation
Optional
skip_validation: bool
- Type: bool
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 | str | No description. |
fqn
Required
fqn: str
- Type: str
ITerraformDependable
Extends: ITerraformAddressable
Implemented By: DataResource, TerraformDataSource, TerraformHclModule, TerraformModule, TerraformResource, ITerraformDependable
Properties
Name | Type | Description |
---|---|---|
fqn | str | No description. |
fqn
Required
fqn: str
- Type: str
ITerraformIterator
- Implemented By: DynamicListTerraformIterator, ListTerraformIterator, MapTerraformIterator, ResourceTerraformIterator, TerraformIterator, ITerraformIterator
ITerraformResource
- Implemented By: DataResource, TerraformDataSource, TerraformResource, ITerraformResource
Methods
Name | Description |
---|---|
interpolation_for_attribute | No description. |
interpolation_for_attribute
def interpolation_for_attribute(
terraform_attribute: str
) - > IResolvable
terraform_attribute
Required
- Type: str
Properties
Name | Type | Description |
---|---|---|
fqn | str | No description. |
friendly_unique_id | str | No description. |
terraform_resource_type | str | No description. |
count | typing.Union[typing.Union[int, float], TerraformCount] | No description. |
depends_on | typing.List[str] | No description. |
for_each | ITerraformIterator | No description. |
lifecycle | TerraformResourceLifecycle | No description. |
provider | TerraformProvider | No description. |
fqn
Required
fqn: str
- Type: str
friendly_unique_id
Required
friendly_unique_id: str
- Type: str
terraform_resource_type
Required
terraform_resource_type: str
- Type: str
count
Optional
count: typing.Union[typing.Union[int, float], TerraformCount]
- Type: typing.Union[typing.Union[int, float], TerraformCount]
depends_on
Optional
depends_on: typing.List[str]
- Type: typing.List[str]
for_each
Optional
for_each: ITerraformIterator
- Type: ITerraformIterator
lifecycle
Optional
lifecycle: TerraformResourceLifecycle
provider
Optional
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 |
---|---|
map_token | Replace a single token. |
map_token
def map_token(
t: IResolvable
) - > typing.Any
Replace a single token.
t
Required
- Type: IResolvable
ITokenResolver
- Implemented By: DefaultTokenResolver, ITokenResolver
How to resolve tokens.
Methods
Name | Description |
---|---|
resolve_list | Resolve a tokenized list. |
resolve_map | Resolve a tokenized map. |
resolve_number_list | Resolve a tokenized number list. |
resolve_string | Resolve a string with at least one stringified token in it. |
resolve_token | Resolve a single token. |
resolve_list
def resolve_list(
l: typing.List[str],
context: IResolveContext
) - > typing.Any
Resolve a tokenized list.
l
Required
- Type: typing.List[str]
context
Required
- Type: IResolveContext
resolve_map
def resolve_map(
m: typing.Mapping[typing.Any],
context: IResolveContext
) - > typing.Any
Resolve a tokenized map.
m
Required
- Type: typing.Mapping[typing.Any]
context
Required
- Type: IResolveContext
resolve_number_list
def resolve_number_list(
l: typing.List[typing.Union[int, float]],
context: IResolveContext
) - > typing.Any
Resolve a tokenized number list.
l
Required
- Type: typing.List[typing.Union[int, float]]
context
Required
- Type: IResolveContext
resolve_string
def resolve_string(
s: TokenizedStringFragments,
context: IResolveContext
) - > typing.Any
Resolve a string with at least one stringified token in it.
(May use concatenation)
s
Required
- Type: TokenizedStringFragments
context
Required
- Type: IResolveContext
resolve_token
def resolve_token(
t: IResolvable,
context: IResolveContext,
post_processor: IPostProcessor
) - > typing.Any
Resolve a single token.
t
Required
- Type: IResolvable
context
Required
- Type: IResolveContext
post_processor
Required
- Type: IPostProcessor