# MongoDbSettingsProperty

Struct · External

Provides information that defines a MongoDB endpoint.

- Source: Generated at build time
- Type last changed: v2.174.0 · 4 Jan 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dms as dms } from 'aws-cdk-lib';
const mongoDbSettingsProperty: dms.CfnDataProvider.MongoDbSettingsProperty = {
  port: 123,
  serverName: 'serverName',

  // the properties below are optional
  authMechanism: 'authMechanism',
  authSource: 'authSource',
  authType: 'authType',
  certificateArn: 'certificateArn',
  databaseName: 'databaseName',
  sslMode: 'sslMode',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_dms as dms

mongo_db_settings_property = dms.CfnDataProvider.MongoDbSettingsProperty(
    port=123,
    server_name="serverName",

    # the properties below are optional
    auth_mechanism="authMechanism",
    auth_source="authSource",
    auth_type="authType",
    certificate_arn="certificateArn",
    database_name="databaseName",
    ssl_mode="sslMode"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.dms.*;

MongoDbSettingsProperty mongoDbSettingsProperty = MongoDbSettingsProperty.builder()
        .port(123)
        .serverName("serverName")

        // the properties below are optional
        .authMechanism("authMechanism")
        .authSource("authSource")
        .authType("authType")
        .certificateArn("certificateArn")
        .databaseName("databaseName")
        .sslMode("sslMode")
        .build();
```

C#:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.DMS;

var mongoDbSettingsProperty = new MongoDbSettingsProperty {
    Port = 123,
    ServerName = "serverName",

    // the properties below are optional
    AuthMechanism = "authMechanism",
    AuthSource = "authSource",
    AuthType = "authType",
    CertificateArn = "certificateArn",
    DatabaseName = "databaseName",
    SslMode = "sslMode"
};
```

Go:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

mongoDbSettingsProperty := &MongoDbSettingsProperty{
	Port: jsii.Number(123),
	ServerName: jsii.String("serverName"),

	// the properties below are optional
	AuthMechanism: jsii.String("authMechanism"),
	AuthSource: jsii.String("authSource"),
	AuthType: jsii.String("authType"),
	CertificateArn: jsii.String("certificateArn"),
	DatabaseName: jsii.String("databaseName"),
	SslMode: jsii.String("sslMode"),
}
```

## Properties

- `authMechanism`: string — The authentication mechanism you use to access the MongoDB source endpoint.

  For the default value, in MongoDB version 2.x, `"default"` is `"mongodb_cr"` . For MongoDB version 3.x or later, `"default"` is `"scram_sha_1"` . This setting isn't used when `AuthType` is set to `"no"` .

- `authSource`: string — The MongoDB database name. This setting isn't used when `AuthType` is set to `"no"` .

  The default is `"admin"` .

- `authType`: string — The authentication type you use to access the MongoDB source endpoint.

  When when set to `"no"` , user name and password parameters are not used and can be empty.

- `certificateArn`: string

- `databaseName`: string — The database name on the MongoDB source endpoint.

- `port`: number (required) — The port value for the MongoDB source endpoint.

- `serverName`: string (required) — The name of the server on the MongoDB source endpoint.

  For MongoDB Atlas, provide the server name for any of the servers in the replication set.

- `sslMode`: string
