Skip to content

Conditional import statement #2286

Answered by janorn
janorn asked this question in Q&A
Dec 12, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Sure but this workaround worked:

import {
  for_each = var.import_resource  # Ignore key
  to       = resource.network
  id       = each.value
}

With this as input:

inputs = {
  import_resource = {
    key = var.net_id
  }
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@janorn
Comment options

@abstractionfactory
Comment options

@janorn
Comment options

Answer selected by janorn
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants