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

cognito: UserPool CRD has many parameters as array while they are not #443

Closed
yibo-long opened this issue Jan 13, 2023 · 4 comments
Closed
Labels
bug Something isn't working is:triaged Indicates that an issue has been reviewed. stale

Comments

@yibo-long
Copy link

What happened?

Many parameters in cognitoidp.aws.upbound.io/v1beta1.UserPool are specified as an array while it actually should be object since they should only be either set once or optional.

Those are what we got issues while trying to use:

How can we reproduce it?

We have composition like this:

---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: cognito.aws.span.io
  labels:
    provider: aws
spec:
  writeConnectionSecretsToNamespace: upbound-system
  compositeTypeRef:
    apiVersion: aws.span.io/v1alpha1
    kind: XCognito
  resources:
  - name: UserPool
    base:
      apiVersion: cognitoidp.aws.upbound.io/v1beta1
      kind: UserPool
      spec:
        forProvider:
          name: ""
          accountRecoverySetting:
            recoveryMechanism:
              name: verified_email
              priority: 1
          adminCreateUserConfig:
            allowAdminCreateUserOnly: true
...

While trying to use this composition, it got those errors:

cannot render composed resource from resource template at index 0: cannot use dry-run create to name composed resource: UserPool.cognitoidp.aws.upbound.io "*****" is invalid: [spec.forProvider.accountRecoverySetting: Invalid value: "object": spec.forProvider.accountRecoverySetting in body must be of type array: "object", spec.forProvider.adminCreateUserConfig: Invalid value: "object": spec.forProvider.adminCreateUserConfig in body must be of type array: "object" ... ]

So it requires an array like for those config while it doesn't make sense as an array:

---
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
  name: cognito.aws.span.io
  labels:
    provider: aws
spec:
  writeConnectionSecretsToNamespace: upbound-system
  compositeTypeRef:
    apiVersion: aws.span.io/v1alpha1
    kind: XCognito
  resources:
  - name: UserPool
    base:
      apiVersion: cognitoidp.aws.upbound.io/v1beta1
      kind: UserPool
      spec:
        forProvider:
          name: ""
          accountRecoverySetting:
          - recoveryMechanism:
            - name: verified_email
              priority: 1
          adminCreateUserConfig:
          - allowAdminCreateUserOnly: true

What environment did it happen in?

  • Universal Crossplane Version: 1.11.0
  • Provider Version: v0.27.0
@yibo-long yibo-long added the bug Something isn't working label Jan 13, 2023
@yibo-long
Copy link
Author

Now I see this comes from the schema of Terraform: https://github.com/hashicorp/terraform-provider-aws/blob/1076f598ee88175e7409c5887edcf87e6cbeab20/internal/service/cognitoidp/user_pool.go#L39
While AWS is not specifying them as array: https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CreateUserPool.html

So it's probably an expected result, but I am curious why it's implemented in this way.

@turkenf
Copy link
Collaborator

turkenf commented Mar 22, 2023

This issue has been blocked due to issue: One-element arrays could be considered as objects

Copy link

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 Aug 30, 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 Sep 14, 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 is:triaged Indicates that an issue has been reviewed. stale
Projects
None yet
Development

No branches or pull requests

3 participants