mongodb / awscdk-resources-mongodbatlas

MongoDB Atlas AWS CDK Resources
Apache License 2.0
35 stars 17 forks source link

[Bug]: CfnTrigger prop tolerateResumeErrorsis not respected #350

Closed Dragomirc closed 1 month ago

Dragomirc commented 2 months ago

Is there an existing issue for this?

CDK package version

2.141.0

CFN Resource version

NA

CFN Resource Region

eu-west-1

Current Behavior

When the tolerateResumeErrors prop is set to true, it does not appear to be respected during the CDK deployment. After deployment, checking the MongoDB Atlas UI shows that the auto-resume feature remains disabled, despite the expectation that it would be enabled.

Expected Behavior: Setting tolerateResumeErrors: true should enable the auto-resume feature in MongoDB Atlas upon deployment.

Current Behavior: Even with tolerateResumeErrors set to true, the MongoDB Atlas UI shows that the auto-resume feature is disabled after deployment.

AWS CDK code to reproduce the issue

new CfnTrigger(this, "Trigger", {
      projectId: props.projectId,
      type: "DATABASE",
      name: props.triggerName,
      profile: props.mongoProfileName,
      appId: props.appId,
      databaseTrigger: {
        operationTypes: [
          DatabaseConfigOperationTypes.INSERT,
          DatabaseConfigOperationTypes.DELETE,
          DatabaseConfigOperationTypes.UPDATE,
          DatabaseConfigOperationTypes.REPLACE,
        ],
        database: props.database,
        collection: "articles",
        serviceId: props.serviceId,
        fullDocumentBeforeChange: true,
        fullDocument: true,
        tolerateResumeErrors: true,
        match: `{}`,
      },
      eventProcessors: {
        awseventbridge: {
          awsConfig: {
            accountId: props.account,
            region: props.region,
          },
        },
      },
    });

Steps To Reproduce

  1. Set the tolerateResumeErrors prop to true in the CDK configuration.
  2. Deploy using CDK.
  3. Check the MongoDB Atlas UI to see if the auto-resume feature is enabled.
  4. Observe that the feature remains disabled.

cdk synth

HarvesterStoreharvesterArticlesTrigger19BD6910:
    Type: MongoDB::Atlas::Trigger
    Properties:
      Profile: <profile name>
      DatabaseTrigger:
        ServiceId: <service id>
        Database: <database name>
        Collection: <collection name>
        OperationTypes:
          - INSERT
          - DELETE
          - UPDATE
          - REPLACE
        Match: "{}"
        Project: "{}"
        FullDocument: true
        FullDocumentBeforeChange: true
        TolerateResumeErrors: true
      Name: <name>
      Type: DATABASE
      EventProcessors:
        AWSEVENTBRIDGE:
          AWSConfig:
            AccountId: <account id>
            Region: eu-west-1
      AppId: <app id>
      ProjectId: <project id>
    Metadata:
      aws:cdk:path: ServiceStack/HarvesterStore/harvesterArticlesTrigger

Code of Conduct

github-actions[bot] commented 2 months ago

Thanks for opening this issue! Please make sure to provide the following information to help us reproduce the issue:

Thanks for opening this issue. The ticket CLOUDP-272425 was created for internal tracking.

maastha commented 1 month ago

Hi @Dragomirc

We are already tracking this issue in https://jira.mongodb.org/browse/CLOUDP-273338. We currently don't have an ETA for the fix. Closing this issue as duplicate.