Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use zoneIdRef/accountIdRef #53

Closed
milkpirate opened this issue Apr 3, 2024 · 2 comments
Closed

How to use zoneIdRef/accountIdRef #53

milkpirate opened this issue Apr 3, 2024 · 2 comments

Comments

@milkpirate
Copy link

milkpirate commented Apr 3, 2024

Hey,

under my me@example.org account I have several sites: foo.com, bar.com with their IDs 123 and 456.

Using zoneId: 123 in https://doc.crds.dev/github.com/cdloh/provider-cloudflare/access.cloudflare.upbound.io/IdentityProvider/v1alpha1@v0.1.0 works fine, but I would not like to use such magic values and use the domains instead, e.g. foo.bar. I tried

zoneIdRef:
  name: foo.bar

but I get:

status:
  atProvider: {}
  conditions:
  - lastTransitionTime: "2024-04-03T21:47:43Z"
    message: 'cannot resolve references: mg.Spec.ForProvider.ZoneID: cannot get referenced
      resource: Zone.zone.cloudflare.upbound.io "foo.bar" not found'
    reason: ReconcileError
    status: "False"
    type: Synced

Same goes for accountId and accountIdRef. Could you help me, what the "search term" for the corresponding values would be?

@milkpirate milkpirate changed the title zoneIdRef / accountIdRef zoneIdRef /accountIdRef Apr 3, 2024
@milkpirate milkpirate changed the title zoneIdRef /accountIdRef zoneIdRef/accountIdRef Apr 3, 2024
@milkpirate milkpirate changed the title zoneIdRef/accountIdRef How to use zoneIdRef/accountIdRef Apr 3, 2024
@cdloh
Copy link
Owner

cdloh commented Apr 4, 2024

both zoneIdRef and accountIdRef are reference fields. Read the Crossplane documentation here https://github.com/crossplane/crossplane/blob/master/design/one-pager-cross-resource-referencing.md

But in short you need to create a Account and Zone resource or import them into crossplane. You can then reference them by name which should give you what you're after.

@milkpirate
Copy link
Author

milkpirate commented Apr 4, 2024

Oh right, I remember, its already on k8s/crossplane level, not cloudflare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants