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

Add feature azurerm_kubernetes_cluster_trusted_access_role_binding #871

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

drew0ps
Copy link
Contributor

@drew0ps drew0ps commented Nov 7, 2024

Description of your changes

Adds azurerm_kubernetes_cluster_trusted_access_role_binding to the authorization provider.

Fixes #

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable to ensure this PR is ready for review.
  • [-] Added backport release-x.y labels to auto-backport this PR if necessary.

Notes

2 notable things about this PR:

  • external name configured quite standard, the referenced var exists in the generated init paramenets type file.
  • Added an additional resource configurator and it's dependency rconfig here so that the resource ends up in the authorization provider as opposed to the containerservice one.

How has this code been tested

  • I've built the provider as a docker image using make e2e
  • I've took the image to my company's test environment and deployed the following tempalte:
          ---
          apiVersion: authorization.azure.upbound.io/v1beta1
          kind: TrustedAccessRoleBinding
          metadata:
            annotations:
              gotemplating.fn.crossplane.io/composition-resource-name: trustedaccessrolebinding
            name: "{{ $.observed.composite.resource.metadata.name }}-ta"
          spec:
            forProvider:
              kubernetesClusterIdRef:
                name: {{ .observed.composite.resource.metadata.name }}
              roles:
                - "Microsoft.DataProtection/backupVaults/backup-operator"
              sourceResourceId: "{{ .observed.resources.backupvault.resource.status.atProvider.id }}"
            providerConfigRef:
              name: "{{ $.observed.composite.resource.metadata.name }}" 
  • Then I took a look at the resources:
k get trustedaccessrolebindings.authorization.azure.upbound.io 
NAME                    SYNCED   READY   EXTERNAL-NAME           AGE
aks-cluster-3-ta   True     True    aks-cluster-3-ta   13m
aks-cluster-4-ta  True     True    aks-cluster-3-ta  13m 
  • Then I described the resources:
Status:
  At Provider:
    Id:                     /subscriptions/redactedname/resourceGroups/redactednameproviders/Microsoft.ContainerService/managedClusters/redactedname/trustedAccessRoleBindings/redactedname-ta
    Kubernetes Cluster Id:  /subscriptions/redactedname/resourceGroups/redactedname/providers/Microsoft.ContainerService/managedClusters/redactedname
    Roles:
      Microsoft.DataProtection/backupVaults/backup-operator
    Source Resource Id:  /subscriptions/redactedid/resourceGroups/redactedname/providers/Microsoft.DataProtection/backupVaults/redactedname
  Conditions:
    Last Transition Time:  2024-11-07T17:43:35Z
    Reason:                Available
    Status:                True
    Type:                  Ready
    Last Transition Time:  2024-11-07T17:43:34Z
    Reason:                ReconcileSuccess
    Status:                True
    Type:                  Synced
    Last Transition Time:  2024-11-07T17:43:35Z
    Reason:                Success
    Status:                True
    Type:                  LastAsyncOperation
Events:
  Type    Reason                   Age   From                                                                           Message
  ----    ------                   ----  ----                                                                           -------
  Normal  CreatedExternalResource  48s   managed/authorization.azure.upbound.io/v1beta1, kind=trustedaccessrolebinding  Successfully requested creation of external resource 

Signed-off-by: drew0ps <ad.marton@proton.me>
@drew0ps drew0ps changed the title Feature az trusted identity Add feature azurerm_kubernetes_cluster_trusted_access_role_binding Nov 7, 2024
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

Successfully merging this pull request may close these issues.

1 participant