Terraform
Python: Classes
Annotations
Includes API for attaching annotations such as warning messages to constructs.
Methods
Name | Description |
---|---|
add_error | Adds an { "error": < message > } metadata entry to this construct. |
add_info | Adds an info metadata entry to this construct. |
add_warning | Adds a warning metadata entry to this construct. |
add_error
def add_error(
message: str
) - > None
Adds an { "error": < message > } metadata entry to this construct.
The toolkit will fail synthesis when errors are reported.
message
Required
- Type: str
The error message.
add_info
def add_info(
message: str
) - > None
Adds an info metadata entry to this construct.
The CLI will display the info message when apps are synthesized.
message
Required
- Type: str
The info message.
add_warning
def add_warning(
message: str
) - > None
Adds a warning metadata entry to this construct.
The CLI will display the warning when an app is synthesized. In a future release the CLI might introduce a --strict flag which will then fail the synthesis if it encounters a warning.
message
Required
- Type: str
The warning message.
Static Functions
Name | Description |
---|---|
of | Returns the annotations API for a construct scope. |
of
import cdktf
cdktf.Annotations.of(
scope: IConstruct
)
Returns the annotations API for a construct scope.
scope
Required
- Type: constructs.IConstruct
The scope.
AnyListList
Initializers
import cdktf
cdktf.AnyListList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
all_with_map_key | Creating an iterator for this complex list. |
compute_fqn | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
all_with_map_key
def all_with_map_key(
map_key_attribute_name: str
) - > DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
map_key_attribute_name
Required
- Type: str
compute_fqn
def compute_fqn() - > str
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.
get
def get(
index: typing.Union[int, float]
) - > IResolvable
index
Required
- Type: typing.Union[int, float]
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
AnyListMap
Initializers
import cdktf
cdktf.AnyListMap(
terraform_resource: IInterpolatingParent,
terraform_attribute: str
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
Methods
Name | Description |
---|---|
compute_fqn | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
compute_fqn
def compute_fqn() - > str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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.
get
def get(
key: str
) - > IResolvable
key
Required
- Type: str
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
AnyMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import cdktf
cdktf.AnyMap(
terraform_resource: IInterpolatingParent,
terraform_attribute: str
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
Methods
Name | Description |
---|---|
compute_fqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
compute_fqn
def compute_fqn() - > str
lookup
def lookup(
key: str
) - > typing.Any
key
Required
- Type: str
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. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
AnyMapList
Initializers
import cdktf
cdktf.AnyMapList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
compute_fqn | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
compute_fqn
def compute_fqn() - > str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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.
get
def get(
index: typing.Union[int, float]
) - > AnyMap
index
Required
- Type: typing.Union[int, float]
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
Aspects
Aspects can be applied to CDK tree scopes and can operate on the tree before synthesis.
Methods
Name | Description |
---|---|
add | Adds an aspect to apply this scope before synthesis. |
add
def add(
aspect: IAspect
) - > None
Adds an aspect to apply this scope before synthesis.
aspect
Required
- Type: IAspect
The aspect to add.
Static Functions
Name | Description |
---|---|
of | Returns the Aspects object associated with a construct scope. |
of
import cdktf
cdktf.Aspects.of(
scope: IConstruct
)
Returns the Aspects
object associated with a construct scope.
scope
Required
- Type: constructs.IConstruct
The scope for which these aspects will apply.
Properties
Name | Type | Description |
---|---|---|
all | typing.List[IAspect] | The list of aspects which were directly applied on this scope. |
all
Required
all: typing.List[IAspect]
- Type: typing.List[IAspect]
The list of aspects which were directly applied on this scope.
AssertionReturn
Class representing the contents of a return by an assertion.
Initializers
from cdktf import testing_matchers
testingMatchers.AssertionReturn(
message: str,
pass: bool
)
Name | Type | Description |
---|---|---|
message | str | - String message containing information about the result of the assertion. |
pass | bool | - Boolean pass denoting the success of the assertion. |
message
Required
- Type: str
String message containing information about the result of the assertion.
pass
Required
- Type: bool
Boolean pass denoting the success of the assertion.
Properties
Name | Type | Description |
---|---|---|
message | str | - String message containing information about the result of the assertion. |
pass | bool | - Boolean pass denoting the success of the assertion. |
message
Required
message: str
- Type: str
String message containing information about the result of the assertion.
pass
Required
pass: bool
- Type: bool
Boolean pass denoting the success of the assertion.
BooleanList
Initializers
import cdktf
cdktf.BooleanList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
all_with_map_key | Creating an iterator for this complex list. |
compute_fqn | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
all_with_map_key
def all_with_map_key(
map_key_attribute_name: str
) - > DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
map_key_attribute_name
Required
- Type: str
compute_fqn
def compute_fqn() - > str
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.
get
def get(
index: typing.Union[int, float]
) - > IResolvable
index
Required
- Type: typing.Union[int, float]
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
BooleanListList
Initializers
import cdktf
cdktf.BooleanListList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
all_with_map_key | Creating an iterator for this complex list. |
compute_fqn | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
all_with_map_key
def all_with_map_key(
map_key_attribute_name: str
) - > DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
map_key_attribute_name
Required
- Type: str
compute_fqn
def compute_fqn() - > str
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.
get
def get(
index: typing.Union[int, float]
) - > IResolvable
index
Required
- Type: typing.Union[int, float]
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
BooleanListMap
Initializers
import cdktf
cdktf.BooleanListMap(
terraform_resource: IInterpolatingParent,
terraform_attribute: str
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
Methods
Name | Description |
---|---|
compute_fqn | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
compute_fqn
def compute_fqn() - > str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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.
get
def get(
key: str
) - > IResolvable
key
Required
- Type: str
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
BooleanMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import cdktf
cdktf.BooleanMap(
terraform_resource: IInterpolatingParent,
terraform_attribute: str
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
Methods
Name | Description |
---|---|
compute_fqn | No description. |
lookup | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
compute_fqn
def compute_fqn() - > str
lookup
def lookup(
key: str
) - > IResolvable
key
Required
- Type: str
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. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
BooleanMapList
Initializers
import cdktf
cdktf.BooleanMapList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
compute_fqn | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
get | No description. |
compute_fqn
def compute_fqn() - > str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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.
get
def get(
index: typing.Union[int, float]
) - > BooleanMap
index
Required
- Type: typing.Union[int, float]
Properties
Name | Type | Description |
---|---|---|
creation_stack | typing.List[str] | The creation stack of this resolvable which will be appended to errors thrown during resolution. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
CloudWorkspace
A cloud workspace can either be a single named workspace, or a list of tagged workspaces.
Initializers
import cdktf
cdktf.CloudWorkspace()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
to_terraform | No description. |
to_terraform
def to_terraform() - > typing.Any
ComplexComputedList
- Implements: IInterpolatingParent, IResolvable, ITerraformAddressable
Initializers
import cdktf
cdktf.ComplexComputedList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
complex_computed_list_index: str,
wraps_set: bool = None
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
complex_computed_list_index | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
complex_computed_list_index
Required
- Type: str
wraps_set
Optional
- Type: bool
Methods
Name | Description |
---|---|
compute_fqn | No description. |
get_any_map_attribute | No description. |
get_boolean_attribute | No description. |
get_boolean_map_attribute | No description. |
get_list_attribute | No description. |
get_number_attribute | No description. |
get_number_list_attribute | No description. |
get_number_map_attribute | No description. |
get_string_attribute | No description. |
get_string_map_attribute | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
compute_fqn
compute_fqn
def compute_fqn() - > str
get_any_map_attribute
get_any_map_attribute
def get_any_map_attribute(
terraform_attribute: str
) - > typing.Mapping[typing.Any]
terraform_attribute
Required
- Type: str
get_boolean_attribute
get_boolean_attribute
def get_boolean_attribute(
terraform_attribute: str
) - > IResolvable
terraform_attribute
Required
- Type: str
get_boolean_map_attribute
get_boolean_map_attribute
def get_boolean_map_attribute(
terraform_attribute: str
) - > typing.Mapping[bool]
terraform_attribute
Required
- Type: str
get_list_attribute
get_list_attribute
def get_list_attribute(
terraform_attribute: str
) - > typing.List[str]
terraform_attribute
Required
- Type: str
get_number_attribute
get_number_attribute
def get_number_attribute(
terraform_attribute: str
) - > typing.Union[int, float]
terraform_attribute
Required
- Type: str
get_number_list_attribute
get_number_list_attribute
def get_number_list_attribute(
terraform_attribute: str
) - > typing.List[typing.Union[int, float]]
terraform_attribute
Required
- Type: str
get_number_map_attribute
get_number_map_attribute
def get_number_map_attribute(
terraform_attribute: str
) - > typing.Mapping[typing.Union[int, float]]
terraform_attribute
Required
- Type: str
get_string_attribute
get_string_attribute
def get_string_attribute(
terraform_attribute: str
) - > str
terraform_attribute
Required
- Type: str
get_string_map_attribute
get_string_map_attribute
def get_string_map_attribute(
terraform_attribute: str
) - > typing.Mapping[str]
terraform_attribute
Required
- Type: str
interpolation_for_attribute
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
resolve
resolve
def resolve(
_context: IResolveContext
) - > typing.Any
Produce the Token's value at resolution time.
_context
Required
- Type: IResolveContext
to_string
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. |
fqn | str | No description. |
creation_stack
Required
creation_stack
- Deprecated: Going to be replaced by Array of ComplexListItem and will be removed in the future
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.
fqn
Required
fqn
- Deprecated: Going to be replaced by Array of ComplexListItem and will be removed in the future
fqn: str
- Type: str
ComplexList
- Implements: ITerraformAddressable, IResolvable
Initializers
import cdktf
cdktf.ComplexList(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
wraps_set: bool
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
wraps_set | bool | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
wraps_set
Required
- Type: bool
Methods
Name | Description |
---|---|
all_with_map_key | Creating an iterator for this complex list. |
compute_fqn | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
all_with_map_key
def all_with_map_key(
map_key_attribute_name: str
) - > DynamicListTerraformIterator
Creating an iterator for this complex list.
The list will be converted into a map with the mapKeyAttributeName as the key.
map_key_attribute_name
Required
- Type: str
compute_fqn
def compute_fqn() - > str
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. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
ComplexMap
- Implements: ITerraformAddressable, IResolvable
Initializers
import cdktf
cdktf.ComplexMap(
terraform_resource: IInterpolatingParent,
terraform_attribute: str
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
Methods
Name | Description |
---|---|
compute_fqn | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
compute_fqn
def compute_fqn() - > str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
ComplexObject
- Implements: IInterpolatingParent, IResolvable, ITerraformAddressable
Initializers
import cdktf
cdktf.ComplexObject(
terraform_resource: IInterpolatingParent,
terraform_attribute: str,
complex_object_is_from_set: bool,
complex_object_index: typing.Union[str, typing.Union[int, float]] = None
)
Name | Type | Description |
---|---|---|
terraform_resource | IInterpolatingParent | No description. |
terraform_attribute | str | No description. |
complex_object_is_from_set | bool | set to true if this item is from inside a set and needs tolist() for accessing it set to "0" for single list items. |
complex_object_index | typing.Union[str, typing.Union[int, float]] | the index of the complex object in a list. |
terraform_resource
Required
- Type: IInterpolatingParent
terraform_attribute
Required
- Type: str
complex_object_is_from_set
Required
- Type: bool
set to true if this item is from inside a set and needs tolist() for accessing it set to "0" for single list items.
complex_object_index
Optional
- Type: typing.Union[str, typing.Union[int, float]]
the index of the complex object in a list.
Methods
Name | Description |
---|---|
compute_fqn | No description. |
get_any_map_attribute | No description. |
get_boolean_attribute | No description. |
get_boolean_map_attribute | No description. |
get_list_attribute | No description. |
get_number_attribute | No description. |
get_number_list_attribute | No description. |
get_number_map_attribute | No description. |
get_string_attribute | No description. |
get_string_map_attribute | No description. |
interpolation_for_attribute | No description. |
resolve | Produce the Token's value at resolution time. |
to_string | Return a string representation of this resolvable object. |
compute_fqn
def compute_fqn() - > str
get_any_map_attribute
def get_any_map_attribute(
terraform_attribute: str
) - > typing.Mapping[typing.Any]
terraform_attribute
Required
- Type: str
get_boolean_attribute
def get_boolean_attribute(
terraform_attribute: str
) - > IResolvable
terraform_attribute
Required
- Type: str
get_boolean_map_attribute
def get_boolean_map_attribute(
terraform_attribute: str
) - > typing.Mapping[bool]
terraform_attribute
Required
- Type: str
get_list_attribute
def get_list_attribute(
terraform_attribute: str
) - > typing.List[str]
terraform_attribute
Required
- Type: str
get_number_attribute
def get_number_attribute(
terraform_attribute: str
) - > typing.Union[int, float]
terraform_attribute
Required
- Type: str
get_number_list_attribute
def get_number_list_attribute(
terraform_attribute: str
) - > typing.List[typing.Union[int, float]]
terraform_attribute
Required
- Type: str
get_number_map_attribute
def get_number_map_attribute(
terraform_attribute: str
) - > typing.Mapping[typing.Union[int, float]]
terraform_attribute
Required
- Type: str
get_string_attribute
def get_string_attribute(
terraform_attribute: str
) - > str
terraform_attribute
Required
- Type: str
get_string_map_attribute
def get_string_map_attribute(
terraform_attribute: str
) - > typing.Mapping[str]
terraform_attribute
Required
- Type: str
interpolation_for_attribute
def interpolation_for_attribute(
property: str
) - > IResolvable
property
Required
- Type: str
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. |
fqn | str | No description. |
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.
fqn
Required
fqn: str
- Type: str
DefaultTokenResolver
- Implements: ITokenResolver
Default resolver implementation.
Initializers
import cdktf
cdktf.DefaultTokenResolver(
concat: IFragmentConcatenator
)
Name | Type | Description |
---|---|---|
concat | IFragmentConcatenator | No description. |
concat
Required
- Type: IFragmentConcatenator
Methods
Name | Description |
---|---|
resolve_list | Resolves a list of string. |
resolve_map | Resolves a map token. |
resolve_number_list | Resolves a list of numbers. |
resolve_string | Resolve string fragments to Tokens. |
resolve_token | Default Token resolution. |
resolve_list
def resolve_list(
xs: typing.List[str],
context: IResolveContext
) - > typing.Any
Resolves a list of string.
xs
Required
- Type: typing.List[str]
context
Required
- Type: IResolveContext
resolve_map
def resolve_map(
xs: typing.Mapping[typing.Any],
context: IResolveContext
) - > typing.Any
Resolves a map token.
xs
Required
- Type: typing.Mapping[typing.Any]
context
Required
- Type: IResolveContext
resolve_number_list
def resolve_number_list(
xs: typing.List[typing.Union[int, float]],
context: IResolveContext
) - > typing.Any
Resolves a list of numbers.
xs
Required
- Type: typing.List[typing.Union[int, float]]
context
Required
- Type: IResolveContext
resolve_string
def resolve_string(
fragments: TokenizedStringFragments,
context: IResolveContext
) - > typing.Any
Resolve string fragments to Tokens.
fragments
Required
- Type: TokenizedStringFragments
context
Required
- Type: IResolveContext
resolve_token
def resolve_token(
t: IResolvable,
context: IResolveContext,
post_processor: IPostProcessor
) - > typing.Any
Default Token resolution.
Resolve the Token, recurse into whatever it returns, then finally post-process it.
t
Required
- Type: IResolvable
context
Required
- Type: IResolveContext
post_processor
Required
- Type: IPostProcessor
DynamicListTerraformIterator
Initializers
import cdktf
cdktf.DynamicListTerraformIterator(
list: typing.Union[typing.List[str], IResolvable, typing.List[typing.Union[int, float]], typing.List[typing.Union[bool, IResolvable]]],
map_key_attribute_name: str
)
Name | Type | Description |
---|---|---|
list | typing.Union[typing.List[str], IResolvable, typing.List[typing.Union[int, float]], typing.List[typing.Union[bool, IResolvable]]] | No description. |
map_key_attribute_name | str | No description. |
list
Required
- Type: typing.Union[typing.List[str], IResolvable, typing.List[typing.Union[int, float]], typing.List[typing.Union[bool, IResolvable]]]
map_key_attribute_name
Required
- Type: str
Methods
Name | Description |
---|---|
dynamic | Creates a dynamic expression that can be used to loop over this iterator in a dynamic block. |
for_expression_for_list | Creates a for expression that results in a list. |
for_expression_for_map | Creates a for expression that results in a map. |
get_any | No description. |
get_any_map | No description. |
get_boolean | No description. |
get_boolean_map | No description. |
get_list | No description. |
get_map | No description. |
get_number | No description. |
get_number_list | No description. |
get_number_map | No description. |
get_string | No description. |
get_string_map | No description. |
keys | Creates a for expression that maps the iterators to its keys. |
pluck_property | Creates a for expression that accesses the key on each element of the iterator. |
values | Creates a for expression that maps the iterators to its value in case it is a map. |
dynamic
def dynamic(
attributes: typing.Mapping[typing.Any]
) - > IResolvable
Creates a dynamic expression that can be used to loop over this iterator in a dynamic block.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
See https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-for-list-attributes
attributes
Required
- Type: typing.Mapping[typing.Any]
for_expression_for_list
def for_expression_for_list(
expression: typing.Union[str, IResolvable]
) - > IResolvable
Creates a for expression that results in a list.
This method allows you to create every possible for expression, but requires more knowledge about Terraform's for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty() instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromList(myIteratorSourceVar).forExpressionForList("val.foo if val.bar == true")
will result in [ for key, val in var.myIteratorSource: val.foo if val.bar == true ]
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
expression
Required
- Type: typing.Union[str, IResolvable]
The expression to use in the for mapping.
for_expression_for_map
def for_expression_for_map(
key_expression: typing.Union[str, IResolvable],
value_expression: typing.Union[str, IResolvable]
) - > IResolvable
Creates a for expression that results in a map.
This method allows you to create every possible for expression, but requires more knowledge about Terraforms for expression syntax. For the most common use cases you can use keys(), values(), and pluckProperty instead.
You may write any valid Terraform for each expression, e.g.
TerraformIterator.fromMap(myIteratorSourceVar).forExpressionForMap("key", "val.foo if val.bar == true")
will result in { for key, val in var.myIteratorSource: key = > val.foo if val.bar == true }
.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
key_expression
Required
- Type: typing.Union[str, IResolvable]
The expression to use as key in the for mapping.
value_expression
Required
- Type: typing.Union[str, IResolvable]
The expression to use as value in the for mapping.
get_any
def get_any(
attribute: str
) - > IResolvable
attribute
Required
- Type: str
name of the property to retrieve.
get_any_map
def get_any_map(
attribute: str
) - > typing.Mapping[typing.Any]
attribute
Required
- Type: str
name of the property to retrieve.
get_boolean
def get_boolean(
attribute: str
) - > IResolvable
attribute
Required
- Type: str
name of the property to retrieve.
get_boolean_map
def get_boolean_map(
attribute: str
) - > typing.Mapping[bool]
attribute
Required
- Type: str
name of the property to retrieve.
get_list
def get_list(
attribute: str
) - > typing.List[str]
attribute
Required
- Type: str
name of the property to retrieve.
get_map
def get_map(
attribute: str
) - > typing.Mapping[typing.Any]
attribute
Required
- Type: str
name of the property to retrieve.
get_number
def get_number(
attribute: str
) - > typing.Union[int, float]
attribute
Required
- Type: str
name of the property to retrieve.
get_number_list
def get_number_list(
attribute: str
) - > typing.List[typing.Union[int, float]]
attribute
Required
- Type: str
name of the property to retrieve.
get_number_map
def get_number_map(
attribute: str
) - > typing.Mapping[typing.Union[int, float]]
attribute
Required
- Type: str
name of the property to retrieve.
get_string
def get_string(
attribute: str
) - > str
attribute
Required
- Type: str
name of the property to retrieve.
get_string_map
def get_string_map(
attribute: str
) - > typing.Mapping[str]
attribute
Required
- Type: str
name of the property to retrieve.
keys
def keys() - > IResolvable
Creates a for expression that maps the iterators to its keys.
For lists these would be the indices, for maps the keys.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
pluck_property
def pluck_property(
property: str
) - > IResolvable
Creates a for expression that accesses the key on each element of the iterator.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
property
Required
- Type: str
The property of the iterators values to map to.
values
def values() - > IResolvable
Creates a for expression that maps the iterators to its value in case it is a map.
For lists these would stay the same.
As this returns an IResolvable you might need to wrap the output in
a Token, e.g. Token.asString
.
Static Functions
Name | Description |
---|---|
from_complex_list | Creates a new iterator from a complex list. |
from_data_sources | Creates a new iterator from a data source that has been created with the for_each argument. |
from_list | Creates a new iterator from a list. |
from_map | Creates a new iterator from a map. |
from_resources | Creates a new iterator from a resource that has been created with the for_each argument. |
from_complex_list
import cdktf
cdktf.DynamicListTerraformIterator.from_complex_list(
list: typing.Union[IResolvable, ComplexList, StringMapList, NumberMapList, BooleanMapList, AnyMapList],
map_key_attribute_name: str
)
Creates a new iterator from a complex list.
One example for this would be a list of maps. The list will be converted into a map with the mapKeyAttributeName as the key.
Example
# Example automatically generated from non-compiling source. May contain errors.
cert = AcmCertificate(self, "cert",
domain_name="example.com",
validation_method="DNS"
)
dvo_iterator = TerraformIterator.from_complex_list(cert.domain_validation_options, "domain_name")
Route53Record(self, "record",
allow_overwrite=True,
name=dvo_iterator.get_string("name"),
records=[dvo_iterator.get_string("record")],
ttl=60,
type=dvo_iterator.get_string("type"),
zone_id=Token.as_string(data_aws_route53_zone_example.zone_id),
for_each=dvo_iterator
)
list
Required
- Type: typing.Union[IResolvable, ComplexList, StringMapList, NumberMapList, BooleanMapList, AnyMapList]
the list to iterate over.
map_key_attribute_name
Required
- Type: str
the name of the attribute that should be used as the key in the map.
Visit https://developer.hashicorp.com/terraform/cdktf/concepts/iterators#using-iterators-on-complex-lists for more information.
from_data_sources
import cdktf
cdktf.DynamicListTerraformIterator.from_data_sources(
resource: ITerraformResource
)
Creates a new iterator from a data source that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
from_list
import cdktf
cdktf.DynamicListTerraformIterator.from_list(
list: typing.Union[typing.List[str], IResolvable, typing.List[typing.Union[int, float]], typing.List[typing.Union[bool, IResolvable]]]
)
Creates a new iterator from a list.
list
Required
- Type: typing.Union[typing.List[str], IResolvable, typing.List[typing.Union[int, float]], typing.List[typing.Union[bool, IResolvable]]]
from_map
import cdktf
cdktf.DynamicListTerraformIterator.from_map(
map: typing.Union[ComplexMap, typing.Mapping[typing.Any], typing.Mapping[str], typing.Mapping[typing.Union[int, float]], typing.Mapping[bool]]
)
Creates a new iterator from a map.
map
Required
- Type: typing.Union[ComplexMap, typing.Mapping[typing.Any], typing.Mapping[str], typing.Mapping[typing.Union[int, float]], typing.Mapping[bool]]
from_resources
import cdktf
cdktf.DynamicListTerraformIterator.from_resources(
resource: ITerraformResource
)
Creates a new iterator from a resource that has been created with the for_each
argument.
resource
Required
- Type: ITerraformResource
Properties
Name | Type | Description |
---|---|---|
key | str | Returns the key of the current entry in the map that is being iterated over. |
value | typing.Any | Returns the value of the current item iterated over. |
key
Required
key: str
- Type: str
Returns the key of the current entry in the map that is being iterated over.
value
Required
value: typing.Any
- Type: typing.Any
Returns the value of the current item iterated over.
Fn
Initializers
import cdktf
cdktf.Fn()
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
abs | {@link https://developer.hashicorp.com/terraform/language/functions/abs abs} returns the absolute value of the given number. In other words, if the number is zero or positive then it is returned as-is, but if it is negative then it is multiplied by -1 to make it positive before returning it. |
abspath | {@link https://developer.hashicorp.com/terraform/language/functions/abspath abspath} takes a string containing a filesystem path and converts it to an absolute path. That is, if the path is not absolute, it will be joined with the current working directory. |
alltrue | {@link https://developer.hashicorp.com/terraform/language/functions/alltrue alltrue} returns true if all elements in a given collection are true or "true" . It also returns true if the collection is empty. |
anytrue | {@link https://developer.hashicorp.com/terraform/language/functions/anytrue anytrue} returns true if any element in a given collection is true or "true" . It also returns false if the collection is empty. |
base64decode | {@link https://developer.hashicorp.com/terraform/language/functions/base64decode base64decode} takes a string containing a Base64 character sequence and returns the original string. |
base64encode | {@link https://developer.hashicorp.com/terraform/language/functions/base64encode base64encode} applies Base64 encoding to a string. |
base64gzip | {@link https://developer.hashicorp.com/terraform/language/functions/base64gzip base64gzip} compresses a string with gzip and then encodes the result in Base64 encoding. |
base64sha256 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha256 base64sha256} computes the SHA256 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha256("test")) since sha256() returns hexadecimal representation. |
base64sha512 | {@link https://developer.hashicorp.com/terraform/language/functions/base64sha512 base64sha512} computes the SHA512 hash of a given string and encodes it with Base64. This is not equivalent to base64encode(sha512("test")) since sha512() returns hexadecimal representation. |
basename | {@link https://developer.hashicorp.com/terraform/language/functions/basename basename} takes a string containing a filesystem path and removes all except the last portion from it. |
can | {@link https://developer.hashicorp.com/terraform/language/functions/can can} evaluates the given expression and returns a boolean value indicating whether the expression produced a result without any errors. |
ceil | {@link https://developer.hashicorp.com/terraform/language/functions/ceil ceil} returns the closest whole number that is greater than or equal to the given value, which may be a fraction. |
chomp | {@link https://developer.hashicorp.com/terraform/language/functions/chomp chomp} removes newline characters at the end of a string. |
chunklist | {@link https://developer.hashicorp.com/terraform/language/functions/chunklist chunklist} splits a single list into fixed-size chunks, returning a list of lists. |
cidrhost | {@link https://developer.hashicorp.com/terraform/language/functions/cidrhost cidrhost} calculates a full host IP address for a given host number within a given IP network address prefix. |
cidrnetmask | {@link https://developer.hashicorp.com/terraform/language/functions/cidrnetmask cidrnetmask} converts an IPv4 address prefix given in CIDR notation into a subnet mask address. |
cidrsubnet | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnet cidrsubnet} calculates a subnet address within given IP network address prefix. |
cidrsubnets | {@link https://developer.hashicorp.com/terraform/language/functions/cidrsubnets cidrsubnets} calculates a sequence of consecutive IP address ranges within a particular CIDR prefix. |
coalesce | {@link https://developer.hashicorp.com/terraform/language/functions/coalesce coalesce} takes any number of arguments and returns t |