Skip to content

Getting Started

llms.txt lists every page for an agent
Optional: hand this page to your coding agentThe steps work by hand too.
Show the whole prompt
Read https://intentius.io/chant/lexicons/gcp/getting-started/.
In a new directory, install `@intentius/chant` and `@intentius/chant-lexicon-gcp`, write the `GcsBucket` example from the page, and run `npx chant build --output dist/manifests.yaml` and `npx chant lint src`.
Show me the output and the manifests. Print the `kubectl apply --dry-run=server` and `kubectl apply` commands for me to run; do not run them.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.

You write TypeScript, and chant builds it into Config Connector YAML that you apply to a GKE cluster running Config Connector.

  1. A GKE cluster with Config Connector installed
  2. A ConfigConnectorContext resource configured per namespace
  3. A GCP Service Account bound to the Config Connector controller
Terminal window
npm install --save-dev @intentius/chant @intentius/chant-lexicon-gcp

Start with the GcsBucket composite, one function call that returns a Storage bucket:

src/infra.gcp.ts
import { GcsBucket } from "@intentius/chant-lexicon-gcp";
import { defaultAnnotations, GCP } from "@intentius/chant-lexicon-gcp";
export const annotations = defaultAnnotations({
"cnrm.cloud.google.com/project-id": GCP.ProjectId,
});
const { bucket } = GcsBucket({
name: "my-data-bucket",
location: "US",
versioning: true,
});
export { bucket };
Terminal window
# Generate Config Connector YAML
chant build --output dist/manifests.yaml
# Validate against the cluster API (no changes applied)
kubectl apply -f dist/manifests.yaml --dry-run=server
# Apply
kubectl apply -f dist/manifests.yaml
import { StorageBucket, IAMPolicyMember, GCP } from "@intentius/chant-lexicon-gcp";
export const bucket = new StorageBucket({
location: "US",
storageClass: "STANDARD",
uniformBucketLevelAccess: true,
versioning: { enabled: true },
});
export const reader = new IAMPolicyMember({
member: "serviceAccount:app@my-project.iam.gserviceaccount.com",
role: "roles/storage.objectViewer",
resourceRef: {
apiVersion: "storage.cnrm.cloud.google.com/v1beta1",
kind: "StorageBucket",
name: bucket,
},
});

chant