Linked Questions

Popular Questions

I'm already using cdktf for python to make my provider & resources configuration, I can also deploy via cdktf cli tool with cdkft deploy and it works well, but i need to make an deploy or detroy via python script python, how can I achive this?


from constructs import Construct
from cdktf import App, TerraformStack
from imports.proxmox.provider import ProxmoxProvider
from imports.proxmox.lxc import Lxc
from imports.proxmox.vm_qemu import VmQemu

class MyStack(TerraformStack):
    def __init__(self, scope: Construct, id: str):
        super().__init__(scope, id)

        ProxmoxProvider( self, id="proxmox",

        Lxc(self, id_="test",

app = App()
MyStack(app, "terraform_test")

The only option I can think is to execute the commands via os module like this:

import os
os.system('cdktf deploy')

But I don't know if it's the best approach

Related Questions