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

mongodbatlas federated_settings_org_role_mapping does not validate role names of role assignments #920

Open
sonlir opened this issue Nov 15, 2022 · 2 comments
Labels
improvement Not a feature but not a bug per se not_stale Not stale issue or PR

Comments

@sonlir
Copy link

sonlir commented Nov 15, 2022

terraform_version: 1.2.5

Terraform Configuration File

terraform {
  required_version = ">= 1.2.0"

  required_providers {
    mongodbatlas = {
      source  = "mongodb/mongodbatlas"
      version = "1.5.0"
    }
  }
}

Steps to Reproduce

Add to code role_assignments for mongodbatlas federated_settings_org_role_mapping with non-existent role like

  role_assignments {
    org_id = local.mongo_rtp_org_id
    roles  = ["GROUP_DATA_ACCESS_READ"]
  }

Run:

terraform plan
terraform apply

Expected Behavior

The Terraform plan returns an error that roles named GROUP_DATA_ACCESS_READ do not exist.
The Terraform apply returns an error that roles named GROUP_DATA_ACCESS_READ do not exist.

Actual Behavior

The Terraform plan is successfully completed.
The Terraform apply returns unexpected errors

Crash Output

│ Error: error updating federation settings connected organization (): PUT https://cloud.mongodb.com/api/atlas/v1.0/federationSettings/*********************/connectedOrgConfigs/*********************/roleMappings/: 500 (request "UNEXPECTED_ERROR") Unexpected error.

Additional Context

This behavior complicates the troubleshooting process.

@Zuhairahmed Zuhairahmed added improvement Not a feature but not a bug per se not_stale Not stale issue or PR labels Nov 15, 2022
@Zuhairahmed
Copy link
Collaborator

Thanks @sonlir . This is a feature improvement request, but I think a good one. Added to our product roadmap (internal tracking INTMDB-483), but given competing priorities will likely take us a few months to update. If easier, feel free to create PR directly and happy to have team review sooner.

@Zuhairahmed
Copy link
Collaborator

Zuhairahmed commented Jan 3, 2023

(update 1/3/23): created internal ticket to first build out a new Atlas Admin API endpoint that would allow us to programmatically validate Atlas Roles (PRODTRIAGE-3609). Once we have this we can then appropriately address this issue raised while avoiding Hardcoding specific roles validations since these are regularly added, edited, deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a feature but not a bug per se not_stale Not stale issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants