Skip to content

Commit

Permalink
f: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjjung committed Dec 17, 2024
1 parent 3f8cc6d commit ba2fb90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions tb_pulumi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def env_var_is_true(name: str) -> bool:
return env_var_matches(name, ['t', 'true', 'yes'], False)


def flatten(item: dict | list | ThunderbirdComponentResource | pulumi.Resource) -> set[pulumi.Resource]:
def flatten(item: dict | list | ThunderbirdComponentResource | pulumi.Output | pulumi.Resource) -> set[pulumi.Resource]:
"""Recursively traverses a nested collection of Pulumi ``Resource`` s, converting them into a flat set which can be
more easily iterated over.
Expand All @@ -245,16 +245,18 @@ def flatten(item: dict | list | ThunderbirdComponentResource | pulumi.Resource)
flattened = []
to_flatten = None
if type(item) is list:
pulumi.info(f'FOUND LIST: {item}')
# pulumi.info(f'FOUND LIST: {item}')
to_flatten = item
elif type(item) is dict:
pulumi.info(f'FOUND DICT: {item}')
# pulumi.info(f'FOUND DICT: {item}')
to_flatten = item.values()
elif isinstance(item, ThunderbirdComponentResource):
pulumi.info(f'FOUND TCR: {item._name} -> {item.resources.values()}')
# pulumi.info(f'FOUND TCR: {item._name} -> {item.resources.values()}')
to_flatten = item.resources.values()
elif isinstance(item, pulumi.Output):
pulumi.info(f'FOUND OUTPUT: {item._name}')
elif isinstance(item, pulumi.Resource):
pulumi.info(f'FOUND RESOURCE: {item._name}, {str(item.__class__)}')
# pulumi.info(f'FOUND RESOURCE: {item._name}, {str(item.__class__)}')
return [item]
else:
pass
Expand Down
1 change: 0 additions & 1 deletion tb_pulumi/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def __init__(
opts=pulumi.ResourceOptions(parent=self, depends_on=[security_group_with_rules.resources['sg']]),
**kwargs,
)
pulumi.info(f'NLB NAME: {nlb.name}')

# Build and attach a target group
target_group = aws.lb.TargetGroup(
Expand Down

0 comments on commit ba2fb90

Please sign in to comment.