Has anyone created a custom CLI in Python using th...
# python
c
Has anyone created a custom CLI in Python using the Automation API?
s
This is a simplified version of what works for me
Copy code
from pulumi.automation import ProjectSettings, LocalWorkspace, Stack

settings = ProjectSettings(
    name="my_project",
    backend={"url": "<s3://my-bucket>"},
    runtime={"name": "python"},
    description="description: A minimal AWS Python Pulumi program extra",
)

ws = LocalWorkspace(
    work_dir="/app/pulumi",
    project_settings=settings,
)

ws.install_plugin("gcp", "7.1.1")

stack = Stack.create(stack_name="my_stack", workspace=ws)

stack.set_config("gcp:region", "some-region")

stack.up(log_verbosity=4, diff=True, log_flow=True)