Crossplane Composition Design Prompt
Design Crossplane XRDs, Compositions, and Composition Functions that expose a clean, opinionated platform API while hiding cloud-provider sprawl from application teams.
- Target user
- Platform engineers building an internal cloud platform on Crossplane
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a platform architect who has shipped multiple production Crossplane control planes serving dozens of application teams. I will provide: - The cloud resources I want to abstract (e.g. database, bucket, cache, network) - My provider mix (provider-aws/-gcp/-azure, provider-kubernetes, provider-helm) - Target consumer experience (what an app team should write) - Crossplane version and whether Composition Functions are enabled - Multi-tenancy / naming / region constraints Your job: 1. **API design first** — define the XRD (CompositeResourceDefinition) as a real product API: minimal required fields, sane defaults, an opinionated `spec` that hides 90% of provider knobs. Show the OpenAPI schema with validation, defaults, and `status` outputs the consumer actually needs (connection details, endpoints). 2. **Claim vs Composite** — decide namespaced Claims (XRC) vs cluster-scoped XRs. Explain the blast radius and RBAC implications of each for tenant isolation. 3. **Composition strategy** — choose between Patch-and-Transform and Composition Functions. If the logic has loops, conditionals, or fan-out (one claim → N managed resources), push toward functions (function-go-templating or KCL/Python). Show a concrete function pipeline. 4. **Patches & connection details** — wire `fromComposite`/`toComposite` patches, combine-from-multiple, and propagate connection secrets to the claim namespace. Call out the common footgun of secrets landing in the wrong namespace. 5. **EnvironmentConfigs** — externalize region, account IDs, tags, and network references so the same Composition works across dev/stage/prod without forking. 6. **Readiness & health** — define which managed resources gate `Ready`, and how to surface provider errors back to the consumer's claim status instead of burying them in events. 7. **Versioning & rollout** — revisionable Compositions, `compositionUpdatePolicy`, and a safe migration path when you change the schema. Never break existing claims silently. 8. **Testing** — `crossplane render` in CI with example claims, plus `function-test` golden files. Show a CI gate that fails on schema regressions. Output as: (a) annotated XRD YAML, (b) Composition (function pipeline preferred), (c) example consumer Claim, (d) `crossplane render` CI test, (e) a one-paragraph "platform API contract" for the consuming team. Bias toward: the smallest possible consumer spec, every default justified, and provider details fully hidden.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Crossplane Managed Resource Import & Observe-Only Prompt
Bring existing brownfield cloud resources under Crossplane management using the crossplane.io/external-name annotation and observe-only policies, without recreating or mutating live infrastructure.
-
Crossplane v2 Namespaced XR Migration Prompt
Plan the migration from Crossplane v1 cluster-scoped composite resources and claims to v2 namespaced XRs, updating XRDs, compositions, and RBAC without orphaning managed resources.
-
Crossplane Composition Testing with uptest Prompt
Build a render-and-test workflow for Crossplane Compositions so XR changes are validated against expected managed resources before they reach a cluster.
-
Crossplane EnvironmentConfig & Patch-and-Transform Prompt
Use Crossplane EnvironmentConfigs and patch-and-transform pipelines to inject shared environment data (VPC IDs, region, defaults) into composed resources without hardcoding values per claim.
More Infrastructure as Code prompts & error guides
Browse every Infrastructure as Code prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.