Skip to content

[Bug]: MongoDB::Atlas::DatabaseUser - drift detection not working - read handler does not return "AWSIAMType" and "Scopes" propertiesΒ #1233

@ghost

Description

Is there an existing issue for this?

  • I have searched the existing issues

CFN Resource version

v2.1.0

CFN Resource Region

eu-central-1

Current Behavior

CFN drift detection detects a drift:

Screenshot from 2024-11-27 13-20-55

The "AWSIAMType" and "Scopes" properties are missing.

The Read handler of the MongoDB::Atlas::DatabaseUser resource does not process the "Scopes" property. In addition, the condition for copying the "AWSIAMType" property seems to be erronous. Why should that property only be copied, if some default value has been set???

	if currentModel.AWSIAMType != nil {
		currentModel.AWSIAMType = databaseUser.AwsIAMType
	}

CFN template to reproduce the issue

{
      "Type": "MongoDB::Atlas::DatabaseUser",
      "Properties": {
        "AWSIAMType": "ROLE",
        "DatabaseName": "$external",
        "ProjectId": "...",
        "Roles": [
          {
            "DatabaseName": "...",
            "RoleName": "read"
          }
        ],
        "Scopes": [
          {
            "Name": "...",
            "Type": "CLUSTER"
          }
        ],
        "Username": "..."
      }

Steps To Reproduce

Deploy DatabaseUser resource in a stack and execute drift detection on that stack.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions