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""" """Utility function to reuse code between tasks"""
for step in sort_stacks(cb, stacks): for step in sort_stacks(cb, stacks):
if step: 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: with ThreadPoolExecutor(max_workers=len(step)) as group:
futures = [] futures = []
for stack in step: for stack in step:

View File

@ -613,14 +613,14 @@ class Stack(object):
self.stackname, self.stackname,
output_file) 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(): for k in self.outputs.keys():
if hasattr( if hasattr(
self.outputs[k], self.outputs[k],
"secret") and self.outputs[k].secret: "secret") and self.outputs[k].secret:
self.outputs[k] = self.outputs[k].value self.outputs[k] = self.outputs[k].value
logger.info( logger.debug(
"{} {} Outputs:\n{}".format( "{} {} Outputs:\n{}".format(
self.region, self.region,
self.stackname, self.stackname,
@ -815,6 +815,7 @@ class Stack(object):
if self.mode == "pulumi": if self.mode == "pulumi":
kwargs = self._set_pulumi_args() kwargs = self._set_pulumi_args()
self._get_pulumi_stack(create=True).up(**kwargs) self._get_pulumi_stack(create=True).up(**kwargs)
status = "COMPLETE"
else: else:
# Prepare parameters # Prepare parameters
@ -846,6 +847,7 @@ class Stack(object):
) )
status = self._wait_for_completion() status = self._wait_for_completion()
self.get_outputs() self.get_outputs()
return status return status