Summary
The Nutanix subnet V2 API supports optional metadata (e.g. category assignments) on subnets. The Terraform provider’s nutanix_subnet_v2 resource and nutanix_subnets_v2 / subnet-related data sources do not expose this field, so users cannot manage or read subnet metadata via Terraform.
Problem
- Resource:
nutanix_subnets_v2 does not accept or persist a metadata block, so category IDs and other metadata cannot be set at create/update time.
- Data source: The single-subnet data source
nutanix_subnet_v2 and the list data source nutanix_subnets_v2 do not expose metadata in their schema, so existing metadata is not visible in state or in other resources that depend on it.
This limits governance and tagging workflows (e.g. assigning categories to subnets) and makes Terraform state inconsistent with the platform when metadata is set outside Terraform.
Proposed solution
- Add an optional
metadata block to the nutanix_subnets_v2 resource schema (e.g. category_ids), consistent with other V2 resources that support metadata.
- In the resource: pass
metadata in create/update payloads and read it back in the read function.
- Add a computed
metadata block to:
- The single-subnet data source
nutanix_subnet_v2
- The subnets list data source
nutanix_subnets_v2
- Reuse the existing V2 metadata schema (e.g.
DatasourceMetadataSchemaV2()) where applicable for consistency.
Acceptance criteria
References
- Subnet V2 API.
- Existing metadata handling in other V2 resources (e.g. VPC, floating IP) in this provider.
Summary
The Nutanix subnet V2 API supports optional metadata (e.g. category assignments) on subnets. The Terraform provider’s
nutanix_subnet_v2resource andnutanix_subnets_v2/ subnet-related data sources do not expose this field, so users cannot manage or read subnet metadata via Terraform.Problem
nutanix_subnets_v2does not accept or persist ametadatablock, so category IDs and other metadata cannot be set at create/update time.nutanix_subnet_v2and the list data sourcenutanix_subnets_v2do not exposemetadatain their schema, so existing metadata is not visible in state or in other resources that depend on it.This limits governance and tagging workflows (e.g. assigning categories to subnets) and makes Terraform state inconsistent with the platform when metadata is set outside Terraform.
Proposed solution
metadatablock to thenutanix_subnets_v2resource schema (e.g.category_ids), consistent with other V2 resources that support metadata.metadatain create/update payloads and read it back in the read function.metadatablock to:nutanix_subnet_v2nutanix_subnets_v2DatasourceMetadataSchemaV2()) where applicable for consistency.Acceptance criteria
nutanix_subnets_v2accepts an optionalmetadatablock (e.g.category_ids) and persists it on create/update.nutanix_subnet_v2andnutanix_subnets_v2data sources expose a computedmetadatablock populated from the API.References