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

Rule cloudwatchevents error with external-name, metadata.name, eventBusName #931

Closed
haarchri opened this issue Oct 22, 2023 · 2 comments
Closed
Labels
bug Something isn't working needs:triage stale

Comments

@haarchri
Copy link
Member

What happened?

1, Error: The external name is incorrectly calculated. The expected format is "EVENTBUSNAME/RULENAME" or "RULENAME".

  Warning  CannotObserveExternalResource  1s (x2 over 3s)  managed/cloudwatchevents.aws.upbound.io/v1beta1, kind=rule  cannot run refresh: refresh failed: unexpected format for ID (arn:aws:events:us-west-2:609897127049:event-bus/default
/configuration-aws-eks-karpenter-fpss5), expected EVENTBUSNAME/RULENAME or RULENAME:
  1. Error: The eventBusName cannot be empty. Description in Terraform says: If not specified, the default event bus is used.
Warning  CannotConnectToProvider        4m4s (x13 over 11m)  managed/cloudwatchevents.aws.upbound.io/v1beta1, kind=rule  cannot get a terraform workspace for resource: cannot get id: event_bus_name cannot be empty
  1. Error: You can only override crossplane.io/external-name if metadata.name matches.
Message:               observe failed: cannot run refresh: refresh failed: "name" doesn't comply with restrictions ("^[\\.\\-_A-Za-z0-9]+$"): "default/HealthEvent": 

To resolve the issues, you can set crossplane.io/external-name to match metadata.name.

        - fromFieldPath: spec.parameters.id
          toFieldPath: metadata.annotations[crossplane.io/external-name]
          transforms:
            - type: match
              match:
                patterns:
                  - type: regexp
                    regexp: '.*'
                    result: healthevent
        - fromFieldPath: spec.parameters.id
          toFieldPath: metadata.name
          transforms:
            - type: match
              match:
                patterns:
                  - type: regexp
                    regexp: '.*'
                    result: healthevent

and set eventBusName to default

        spec:
          forProvider:
            eventBusName: default

How can we reproduce it?

apiVersion: cloudwatchevents.aws.upbound.io/v1beta1
kind: Rule
metadata:
  annotations:
    crossplane.io/composition-resource-name: ruleHealthEvent
    crossplane.io/external-create-pending: "2023-10-22T09:00:49Z"
    crossplane.io/external-create-succeeded: "2023-10-22T09:00:49Z"
    crossplane.io/external-name: healthevent
    upjet.crossplane.io/provider-meta: "null"
  creationTimestamp: "2023-10-22T09:00:47Z"
  finalizers:
  - finalizer.managedresource.crossplane.io
  generateName: configuration-aws-eks-karpenter-
  generation: 3
  labels:
    crossplane.io/claim-name: ""
    crossplane.io/claim-namespace: ""
    crossplane.io/composite: configuration-aws-eks-karpenter
    type: HealthEvent
  name: healthevent
  ownerReferences:
  - apiVersion: aws.platform.upbound.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: XKarpenter
    name: configuration-aws-eks-karpenter
    uid: 4c72a9f4-a3ec-4e42-84a0-a683a49a08be
  resourceVersion: "57225"
  uid: f0ee322d-28bc-4f95-973f-a98dee0cf9db
spec:
  deletionPolicy: Delete
  forProvider:
    eventBusName: default
    eventPattern: |
      {
        "source": [
          "aws.health"
        ],
        "detail-type": [
          "AWS Health Event"
        ]
      }
    isEnabled: true
    region: us-west-2
    tags:
      crossplane-kind: rule.cloudwatchevents.aws.upbound.io
      crossplane-name: healthevent
      crossplane-providerconfig: default
  initProvider: {}
  managementPolicies:
  - '*'
  providerConfigRef:
    name: default
status:
  atProvider:
    arn: arn:aws:events:us-west-2:609897127049:rule/healthevent
    description: ""
    eventBusName: default
    eventPattern: '{"detail-type":["AWS Health Event"],"source":["aws.health"]}'
    id: healthevent
    isEnabled: true
    roleArn: ""
    scheduleExpression: ""
    tags:
      crossplane-kind: rule.cloudwatchevents.aws.upbound.io
      crossplane-name: healthevent
      crossplane-providerconfig: default
    tagsAll:
      crossplane-kind: rule.cloudwatchevents.aws.upbound.io
      crossplane-name: healthevent
      crossplane-providerconfig: default
  conditions:
  - lastTransitionTime: "2023-10-22T09:01:00Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2023-10-22T09:00:49Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced
  - lastTransitionTime: "2023-10-22T09:00:52Z"
    reason: Success
    status: "True"
    type: LastAsyncOperation
  - lastTransitionTime: "2023-10-22T09:00:52Z"
    reason: Finished
    status: "True"
    type: AsyncOperation

What environment did it happen in?

  • Crossplane Version: v1.13.2
  • Provider Version: v0.42.0
  • Kubernetes Version:
  • Kubernetes Distribution:
@haarchri haarchri added bug Something isn't working needs:triage labels Oct 22, 2023
@haarchri haarchri changed the title Rule` cloudwatchevents error with external-name, metadata.name Rule cloudwatchevents error with external-name, metadata.name Oct 22, 2023
@haarchri haarchri changed the title Rule cloudwatchevents error with external-name, metadata.name Rule cloudwatchevents error with external-name, metadata.name, eventBusName Oct 22, 2023
Copy link

github-actions bot commented Apr 2, 2024

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. 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 Apr 2, 2024
Copy link

This issue is being closed since there has been no activity for 14 days since marking it as stale. If you still need help, feel free to comment or reopen the issue!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs:triage stale
Projects
None yet
Development

No branches or pull requests

1 participant