Conditional execution in terraform

I have boolean value var.calico_enabled set and inside network config block I have:
cni_config {
here I would like to have calico_config set only if it’s enabled
}

Setup should be like:
calico_config {
ip_pool_config {}
}