stackhpc / stackhpc/tofu-openstack-config
Error: Invalid function argument, when using projects variable
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- HCL
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
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 = {}
}
}
}
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.
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.
Assessment
- Tech stack
- terraform
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 70/100