Importing Existing YAML
Chant can parse existing Config Connector YAML manifests and generate typed TypeScript source files.
How it works
Section titled “How it works”Input YAML → parse → generate TypeScript → export typed resourcesThe importer reads multi-document YAML, identifies Config Connector resources by their cnrm.cloud.google.com apiVersion, and generates corresponding typed constructor calls.
Example
Section titled “Example”Input YAML:
apiVersion: storage.cnrm.cloud.google.com/v1beta1kind: StorageBucketmetadata: name: my-bucketspec: location: US uniformBucketLevelAccess: trueGenerated TypeScript:
import { Bucket } from "@intentius/chant-lexicon-gcp";
export const myBucket = new Bucket({ metadata: { name: "my-bucket" }, location: "US", uniformBucketLevelAccess: true,});Limitations
Section titled “Limitations”The import pipeline:
- Only handles Config Connector resources (
cnrm.cloud.google.comapiVersion) - Non-CC resources (standard K8s Deployments, Services) are filtered out
- Resource references are preserved as literal values, not typed refs
- Multi-document YAML is fully supported