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

Cross-resource references to handle multiple types #350

Open
Tracked by #3393
muvaf opened this issue Aug 30, 2022 · 4 comments
Open
Tracked by #3393

Cross-resource references to handle multiple types #350

muvaf opened this issue Aug 30, 2022 · 4 comments
Labels
enhancement New feature or request stale

Comments

@muvaf
Copy link
Member

muvaf commented Aug 30, 2022

What problem are you facing?

There are fields in some resources that could be fulfilled by different types, i.e. ARN of Instance or NetworkInterface or LoadBalancer could be given. However, cross-resource resolver always works with a singe hard-coded type so you have to use composition to patch those fields.

How could Crossplane help solve your problem?

We could either solve this via generic patching or implement #341 and have per-type resolver logic in the code so that we don't have to ask for fieldpaths, transforms etc.

@muvaf muvaf added the enhancement New feature or request label Aug 30, 2022
@Kerwood
Copy link

Kerwood commented Sep 5, 2022

When creating an Opsgenie Escalation the recipient type can be either user, team or schedule, but Crossplane only supports a single cross-resource reference per "block", in this case rules.recipient.

Below is an example on how it could look like with multi cross-resource reference.

...
spec:
  forProvider:
    name: Escalation Name
    rules:
      - recipient:
          - type: user
            userIdRef:
              name: user-name

          - type: team
            teamIdRef:
              name: team-name

          - type: schedule
            scheduleIdRef:
              name: schedule-name

Terraform example.

resource "opsgenie_escalation" "test" {
  name          = "genieescalation-%s"
  description   = "test"
  owner_team_id = "${opsgenie_team.test.id}"

  rules {
    condition   = "if-not-acked"
    notify_type = "default"
    delay       = 1

    recipient {
      type = "user"
      id   = "${opsgenie_user.test.id}"
    }

    recipient {
      type = "team"
      id   = "${opsgenie_team.test.id}"
    }

    recipient {
      type = "schedule"
      id   = "${opsgenie_schedule.test.id}"
    }
  }

https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs/resources/escalation

@haarchri
Copy link
Contributor

the same we have in provider-pagerduty

    rule:
    - escalationDelayInMinutes: 10
      target:
      - id: ${pagerduty_user.example.id}
        type: user_reference
      - id: ${pagerduty_user.example2.id}
        type: user_reference

@haarchri
Copy link
Contributor

Copy link

github-actions bot commented Sep 3, 2024

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

@github-actions github-actions bot added the stale label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants