fix: nested-attribute HCL syntax in examples and acceptance tests - #23
Merged
Conversation
…s and tests
Live validation against the CE lab surfaced that several examples and
acceptance-test configs used block syntax for attributes that the framework
schema defines as nested *attributes*, which Terraform rejects at plan time
with "Blocks of type X are not expected here. Did you mean to define argument
X?".
- keymanager_container `secret_refs` (SetNestedAttribute): example + acc test
→ `secret_refs = [{ ... }]`
- networking port `fixed_ip` (ListNestedAttribute): floatingip_associate
example + port / floatingip / floatingip_associate / data-sources-extras acc
tests → `fixed_ip = [{ ... }]`
The key-manager acceptance test now passes live against the lab. Audited every
other Nested*Attribute (allocation_pools, allowed_address_pairs, dpd, lifetime,
persistence, consumers, roles) — the rest already use attribute syntax or have
no HCL usage.
PF9-pushkar
added a commit
that referenced
this pull request
Jul 14, 2026
fix: nested-attribute HCL syntax in examples and acceptance tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Found during Phase 1 live validation against the CE lab: several examples and acceptance-test configs used HCL block syntax (
x { ... }) for attributes the provider schema defines as nested attributes (SetNestedAttribute/ListNestedAttribute). Terraform rejects that at plan time:These were latent because the affected families had never been run live (the acc tests self-skip without lab credentials, and the network-dependent ones are blocked by a separate lab gap).
Fixes
examples/.../pcd_keymanager_container+keymanager_test.gosecret_refs(SetNestedAttribute)secret_refs { }→secret_refs = [{ }]examples/.../pcd_networking_floatingip_associate+port_test.go,floatingip_test.go,floatingip_associate_test.go,data_sources_extras_test.gofixed_ip(ListNestedAttribute)fixed_ip { }→fixed_ip = [{ }]The examples are user-facing (rendered as "Example Usage" in the registry docs), so this also fixes copy-paste-broken docs.
Validation
TestAccKeyManagerSecretAndContainer_basicnow passes live against the CE lab (secret + generic container + data source + import).Nested*Attributein the provider (allocation_pools,allowed_address_pairs,dpd,lifetime,persistence,consumers,roles): the rest already use attribute syntax or have no HCL usage.go build/vet/gofmt/terraform fmtclean.Part of the ongoing live-validation pass; the
fixed_ipfixes are verified static-only for now because the port/floating-IP acc tests are blocked by the lab's missing tenant-network segmentation pool (tracked separately).