crossplane-contrib / provider-mongodbatlas

MongoDB Atlas Provider based on Terrajet
Apache License 2.0
15 stars 11 forks source link

Fix database.User configuration #7

Closed ulucinar closed 2 years ago

ulucinar commented 2 years ago

Description of your changes

Fixes #6

Fixes Terraform ID configuration of the database.User resource.

I have:

How has this code been tested

Successfully tested using the following manifest:

apiVersion: database.mongodbatlas.jet.crossplane.io/v1alpha1
kind: User
metadata:
  name: example
  annotations:
    crossplane.io/external-name: example-user
spec:
  forProvider:
    authDatabaseName: admin
    passwordSecretRef:
      name: user-password
      key: password
      namespace: crossplane-system
    projectId: <project ID>
    roles:
      - databaseName: admin
        roleName: readAnyDatabase
    scopes:
      - name: example-cluster
        type: CLUSTER
  providerConfigRef:
    name: default
Piotr1215 commented 2 years ago

Thank you @ulucinar , this solves the issue with creating a user and also allows me to pull an existing cluster under Crossplane :partying_face:

Also, the simplified external name is a big time saver.