feat: store outputs for Pulumi stacks

This commit is contained in:
Stefan Reimer 2023-12-04 16:24:55 +00:00
parent 6d3bf4767c
commit ff2de9d390
2 changed files with 13 additions and 26 deletions

View File

@ -444,21 +444,6 @@ def _provision(cb, stacks):
"""Utility function to reuse code between tasks"""
for step in sort_stacks(cb, stacks):
if step:
# Pulumi is not thread safe, so for now one by one
if _anyPulumi(step) and False:
for stack in step:
if stack.mode != "pulumi":
status = stack.get_status()
if not status:
stack.create()
else:
stack.update()
# Pulumi only needs "up"
else:
stack.create()
else:
with ThreadPoolExecutor(max_workers=len(step)) as group:
futures = []
for stack in step:

View File

@ -613,14 +613,14 @@ class Stack(object):
self.stackname,
output_file)
# If secrets replace with clear values for now, display ONLY
# If secrets replace with cleartext values for now, display ONLY
for k in self.outputs.keys():
if hasattr(
self.outputs[k],
"secret") and self.outputs[k].secret:
self.outputs[k] = self.outputs[k].value
logger.info(
logger.debug(
"{} {} Outputs:\n{}".format(
self.region,
self.stackname,
@ -815,6 +815,7 @@ class Stack(object):
if self.mode == "pulumi":
kwargs = self._set_pulumi_args()
self._get_pulumi_stack(create=True).up(**kwargs)
status = "COMPLETE"
else:
# Prepare parameters
@ -846,6 +847,7 @@ class Stack(object):
)
status = self._wait_for_completion()
self.get_outputs()
return status