This commit is contained in:
2024-10-21 00:10:33 +07:00
parent b3ad25ab10
commit 8a60b27d30
6 changed files with 403 additions and 0 deletions

22
m.py Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python
import pulumi.automation as auto
# ws = auto.LocalWorkspace(work_dir=".")
# all_stacks = ws.list_stacks()
# print([s.name for s in all_stacks])
project_name = 'p1'
stack_names = ['c1', 'c2', 'c3']
for s in stack_names:
stack = auto.create_or_select_stack(stack_name=s, project_name=project_name, work_dir=".")
stack.workspace.install_plugin("digitalocean", "4.33.0")
stack.set_config("foo", auto.ConfigValue(value=s))
stack.refresh(on_output=print)
stack.up(on_output=print)