pulumi / pulumi-mongodbatlas

A MongoDB Atlas Pulumi resource package, providing multi-language access to MongoDB Atlas
Apache License 2.0
16 stars 5 forks source link

Internal server error trying to create a team #440

Closed VenelinMartinov closed 6 months ago

VenelinMartinov commented 6 months ago

What happened?

Received an internal server error with the Team resource:

Diagnostics:
  pulumi:pulumi:Stack (index_teamLgDE0nIvD90l-dev):
    error: update failed

  mongodbatlas:index:Team (myMongoDbAtlasTeam):
    error: 1 error occurred:
        * error creating Team information: https://cloud.mongodb.com/api/atlas/v2/orgs/[secret]/teams POST: HTTP 500 Internal Server Error (Error code: "UNEXPECTED_ERROR") Detail: Unexpected error. Reason: Internal Server Error. Params: []

Example

name: index_teamLgDE0nIvD90l
runtime: yaml
description: ""
config:
  mongodb-atlas-org-id:
    type: string
    default: ORG_ID
  pulumi:tags:
    value:
      pulumi:template: https://www.pulumi.com/ai/api/project/01096bd6-fea5-4cbe-94b4-5cfeb58181d4.zip
resources:
  myMongoDbAtlasTeam:
    properties:
      orgId: ${orgId}
      usernames:
        - user1@example.com
        - user2@example.com
    type: mongodbatlas:Team
variables:
  orgId: ${mongodb-atlas-org-id}

Output of pulumi about

CLI          
Version      3.111.1
Go Version   go1.22.1
Go Compiler  gc

Plugins
NAME  VERSION
yaml  unknown

Host     
OS       darwin
Version  14.1.1
Arch     arm64

This project is written in yaml

Current Stack: pulumi/index_teamLgDE0nIvD90l/dev

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

guineveresaenger commented 6 months ago

Does this fail in all languages, or just yaml?

VenelinMartinov commented 6 months ago

I suspect all languages but have not tested it.

guineveresaenger commented 6 months ago

Okay. I clicked around the mongoDB Atlas UI and it turns out - you cannot add unverified users such as user1@example.com and user2@example.com to a team. The users have to exist, and be verified.

When I run this program with a verified user, this example will work perfectly.