CDKTF Iterator Custom Constructs


I am trying to iterate over a custom construct to create multiple resources.

I have a construct to create a Terraform Cloud Workspace.

import { Workspace } from "@cdktf/provider-tfe/lib/workspace";
import { TerraformMetaArguments, TerraformOutput } from "cdktf";
import { Construct } from "constructs";

export interface WorkspaceParams extends TerraformMetaArguments{
    name: string;
    tags: string[];
    organization: string;
    autoApply: boolean;
    description: string;
export class CustomWorkspace extends Construct{
    _params: WorkspaceParams;
    public workspace!: Workspace;
    constructor(scope: Construct, name: string, params: WorkspaceParams) {
        super(scope, name)
        this._params = params;

    _setup = () => {
        this.workspace = new Workspace(this,  `metronet-workspace`, {
            description: this._params.description,
            tagNames: this._params.tags,
            autoApply: this._params.autoApply

    _outputs = () => {
        new TerraformOutput(this, `workspace-id`, {

And then in my stack I am trying to use an iterator so I can create multiple workspaces based on an Input Variable of Complex List.

        this._workspaces = new TerraformVariable(this, "workspaces", {
            type: VariableType.list(VariableType.object({
                name: VariableType.STRING,
                description: VariableType.STRING,
                tags: VariableType.LIST_STRING,
            description: "List of Workspaces"

        new CustomWorkspace(this,  `${this._name}-workspace`, {
            forEach: iterator,
            name: iterator.getString("name"),
            description: iterator.getString("description"),
            autoApply: true,
            organization: this._orgName.stringValue,
            tags: iterator.getList("tags"),

But I get the error on plan,

I was thinking I need to use iterator.dynamic but thats also giving the same error.

Let me know if anyone has gone through the same problem.

I was following this link for the custom construct. Constructs - CDK for Terraform | Terraform | HashiCorp Developer

You may be able to forward the forEach arguement to the Workspace creation inside your construct, but I suspect you may still run into issues.
The iterator support relies on having a context to know how to correctly synthesis into HCL JSON which may very well get lost when used like this.

If at all possible, moving a way from a TerraformVariable and just using json or other configuration format that is read in would allow you to write a simple for loop.