Skip to content

fix: nested-attribute HCL syntax in examples and acceptance tests - #23

Merged
PF9-pushkar merged 1 commit into
mainfrom
fix/nested-attr-hcl-syntax
Jul 12, 2026
Merged

fix: nested-attribute HCL syntax in examples and acceptance tests#23
PF9-pushkar merged 1 commit into
mainfrom
fix/nested-attr-hcl-syntax

Conversation

@PF9-pushkar

Copy link
Copy Markdown
Collaborator

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:

Blocks of type "secret_refs" are not expected here. Did you mean to define argument "secret_refs"? If so, use the equals sign to assign it a value.

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

File(s) Attribute Change
examples/.../pcd_keymanager_container + keymanager_test.go secret_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.go fixed_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_basic now passes live against the CE lab (secret + generic container + data source + import).
  • Audited every other Nested*Attribute in 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 fmt clean.

Part of the ongoing live-validation pass; the fixed_ip fixes 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).

…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
PF9-pushkar merged commit d8291d5 into main Jul 12, 2026
5 checks passed
@PF9-pushkar
PF9-pushkar deleted the fix/nested-attr-hcl-syntax branch July 12, 2026 22:02
PF9-pushkar added a commit that referenced this pull request Jul 14, 2026
fix: nested-attribute HCL syntax in examples and acceptance tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant