Use the supported SDKs as per: https://learn.microsoft.com/en-us/azure/cosmos-db/hierarchical-partition-keys?tabs=net-v3%2Carm-json#limitations-and-known-issues
Use this format, for a Cosmos DB SQL database with a container using the below Terraform code, the plural-version of partition-key-paths:
partition_key_paths = ["/parent", "/child"]
partition_key_kind = "MultiHash"
partition_key_version = 2
Once created, use https://cosmos.azure.com/ portal click on your container, Settings to view your new hierarchical setup: