Error: Invalid function argument, when using projects variable
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- terraform
- Domain
- cloud, infrastructure
Research direction
Inspect .terraform/modules/openstack/project.tf at line 15 and compare the variable defaults with the README example in main.hcl. Reproduce the error with blockstorage_quota and network_quota omitted; done when the documented projects configuration works without explicitly setting those values and the invalid lookup error no longer occurs.
Written by the indexing model from the issue text.
Description
Have to define blockstorage_quota and network_quota as ={} otherwise get error:
Error: Invalid function argument
│
│ on .terraform/modules/openstack/project.tf line 15, in resource "openstack_blockstorage_quotaset_v3" "project":
│ 15: volumes = lookup(each.value.blockstorage_quota, "volumes", null)
│ ├────────────────
│ │ while calling lookup(inputMap, key, default...)
│ │ each.value.blockstorage_quota is null
│
│ Invalid value for "inputMap" parameter: argument must not be null.
Config that currently works (based on example in README):
# main.hcl:
module "openstack" {
# The version here should be changed to the current release:
source = "github.com/stackhpc/tofu-openstack-config?ref=main"
projects = {
test = {
description = "test project"
compute_quota = {
instances = 20
cores = 200
ram = 512000
}
blockstorage_quota = {}
network_quota = {}
}
}
}
- Dominant language
- HCL
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
bug needs-triage service/elbv2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
hashicorp/terraform-provider-aws#50100 · 1 comment ·