
SoldierCoder
Engineering Elixir Applications: End of Chapter 2, github_issues_labels
All of Chapter 2 works fine until this last bit.
variable “issues” {
type = list(object({
title = string
body = string
labels = list(string)
milestone = string
}))
}
resource “github_issue” “tasks” {
count = length(var.issues)
repository = github_repository.kanban.name
title = var.issues[count.index].title
body = var.issues[count.index].body
milestone_number = github_repository_milestone.epics[var.issues[count.index].milestone].number
labels = [for l in var.issues[count.index].labels :
github_issue_label.issues_labels[l].name]
Error: Invalid index
│
│ on main.tf line 77, in resource “github_issue” “tasks”:
│ 77: github_issue_label.issues_labels[l].name]
│ ├────────────────
│ │ github_issue_label.issues_labels is object with 15 attributes
│
│ The given key does not identify an element in this collection value.
First Post!

elliefairholm
Hi @SoldierCoder could you share your whole main.tf and .auto.tfvars files? It looks like your having an issue when trying to access a specific “github_issue_label.issues_labels” resource. Rather than having many “issue_labels” in your state it seems that you only have one.
Popular Pragmatic topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /julia
- /slackware
- /c
- /neovim