Skip to content

Instantly share code, notes, and snippets.

@cosminnicula
Created January 3, 2023 07:42
Show Gist options
  • Select an option

  • Save cosminnicula/e32ccabed695fb646aefa2cb6e1609c8 to your computer and use it in GitHub Desktop.

Select an option

Save cosminnicula/e32ccabed695fb646aefa2cb6e1609c8 to your computer and use it in GitHub Desktop.
CDKTF Using Iterators on Complex Types error
[2023-01-03T08:54:34.404] [ERROR] default - ╷
│ Error: Invalid for_each set argument
│ on cdk.tf.json line 36, in module.s3-bucket:
│ 36: "for_each": "${toset(local.my-list)}",
│ ├────────────────
│ │ local.my-list is tuple with 2 elements
│ The given "for_each" argument value is unsuitable: "for_each" supports maps
basic-ec2-stack ╷
│ Error: Invalid for_each set argument
│ on cdk.tf.json line 36, in module.s3-bucket:
│ 36: "for_each": "${toset(local.my-list)}",
│ ├────────────────
│ │ local.my-list is tuple with 2 elements
│ The given "for_each" argument value is unsuitable: "for_each" supports maps
│ and sets of strings, but you have provided a set containing type object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment