🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@mongodbatlas-awscdk/atlas-basic

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongodbatlas-awscdk/atlas-basic

Creates a project, cluster, dbuser and ipaccess list in MongoDB Atlas

latest
Source
npmnpm
Version
1.1.6
Version published
Weekly downloads
7
-22.22%
Maintainers
1
Weekly downloads
 
Created
Source

@mongodbatlas-awscdk/atlas-basic

This package is now deprecated and will no longer receive new features. Use awscdk-resource-mongodbatlas instead.

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

This construct uses MongoDB L1 construct and data structures for the AWS CloudFormation Registry L3 type.

Description

The cluster basic resource provides access to your cluster configurations. The resource lets you create Project, Cluster, DB User and configures IpAccesslist.

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::Cluster \
  --publisher-id bb989456c78c398a858fef18f2ca1bfc1fbba082 \
  --type RESOURCE \
  --execution-role-arn ROLE-ARN
  
aws cloudformation activate-type \
  --type-name MongoDB::Atlas::Project \
  --publisher-id bb989456c78c398a858fef18f2ca1bfc1fbba082 \
  --type RESOURCE \
  --execution-role-arn ROLE-ARN

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

aws cloudformation activate-type \
  --type-name MongoDB::Atlas::ProjectIpAccessList \
  --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-Cluster \
  --execution-role-arn ROLE-ARN

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

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

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

Minimal configuration to use this app

create a new folder (example: L3CDK) and initate a new app using the CDK client:

cdk init app --language=typescript

locate the stack typescript file in this example (lib/l3_cdks-stack.ts)

use the next code to create a new stack

import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { AtlasBasic } from '@mongodbatlas-awscdk/atlas-basic';

export class L3CdksStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);


  const orgId = this.node.tryGetContext('MONGODB_ATLAS_ORG_ID') || process.env.MONGODB_ATLAS_ORG_ID;

  const replicationSpecs = [
      {
          "numShards": 1,
          "advancedRegionConfigs": [
              {
                  "analyticsSpecs": {
                      "ebsVolumeType": "STANDARD",
                      "instanceSize": "M10",
                      "nodeCount": 1
                  },
                  "electableSpecs": {
                      "ebsVolumeType": "STANDARD",
                      "instanceSize": "M10",
                      "nodeCount": 3
                  },
                  "priority":  7,
                  "regionName": "US_EAST_1"
              }
          ]
      }
  ]


  new AtlasBasic(this, 'atlas-basic', {
      clusterProps: {
          replicationSpecs : replicationSpecs
      },
      projectProps: {
          orgId: orgId,
      },
      ipAccessListProps:{
        accessList:[
          { ipAddress: '0.0.0.0/0', comment: 'My first IP address' }
        ]
      }
    });
  }
}

The library also defines some default values for individual L1s.


const projectDefaults = {
        projectName: 'atlas-project-{random_num}',
    };


const dbDefaults = {
    dbName: 'admin',
    username: 'atlas-user',
    password: 'atlas-pwd',
    roles: [{
        roleName: 'atlasAdmin',
        databaseName: 'admin',
    }],
}
const clusterDefaults = {
    clusterName: 'atlas-cluster-{random_num}',
    clusterType: 'REPLICASET',
}

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

Feedback

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

License

Distributed under the Apache-2.0 License.# replace this

Keywords

atlas

FAQs

Package last updated on 17 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts