My prefect flow has few tasks which are running terraform. Is there any way I can see the detailed log of the task getting executed.
for eg, when terraform runs, it displays the logs on console. is there any way i can see those logs?
in the prefect console, i see a very basic log which doesn't tell me what is going on inside the task
k
Kevin Kho
04/19/2022, 3:27 PM
Would you see logs if you just executed the Python code without Prefect? If so, you can add extra loggers to get logs. I just don’t know if terraofmr logs happen on the same process
s
Shuchita Tripathi
04/19/2022, 3:34 PM
ok. even when my terraform is failing, the task shows succeeded. is there any way to make the task fail if terraform fails
k
Kevin Kho
04/19/2022, 3:35 PM
Use a conditional and then:
Copy code
@task
def mytask(x):
if x == 5:
raise FAIL()
where FAIL is the Prefect signal. So you need to identify how to detect for failure
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.