Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 3.09 KB

File metadata and controls

76 lines (53 loc) · 3.09 KB

database-user

The official MongoDB Atlas AWS CDK resource for Node.js.

AWS CDK L1 construct and data structures for the AWS CloudFormation Registry type MongoDB::Atlas::DatabaseUser v1.0.0.

Description

Returns, adds, edits, and removes database users. Supports password, AWS IAM, LDAP, X.509, and OIDC federated authentication types. Users can be scoped to specific clusters or Data Lake instances, and enriched with labels for categorization.

MongoDB Atlas API Docs

For more information about the API refer to: API Endpoints

Usage

In order to use this library, you will need to activate this AWS CloudFormation Registry type in your account. You can do this via the AWS Management Console or using the AWS CLI using the following command:

aws cloudformation activate-type \
  --type-name MongoDB::Atlas::DatabaseUser \
  --publisher-id bb989456c78c398a858fef18f2ca1bfc1fbba082 \
  --type RESOURCE \
  --execution-role-arn ROLE-ARN

Alternatively:

aws cloudformation activate-type \
  --public-type-arn arn:aws:cloudformation:us-east-1::type/resource/bb989456c78c398a858fef18f2ca1bfc1fbba082/MongoDB-Atlas-DatabaseUser \
  --execution-role-arn ROLE-ARN

You can find more information about activating this type in the AWS CloudFormation documentation.

import { CfnDatabaseUser } from 'awscdk-resources-mongodbatlas';

const customDatabaseUser = new CfnDatabaseUser(this, 'CustomDatabaseUser', {
    projectId: atlasProps.projId,
    profile: atlasProps.profile,
    username: atlasProps.username,
    password: atlasProps.password,
    databaseName: atlasProps.dbName,
    roles: [ 
    {
        roleName: atlasProps.roleName,
        databaseName: atlasProps.dbName
    }
    ],
    scopes: [
        { name: atlasProps.clusterName, type: ScopeDefinitionType.CLUSTER },
    ],
});

Feedback

This library is auto-generated and published to all supported programming languages by the cdklabs/cdk-cloudformation project based on the API schema published for MongoDB::Atlas::DatabaseUser.

  • Issues related to this generated library should be reported here.
  • Issues related to MongoDB::Atlas::DatabaseUser should be reported to the publisher.
  • Feature requests should be reported here

License

Distributed under the Apache-2.0 License.