├── .eslintrc.json ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.md ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── code-health.yml │ ├── dependency-review.yml │ ├── issues.yml │ ├── package.yml │ ├── pull-request-lint.yml │ ├── release.yml │ ├── stale.yml │ └── upgrade-main.yml ├── .gitignore ├── .mergify.yml ├── .npmignore ├── .prettierignore ├── .prettierrc.json ├── .projen ├── deps.json ├── files.json └── tasks.json ├── .projenrc.js ├── .tool-versions ├── API.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── RELEASING.md ├── SECURITY.md ├── TESTING.md ├── cdk.json ├── examples ├── README.md ├── csharp │ ├── l1-resources │ │ └── project.cs │ ├── l2-resources │ │ └── datadog-integration.cs │ └── l3-resources │ │ └── atlas-basic.cs ├── golang │ ├── l1-resources │ │ └── project.go │ ├── l2-resources │ │ └── datadog-integration.go │ └── l3-resources │ │ └── atlas-basic.go ├── java │ ├── l1-resources │ │ └── Project.java │ ├── l2-resources │ │ └── EncryptionAtRest.java │ └── l3-resources │ │ └── AtlasBasic.java ├── l1-resources │ ├── access-list-api-key.ts │ ├── alert-configuration.ts │ ├── api-key.ts │ ├── auditing.ts │ ├── cloud-backup-restore-jobs.ts │ ├── cloud-backup-schedule.ts │ ├── cloud-backup-snapshot-export-bucket.ts │ ├── cloud-backup-snapshot.ts │ ├── cluster-outage-simulation.ts │ ├── cluster.ts │ ├── custom-db-role.ts │ ├── custom-dns-configutation-cluster-aws.ts │ ├── data-lake-pipeline.ts │ ├── database-user.ts │ ├── datalake.ts │ ├── encryption-at-rest.ts │ ├── federated-database-instance.ts │ ├── federation-query-limit.ts │ ├── federation-settings-org-role-mapping.ts │ ├── global-cluster-config.ts │ ├── ldap-configuration.ts │ ├── ldap-verify.ts │ ├── maintanance-windows.ts │ ├── network-container.ts │ ├── network-peering.ts │ ├── online-archive.ts │ ├── org-invitation.ts │ ├── organization.ts │ ├── private-endpoint-adl.ts │ ├── private-endpoint-regional-mode.ts │ ├── private-endpoint-v1-deprecated.ts │ ├── private-endpoint.ts │ ├── privatelink-endpoint-service-data-federation-online-archive.ts │ ├── project-invitation.ts │ ├── project-ip-access-list.ts │ ├── project.ts │ ├── resource-policy.ts │ ├── search-deployment.ts │ ├── search-index.ts │ ├── serverless-instance.ts │ ├── serverless-private-endpoints.ts │ ├── stream-connection-cluster.ts │ ├── stream-connection-sample.ts │ ├── stream-instance.ts │ ├── teams.ts │ ├── third-party-integration.ts │ ├── trigger.ts │ └── x509-authentication-db-user.ts ├── l2-resources │ ├── atlas-encryption-at-rest.ts │ └── third-party-integration.ts ├── l3-resources │ ├── atlas-basic-private-endpoint.ts │ ├── atlas-basic.ts │ ├── atlas-bootstrap.ts │ ├── atlas-serverless-basic.ts │ └── encryption-at-rest-express.ts ├── mern-cdk-ci-cd │ ├── .github │ │ └── workflows │ │ │ └── main.yaml │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── atlas-integ-infra │ │ ├── README.md │ │ ├── bin │ │ │ └── atlas-integ-infra.ts │ │ ├── cdk.json │ │ ├── lib │ │ │ └── atlas-integ-infra-stack.ts │ │ ├── out.json │ │ ├── package.json │ │ └── setup-env.sh │ ├── cdk-pipeline │ │ ├── README.md │ │ ├── bin │ │ │ └── cdk-pipeline.ts │ │ ├── cdk.json │ │ ├── lib │ │ │ └── cdk-pipeline-stack.ts │ │ └── package.json │ └── mern │ │ ├── client │ │ ├── cypress.json │ │ ├── cypress │ │ │ ├── fixtures │ │ │ │ └── example.json │ │ │ ├── integration │ │ │ │ └── endToEnd.spec.js │ │ │ ├── plugins │ │ │ │ └── index.js │ │ │ └── support │ │ │ │ ├── commands.js │ │ │ │ └── index.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ │ ├── favicon.ico │ │ │ ├── index.html │ │ │ ├── logo192.png │ │ │ ├── logo512.png │ │ │ ├── manifest.json │ │ │ └── robots.txt │ │ └── src │ │ │ ├── App.js │ │ │ ├── components │ │ │ ├── create.js │ │ │ ├── edit.js │ │ │ ├── navbar.js │ │ │ └── recordList.js │ │ │ └── index.js │ │ └── server │ │ ├── db │ │ └── conn.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── routes │ │ └── record.js │ │ ├── server.js │ │ ├── server.sh │ │ └── tests │ │ ├── api.integ.test.js │ │ └── api.unit.test.js ├── profile-secret.yaml └── python │ ├── l1-resources │ └── project.py │ ├── l2-resources │ └── datadog_integration.py │ └── l3-resources │ └── atlas_basic.py ├── package.json ├── scripts ├── cdk-all.sh ├── cdk.sh └── check-examples.sh ├── src ├── README.md ├── index.ts ├── l1-resources │ ├── access-list-api-key │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── alert-configuration │ │ ├── README.md │ │ └── index.ts │ ├── api-key │ │ ├── index.ts │ │ └── integ.default.ts │ ├── auditing │ │ ├── README.md │ │ └── index.ts │ ├── cloud-backup-restore-jobs │ │ ├── README.md │ │ └── index.ts │ ├── cloud-backup-schedule │ │ ├── README.md │ │ └── index.ts │ ├── cloud-backup-snapshot-export-bucket │ │ ├── README.md │ │ └── index.ts │ ├── cloud-backup-snapshot │ │ ├── README.md │ │ └── index.ts │ ├── cluster-outage-simulation │ │ ├── README.md │ │ └── index.ts │ ├── cluster │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── custom-db-role │ │ ├── README.md │ │ └── index.ts │ ├── custom-dns-configuration-cluster-aws │ │ ├── README.md │ │ └── index.ts │ ├── data-lake-pipeline │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── database-user │ │ ├── README.md │ │ └── index.ts │ ├── datalakes │ │ ├── README.md │ │ └── index.ts │ ├── encryption-at-rest │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── federated-database-instance │ │ └── index.ts │ ├── federated-query-limit │ │ └── index.ts │ ├── federated-settings-org-role-mapping │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── global-cluster-config │ │ ├── README.md │ │ └── index.ts │ ├── ldap-configuration │ │ ├── README.md │ │ └── index.ts │ ├── ldap-verify │ │ ├── README.md │ │ └── index.ts │ ├── maintenance-window │ │ ├── README.md │ │ └── index.ts │ ├── network-container │ │ ├── README.md │ │ └── index.ts │ ├── network-peering │ │ ├── README.md │ │ └── index.ts │ ├── online-archive │ │ ├── README.md │ │ └── index.ts │ ├── org-invitation │ │ ├── README.md │ │ └── index.ts │ ├── organization │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── private-endpoint-adl │ │ ├── README.md │ │ └── index.ts │ ├── private-endpoint-aws │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── private-endpoint-regional-mode │ │ ├── README.md │ │ └── index.ts │ ├── private-endpoint-service │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── private-endpoint │ │ ├── README.md │ │ └── index.ts │ ├── privatelink-endpoint-service-data-federation-online-archive │ │ └── index.ts │ ├── project-invitation │ │ ├── README.md │ │ └── index.ts │ ├── project-ip-access-list │ │ ├── README.md │ │ └── index.ts │ ├── project │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── resource-policy │ │ ├── README.md │ │ └── index.ts │ ├── search-deployment │ │ ├── README.md │ │ └── index.ts │ ├── search-index │ │ ├── README.md │ │ └── index.ts │ ├── serverless-instance │ │ ├── README.md │ │ └── index.ts │ ├── serverless-private-endpoint │ │ ├── README.md │ │ ├── index.ts │ │ └── integ.default.ts │ ├── stream-connection │ │ ├── README.md │ │ └── index.ts │ ├── stream-instance │ │ ├── README.md │ │ └── index.ts │ ├── teams │ │ ├── README.md │ │ └── index.ts │ ├── third-party-integration │ │ ├── README.md │ │ └── index.ts │ ├── trigger │ │ ├── README.md │ │ └── index.ts │ └── x509-authentication-database-user │ │ ├── README.md │ │ └── index.ts ├── l2-resources │ ├── encryption-at-rest │ │ ├── README.md │ │ └── index.ts │ └── third-party-integration │ │ ├── README.md │ │ ├── datadogIntegration.ts │ │ ├── index.ts │ │ ├── integ.default.ts │ │ ├── microsoftTeamsIntegration.ts │ │ ├── pagerDutyIntegration.ts │ │ ├── thirdPartyIntegrationBase.ts │ │ └── util.ts └── l3-resources │ ├── atlas-basic-private-endpoint │ ├── README.md │ ├── index.ts │ └── integ.default.ts │ ├── atlas-basic-serverless-private-endpoint │ ├── README.md │ ├── index.ts │ └── integ.default.ts │ ├── atlas-basic │ ├── .DS_Store │ ├── README.md │ ├── index.ts │ └── integ.default.ts │ ├── atlas-bootstrap │ ├── README.md │ ├── index.ts │ └── integ.default.ts │ ├── atlas-serverless-basic │ ├── index.ts │ └── integ.default.ts │ ├── common │ └── props.ts │ └── encryption-at-rest-express │ ├── README.md │ ├── index.ts │ └── integ.default.ts ├── test ├── l1-resources │ ├── access-list-api-key │ │ ├── README.md │ │ └── index.test.ts │ ├── alert-configuration │ │ └── README.md │ ├── api-key │ │ ├── README.md │ │ └── index.test.ts │ ├── auditing │ │ └── README.md │ ├── cloud-backup-restore-jobs │ │ ├── README.md │ │ └── index.test.ts │ ├── cloud-backup-schedule │ │ ├── README.md │ │ └── index.test.ts │ ├── cloud-backup-snapshot-export-bucket │ │ └── README.md │ ├── cloud-backup-snapshot │ │ ├── README.md │ │ └── index.test.ts │ ├── cluster-outage-simulation │ │ ├── README.md │ │ └── index.test.ts │ ├── clusters │ │ ├── README.md │ │ └── index.test.ts │ ├── custom-db-role │ │ └── README.md │ ├── custom-dns-configuration-cluster-aws │ │ └── README.md │ ├── data-lake-pipeline │ │ ├── README.md │ │ └── index.test.ts │ ├── database-user │ │ └── README.md │ ├── datalakes │ │ └── README.md │ ├── encryption-at-rest │ │ ├── README.md │ │ └── index.test.ts │ ├── federated-database-instance │ │ ├── README.md │ │ └── index.test.ts │ ├── federated-query-limit │ │ ├── README.md │ │ └── index.test.ts │ ├── federated-settings-org-role-mapping │ │ ├── README.md │ │ └── index.test.ts │ ├── global-cluster-config │ │ ├── README.md │ │ └── index.test.ts │ ├── ldap-configuration │ │ ├── README.md │ │ └── index.test.ts │ ├── ldap-verify │ │ ├── README.md │ │ └── index.test.ts │ ├── maintenance-window │ │ └── README.md │ ├── network-container │ │ └── README.md │ ├── network-peering │ │ └── README.md │ ├── online-archive │ │ └── README.md │ ├── org-invitation │ │ └── README.md │ ├── organization │ │ ├── README.md │ │ └── index.test.ts │ ├── private-endpoint-adl │ │ ├── README.md │ │ └── index.test.ts │ ├── private-endpoint-aws │ │ ├── README.md │ │ └── index.test.ts │ ├── private-endpoint-regional-mode │ │ ├── README.md │ │ └── index.test.ts │ ├── private-endpoint-service │ │ ├── README.md │ │ └── index.test.ts │ ├── private-endpoint │ │ └── README.md │ ├── privatelink-endpoint-service-data-federation-online-archive │ │ ├── README.md │ │ └── index.test.ts │ ├── project-invitation │ │ ├── README.md │ │ └── index.test.ts │ ├── project-ip-access-list │ │ └── README.md │ ├── project │ │ ├── README.md │ │ └── index.test.ts │ ├── resource-policy │ │ └── index.test.ts │ ├── search-deployment │ │ └── index.test.ts │ ├── search-index │ │ ├── README.md │ │ └── index.test.ts │ ├── serverless-instance │ │ ├── README.md │ │ └── index.test.ts │ ├── serverless-private-endpoint │ │ ├── README.md │ │ └── index.test.ts │ ├── stream-connection │ │ └── index.test.ts │ ├── stream-instance │ │ └── index.test.ts │ ├── teams │ │ ├── README.md │ │ └── index.test.ts │ ├── third-party-integration │ │ └── README.md │ ├── trigger │ │ ├── README.md │ │ └── index.test.ts │ └── x509-authentication-database-user │ │ ├── README.md │ │ └── index.test.ts ├── l2-resources │ ├── encryption-at-rest │ │ ├── README.md │ │ └── index.test.ts │ └── third-party-integration │ │ ├── README.md │ │ ├── constants.ts │ │ └── index.test.ts ├── l3-resources │ ├── atlas-basic │ │ ├── README.md │ │ └── index.test.ts │ ├── atlas-bootstrap │ │ ├── README.md │ │ └── index.test.ts │ ├── atlas-private-endpoint │ │ ├── README.md │ │ └── index.test.ts │ ├── atlas-serverless-basic │ │ ├── README.md │ │ └── index.test.ts │ └── encryption-at-rest-express │ │ ├── README.md │ │ └── index.test.ts └── readmeimages │ ├── federated-database-instance.png │ ├── federated-query-limit.png │ └── privatelink_endpoint.png ├── tsconfig.dev.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | * text=auto eol=lf 4 | *.snap linguist-generated 5 | /.eslintrc.json linguist-generated 6 | /.gitattributes linguist-generated 7 | /.github/pull_request_template.md linguist-generated 8 | /.gitignore linguist-generated 9 | /.mergify.yml linguist-generated 10 | /.npmignore linguist-generated 11 | /.prettierignore linguist-generated 12 | /.prettierrc.json linguist-generated 13 | /.projen/** linguist-generated 14 | /.projen/deps.json linguist-generated 15 | /.projen/files.json linguist-generated 16 | /.projen/tasks.json linguist-generated 17 | /API.md linguist-generated 18 | /cdk.json linguist-generated 19 | /LICENSE linguist-generated 20 | /package.json linguist-generated 21 | /tsconfig.dev.json linguist-generated 22 | /yarn.lock linguist-generated -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Maintained by the MongoDB APIx-Integrations team 2 | * @mongodb/APIx-Integrations 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report [Deprecated] 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Please complete the following information:** 27 | - CFN resource version 28 | - AWS region where you are running the CFN stack 29 | - CDK constructor type and version 30 | - Copy of the output of `cdk synth` 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: CFN/CDK Atlas Feature Request 4 | url: https://feedback.mongodb.com/forums/924145-atlas?category_id=392596 5 | about: Request a feature or up-vote an existing suggestion! 6 | - name: MongoDB Atlas Support 7 | url: https://support.mongodb.com/ 8 | about: Support is provided under MongoDB Atlas support plans. Please submit support questions within the Atlas UI. 9 | - name: MongoDB Atlas 10 | url: https://www.mongodb.com/cloud/atlas 11 | about: Learn more about MongoDB Atlas 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: weekly 7 | day: tuesday 8 | commit-message: 9 | prefix: "chore" 10 | reviewers: 11 | - "mongodb/apix-integrations" 12 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | # dependency-review-action scans pull requests for dependency changes, 2 | # and will raise an error if any vulnerabilities or invalid licenses are being introduced. 3 | # This action does not work for pushes to the main branch. 4 | --- 5 | name: Dependency Review 6 | on: 7 | pull_request: {} 8 | jobs: 9 | dependency-review: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Repository 13 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 14 | - name: Dependency Review 15 | uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 16 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Stale issues and PRs handler' 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 0 * * *' 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 13 | id: stale 14 | with: 15 | stale-issue-message: 'This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' 16 | stale-pr-message: 'This PR has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!' 17 | stale-issue-label: 'stale' 18 | stale-pr-label: 'stale' 19 | days-before-stale: 30 20 | days-before-close: 30 21 | exempt-pr-labels: 'not_stale' 22 | exempt-issue-labels: 'not_stale' 23 | 24 | -------------------------------------------------------------------------------- /.github/workflows/upgrade-main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Upgrade Dependencies 3 | on: 4 | workflow_dispatch: {} 5 | schedule: 6 | - cron: 0 9 * * 2 # every Tuesday at 9am 7 | permissions: 8 | contents: write 9 | pull-requests: write 10 | jobs: 11 | upgrade: 12 | name: Upgrade 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout 16 | uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 17 | - name: Setup Node.js 18 | uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 19 | with: 20 | node-version: 18.x 21 | - name: Install dependencies 22 | run: yarn install --check-files --frozen-lockfile 23 | - name: Upgrade dependencies 24 | run: npx projen upgrade 25 | - name: Set git identity & add files to commit 26 | run: | 27 | git config --local user.email svc-api-experience-integrations-escalation@mongodb.com 28 | git config --local user.name svc-apix-bot 29 | git add . 30 | - name: Create Pull Request 31 | uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e 32 | with: 33 | token: ${{ secrets.APIX_BOT_PAT }} 34 | title: "chore: Upgrade dependencies" 35 | commit-message: "Upgrade dependencies" 36 | delete-branch: true 37 | branch: upgrade-dependencies 38 | body: "Upgrades project dependencies. See details in [workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | !/.gitattributes 3 | !/.projen/tasks.json 4 | !/.projen/deps.json 5 | !/.projen/files.json 6 | !/package.json 7 | !/LICENSE 8 | !/.npmignore 9 | logs 10 | *.log 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | lerna-debug.log* 15 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 16 | pids 17 | *.pid 18 | *.seed 19 | *.pid.lock 20 | lib-cov 21 | coverage 22 | *.lcov 23 | .nyc_output 24 | build/Release 25 | node_modules/ 26 | jspm_packages/ 27 | *.tsbuildinfo 28 | .eslintcache 29 | *.tgz 30 | .yarn-integrity 31 | .cache 32 | /test-reports/ 33 | junit.xml 34 | /coverage/ 35 | /dist/changelog.md 36 | /dist/version.txt 37 | !/.mergify.yml 38 | !/.github/pull_request_template.md 39 | !/.prettierignore 40 | !/.prettierrc.json 41 | !/test/ 42 | !/tsconfig.dev.json 43 | !/src/ 44 | /lib 45 | /dist/ 46 | !/.eslintrc.json 47 | .jsii 48 | tsconfig.json 49 | !/API.md 50 | !/cdk.json 51 | cdk.out 52 | cdk.context.json 53 | yarn-error.log 54 | *.DS_Store 55 | examples-bin 56 | !/.projenrc.js 57 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | 3 | queue_rules: 4 | - name: default 5 | update_method: merge 6 | conditions: 7 | - "#approved-reviews-by>=1" 8 | - -label~=(do-not-merge) 9 | - status-success=build 10 | - status-success=package-js 11 | - status-success=package-java 12 | - status-success=package-python 13 | - status-success=package-dotnet 14 | - status-success=package-go 15 | merge_method: squash 16 | commit_message_template: |- 17 | {{ title }} (#{{ number }}) 18 | 19 | {{ body }} 20 | pull_request_rules: 21 | - name: Automatic merge on approval and successful build 22 | actions: 23 | delete_head_branch: {} 24 | queue: 25 | name: default 26 | conditions: 27 | - "#approved-reviews-by>=1" 28 | - -label~=(do-not-merge) 29 | - status-success=build 30 | - status-success=package-js 31 | - status-success=package-java 32 | - status-success=package-python 33 | - status-success=package-dotnet 34 | - status-success=package-go 35 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | /.projen/ 3 | /test-reports/ 4 | junit.xml 5 | /coverage/ 6 | permissions-backup.acl 7 | /dist/changelog.md 8 | /dist/version.txt 9 | /.mergify.yml 10 | /.prettierignore 11 | /.prettierrc.json 12 | /test/ 13 | /tsconfig.dev.json 14 | !/lib/ 15 | !/lib/**/*.js 16 | !/lib/**/*.d.ts 17 | dist 18 | /tsconfig.json 19 | /.github/ 20 | /.vscode/ 21 | /.idea/ 22 | /.projenrc.js 23 | tsconfig.tsbuildinfo 24 | /.eslintrc.json 25 | !.jsii 26 | cdk.out 27 | cdk.context.json 28 | yarn-error.log 29 | *.DS_Store 30 | examples-bin 31 | /src/ 32 | CONTRIBUTING.md 33 | TESTING.md 34 | CODE_OF_CONDUCT.md 35 | SECURITY.md 36 | cdk.json 37 | /scripts/ 38 | /examples/ 39 | /.gitattributes 40 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "overrides": [] 3 | } 4 | -------------------------------------------------------------------------------- /.projen/files.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | ".eslintrc.json", 4 | ".gitattributes", 5 | ".github/pull_request_template.md", 6 | ".gitignore", 7 | ".mergify.yml", 8 | ".prettierignore", 9 | ".prettierrc.json", 10 | ".projen/deps.json", 11 | ".projen/files.json", 12 | ".projen/tasks.json", 13 | "cdk.json", 14 | "LICENSE", 15 | "tsconfig.dev.json" 16 | ], 17 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 18 | } 19 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | nodejs 18.18.2 2 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | This project has adopted the [MongoDB Code of Conduct](https://www.mongodb.com/community-code-of-conduct). 4 | If you see any violations of the above or have any other concerns or questions please contact us 5 | using the following email alias: community-conduct@mongodb.com. 6 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Any security concerns or vulnerabilities discovered in one of MongoDB’s products or hosted services 6 | can be responsibly disclosed by utilizing one of the methods described in our [create a vulnerability report](https://docs.mongodb.com/manual/tutorial/create-a-vulnerability-report/) docs page. 7 | 8 | While we greatly appreciate community reports regarding security issues, at this time MongoDB does not provide compensation for vulnerability reports. 9 | -------------------------------------------------------------------------------- /cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts src/integ.default.ts", 3 | "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"." 4 | } 5 | -------------------------------------------------------------------------------- /examples/csharp/l1-resources/project.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Amazon.CDK; 3 | using Constructs; 4 | using MongoDB.AWSCDKResourcesMongoDBAtlas; 5 | using CfnProject = MongoDB.AWSCDKResourcesMongoDBAtlas.CfnProject; 6 | using CfnProjectProps = MongoDB.AWSCDKResourcesMongoDBAtlas.CfnProjectProps; 7 | using ProjectProps = MongoDB.AWSCDKResourcesMongoDBAtlas.ProjectProps; 8 | 9 | 10 | namespace CdkTestAppCsharp 11 | { 12 | public class CdkTestAppCsharpStack : Stack 13 | { 14 | internal CdkTestAppCsharpStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props) 15 | { 16 | var profile = (string) this.Node.TryGetContext("profile"); 17 | var orgId = (string) this.Node.TryGetContext("orgId"); 18 | var projectName = (string) this.Node.TryGetContext("projectName"); 19 | 20 | var proj = new CfnProject(this, "CfnProject-l1", 21 | new CfnProjectProps { Name = projectName, 22 | Profile = profile, 23 | OrgId = orgId }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/csharp/l2-resources/datadog-integration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Amazon.CDK; 3 | using Constructs; 4 | using MongoDB.AWSCDKResourcesMongoDBAtlas; 5 | 6 | 7 | namespace CdkTestAppCsharp 8 | { 9 | public class CdkTestAppCsharpStack : Stack 10 | { 11 | internal CdkTestAppCsharpStack(Construct scope, string id, IStackProps props = null) : base(scope, id, props) 12 | { 13 | var apiKey = (string) this.Node.TryGetContext("apiKey"); 14 | var profile = (string) this.Node.TryGetContext("profile"); 15 | var projectId = (string) this.Node.TryGetContext("projectId"); 16 | 17 | var ddi = new DatadogIntegration(this, "DatadogIntegration-l2", new DatadogIntegrationProps 18 | { 19 | ApiKey = apiKey, 20 | Profile = profile, 21 | ProjectId = projectId, 22 | Region = DatadogRegion.US 23 | }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/golang/l1-resources/project.go: -------------------------------------------------------------------------------- 1 | package l1_resources 2 | 3 | import ( 4 | mdb "github.com/mongodb/awscdk-resources-mongodbatlas-go/awscdkresourcesmongodbatlas" 5 | ) 6 | 7 | const ( 8 | ORG_ID = "ORG_ID_HERE" 9 | PROFILE = "PROFILE_HERE" 10 | PROJECT_NAME = "PROJECT_NAME_HERE" 11 | ) 12 | 13 | type CdkTestAppGoStackProps struct { 14 | awscdk.StackProps 15 | } 16 | 17 | func NewCdkTestAppGoStack(scope constructs.Construct, id string, props *CdkTestAppGoStackProps) awscdk.Stack { 18 | var sprops awscdk.StackProps 19 | if props != nil { 20 | sprops = props.StackProps 21 | } 22 | stack := awscdk.NewStack(scope, &id, &sprops) 23 | 24 | profile := getContextProp(stack.Node(), PROFILE) 25 | orgId := getContextProp(stack.Node(), ORG_ID) 26 | projectName := getContextProp(stack.Node(), PROJECT_NAME) 27 | 28 | mdb.NewCfnProject(stack, jsii.String("CfnProject-go"), &mdb.CfnProjectProps{ 29 | Name: jsii.String(projectName), 30 | OrgId: jsii.String(orgId), 31 | Profile: jsii.String(profile), 32 | }) 33 | 34 | return stack 35 | } 36 | 37 | func getContextProp(pNode constructs.Node, propName string) string { 38 | ctxValue := pNode.TryGetContext(jsii.String(propName)) 39 | if v, ok := ctxValue.(string); ok { 40 | return v 41 | } 42 | return "" 43 | } 44 | -------------------------------------------------------------------------------- /examples/golang/l2-resources/datadog-integration.go: -------------------------------------------------------------------------------- 1 | package l2_resources 2 | 3 | import ( 4 | mdb "github.com/mongodb/awscdk-resources-mongodbatlas-go/awscdkresourcesmongodbatlas" 5 | ) 6 | 7 | const ( 8 | PROFILE = "PROFILE_HERE" 9 | PROJECT_ID = "PROJECT_ID_HERE" 10 | API_KEY = "API_KEY_HERE" 11 | ) 12 | 13 | type CdkTestAppGoStackProps struct { 14 | awscdk.StackProps 15 | } 16 | 17 | func NewCdkTestAppGoStack(scope constructs.Construct, id string, props *CdkTestAppGoStackProps) awscdk.Stack { 18 | var sprops awscdk.StackProps 19 | if props != nil { 20 | sprops = props.StackProps 21 | } 22 | stack := awscdk.NewStack(scope, &id, &sprops) 23 | 24 | profile := getContextProp(stack.Node(), PROFILE) 25 | orgId := getContextProp(stack.Node(), ORG_ID) 26 | projectId := getContextProp(stack.Node(), PROJECT_ID) 27 | apiKey := getContextProp(stack.Node(), API_KEY) 28 | 29 | ddProps := mdb.DatadogIntegrationProps{ 30 | ProjectId: jsii.String(projectId), 31 | ApiKey: jsii.String(apiKey), 32 | Region: mdb.DatadogRegion_US, 33 | Profile: jsii.String(profile), 34 | } 35 | mdb.NewDatadogIntegration(stack, jsii.String("DatadogIntegration-go"), &ddProps) 36 | 37 | return stack 38 | } 39 | 40 | func getContextProp(pNode constructs.Node, propName string) string { 41 | ctxValue := pNode.TryGetContext(jsii.String(propName)) 42 | if v, ok := ctxValue.(string); ok { 43 | return v 44 | } 45 | return "" 46 | } 47 | -------------------------------------------------------------------------------- /examples/java/l1-resources/Project.java: -------------------------------------------------------------------------------- 1 | package com.myorg; 2 | 3 | import java.util.List; 4 | import org.jetbrains.annotations.NotNull; 5 | import software.constructs.Construct; 6 | import software.amazon.awscdk.Stack; 7 | import software.amazon.awscdk.StackProps; 8 | import org.mongodb.awscdk.resources.mongodbatlas.*; 9 | import software.constructs.Node; 10 | 11 | 12 | public class CdkJavaStack extends Stack { 13 | final static String ORG_ID = "ORG_ID"; 14 | final static String PROFILE = "PROFILE"; 15 | final static String PROJECT_NAME = "PROJECT_NAME"; 16 | 17 | 18 | public CdkJavaStack(final Construct scope, final String id, final StackProps props) { 19 | super(scope, id, props); 20 | 21 | final String profile = getContextProp(this.getNode(), PROFILE); 22 | final String projectName = getContextProp(this.getNode(), PROJECT_NAME); 23 | final String orgId = getContextProp(this.getNode(), ORG_ID); 24 | 25 | final CfnProject myProj = CfnProject.Builder.create(this, "myProject") 26 | .name(projectName) 27 | .orgId(orgId) 28 | .profile(profile) 29 | .build(); 30 | } 31 | 32 | public String getContextProp(final Node pNode, final String pPropName){ 33 | @NotNull final Object obj = pNode.tryGetContext(pPropName); 34 | if (obj.toString().isEmpty()) { 35 | return ""; 36 | } 37 | return obj.toString(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/java/l2-resources/EncryptionAtRest.java: -------------------------------------------------------------------------------- 1 | package com.myorg; 2 | 3 | import java.util.List; 4 | import org.jetbrains.annotations.NotNull; 5 | import software.constructs.Construct; 6 | import software.amazon.awscdk.Stack; 7 | import software.amazon.awscdk.StackProps; 8 | import org.mongodb.awscdk.resources.mongodbatlas.*; 9 | import software.constructs.Node; 10 | 11 | 12 | public class CdkJavaStack extends Stack { 13 | final static String PROJECT_ID = "PROJECT_ID"; 14 | final static String PROFILE = "PROFILE"; 15 | final static String ROLE_ID = "ROLE_ID"; 16 | final static String MASTER_KEY_ID = "MASTER_KEY_ID"; 17 | 18 | 19 | public CdkJavaStack(final Construct scope, final String id, final StackProps props) { 20 | super(scope, id, props); 21 | 22 | final String profile = getContextProp(this.getNode(), PROFILE); 23 | final String roleId = getContextProp(this.getNode(), ROLE_ID); 24 | final String projectId = getContextProp(this.getNode(), PROJECT_ID); 25 | final String customerMasterKeyId = getContextProp(this.getNode(), MASTER_KEY_ID); 26 | 27 | final AtlasEncryptionAtRest encryptionAtRest = AtlasEncryptionAtRest.Builder.create(this, "encryptionAtRest") 28 | .profile(profile) 29 | .projectId(projectId) 30 | .region(this.getRegion()) 31 | .customerMasterKeyId(customerMasterKeyId) 32 | .roleId(roleId) 33 | .build(); 34 | } 35 | 36 | public String getContextProp(final Node pNode, final String pPropName){ 37 | @NotNull final Object obj = pNode.tryGetContext(pPropName); 38 | if (obj.toString().isEmpty()) { 39 | return ""; 40 | } 41 | return obj.toString(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /examples/l1-resources/alert-configuration.ts: -------------------------------------------------------------------------------- 1 | // This example creates an alert in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { 5 | CfnAlertConfiguration, NotificationViewTypeName, MetricThresholdViewOperator, MetricThresholdViewMode 6 | } from 'awscdk-resources-mongodbatlas'; 7 | 8 | interface AtlasStackProps { 9 | readonly projectId: string; 10 | readonly profile: string; 11 | readonly email: string; 12 | } 13 | 14 | export class CdkTestingStack extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | 20 | 21 | const alert = new CfnAlertConfiguration(this, 'MyAlert', { 22 | profile: atlasProps.profile, 23 | projectId: atlasProps.projectId, 24 | eventTypeName: 'OUTSIDE_METRIC_THRESHOLD', 25 | notifications: [{ 26 | typeName: NotificationViewTypeName.EMAIL, 27 | delayMin: 0, 28 | emailAddress: atlasProps.email, 29 | emailEnabled: true, 30 | intervalMin: 15 31 | }], 32 | metricThreshold: { 33 | metricName: 'NORMALIZED_SYSTEM_CPU_USER', 34 | operator: MetricThresholdViewOperator.GREATER_THAN, 35 | threshold: 5, 36 | units: 'RAW', 37 | mode: MetricThresholdViewMode.AVERAGE, 38 | } 39 | }); 40 | 41 | } 42 | 43 | getContextProps(): AtlasStackProps { 44 | const profile = this.node.tryGetContext('profile') ?? 'default'; 45 | const email = this.node.tryGetContext('email') ?? 'test@test.com'; 46 | const projectId = this.node.tryGetContext('projectId') 47 | 48 | return { 49 | projectId, 50 | profile, 51 | email 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /examples/l1-resources/auditing.ts: -------------------------------------------------------------------------------- 1 | // This example sets up auditing in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnAuditing } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | } 10 | 11 | export class CdkTestingStack extends cdk.Stack { 12 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 13 | super(scope, id, props); 14 | 15 | const atlasProps = this.getContextProps(); 16 | 17 | const auditing = new CfnAuditing(this, 'Auditing', { 18 | projectId: atlasProps.projId, 19 | profile: atlasProps.profile, 20 | }); 21 | 22 | } 23 | 24 | getContextProps(): AtlasStackProps { 25 | const projId = this.node.tryGetContext('projId'); 26 | if (!projId) { 27 | throw "No context value specified for projId. Please specify via the cdk context." 28 | } 29 | 30 | const profile = this.node.tryGetContext('profile') ?? 'default'; 31 | 32 | return { 33 | projId, 34 | profile 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/l1-resources/cloud-backup-snapshot-export-bucket.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnCloudBackupSnapshotExportBucket } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly bucketName: string; 9 | readonly iamRoleId: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | 18 | const cloudBackupSnapshotExportBucket = new CfnCloudBackupSnapshotExportBucket(this, 'CloudBackupSnapshotExportBucket', { 19 | profile: atlasProps.profile, 20 | projectId: atlasProps.projId, 21 | bucketName: atlasProps.bucketName, 22 | iamRoleId: atlasProps.iamRoleId, 23 | }); 24 | } 25 | 26 | getContextProps(): AtlasStackProps { 27 | const projId = this.node.tryGetContext('projId'); 28 | if (!projId){ 29 | throw "No context value specified for projId. Please specify via the cdk context." 30 | } 31 | const bucketName = this.node.tryGetContext('bucketName'); 32 | const profile = this.node.tryGetContext('profile') ?? 'default'; 33 | const iamRoleId = this.node.tryGetContext('iamRoleId'); 34 | const retentionInDays = this.node.tryGetContext('retentionInDays'); 35 | 36 | 37 | return { 38 | projId, 39 | profile, 40 | bucketName, 41 | iamRoleId, 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/l1-resources/cloud-backup-snapshot.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnCloudBackupSnapshot, CfnCloudBackupSnapshotPropsInstanceType } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly retentionInDays: number; 9 | readonly clusterName: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | 18 | new CfnCloudBackupSnapshot(this, 'CloudBackupSnapshot', { 19 | instanceName: atlasProps.clusterName, 20 | instanceType: CfnCloudBackupSnapshotPropsInstanceType.CLUSTER, 21 | profile: atlasProps.profile, 22 | projectId: atlasProps.projId, 23 | description: 'Snapshot created with CDK', 24 | retentionInDays: atlasProps.retentionInDays, 25 | }); 26 | 27 | } 28 | 29 | getContextProps(): AtlasStackProps { 30 | const projId = this.node.tryGetContext('projId'); 31 | if (!projId) { 32 | throw "No context value specified for projId. Please specify via the cdk context." 33 | } 34 | const retentionValue = this.node.tryGetContext('retentionValue'); 35 | const profile = this.node.tryGetContext('profile') ?? 'default'; 36 | const clusterName = this.node.tryGetContext('clusterName'); 37 | const retentionInDays = this.node.tryGetContext('retentionInDays'); 38 | 39 | 40 | return { 41 | projId, 42 | profile, 43 | retentionInDays, 44 | clusterName, 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/l1-resources/custom-db-role.ts: -------------------------------------------------------------------------------- 1 | // This example creates a project and a cluster in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnCustomDbRole } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly roleName: string; 10 | readonly dbName: string; 11 | readonly collectionName: string; 12 | } 13 | 14 | export class CdkTestingStack extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | const customDbRole = new CfnCustomDbRole(this, 'CustomDbRole', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | actions:[ 23 | { 24 | action: "FIND", 25 | resources: [ 26 | { 27 | collection: atlasProps.collectionName, 28 | db: atlasProps.dbName, 29 | }, 30 | ] 31 | } 32 | ], 33 | roleName: atlasProps.roleName, 34 | }); 35 | 36 | } 37 | 38 | getContextProps(): AtlasStackProps { 39 | const projId = this.node.tryGetContext('projId'); 40 | if (!projId){ 41 | throw "No context value specified for projId. Please specify via the cdk context." 42 | } 43 | const roleName = this.node.tryGetContext('roleName'); 44 | const profile = this.node.tryGetContext('profile') ?? 'default'; 45 | const dbName = this.node.tryGetContext('dbName'); 46 | const collectionName = this.node.tryGetContext('collectionName'); 47 | 48 | 49 | return { 50 | projId, 51 | profile, 52 | roleName, 53 | dbName, 54 | collectionName 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /examples/l1-resources/custom-dns-configutation-cluster-aws.ts: -------------------------------------------------------------------------------- 1 | // This example creates a project in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnCustomDnsConfigurationClusterAws } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | } 10 | 11 | export class CdkTestingStack extends cdk.Stack { 12 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 13 | super(scope, id, props); 14 | 15 | const atlasProps = this.getContextProps(); 16 | 17 | const projectRes = new CfnCustomDnsConfigurationClusterAws(this, 'ProjectResource', { 18 | projectId: atlasProps.projId, 19 | profile: atlasProps.profile, 20 | enabled: true 21 | }); 22 | 23 | } 24 | 25 | getContextProps(): AtlasStackProps { 26 | const projId = this.node.tryGetContext('projId'); 27 | if (!projId){ 28 | throw "No context value specified for orgId. Please specify via the cdk context." 29 | } 30 | 31 | const profile = this.node.tryGetContext('profile') ?? 'default'; 32 | 33 | return { 34 | projId, 35 | profile 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /examples/l1-resources/encryption-at-rest.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnEncryptionAtRest } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly region: string; 9 | readonly customerMasterKeyId: string; 10 | readonly roleId: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | const encryptionAtRest = new CfnEncryptionAtRest(this, 'EncryptionAtRest', { 19 | projectId: atlasProps.projId, 20 | profile: atlasProps.profile, 21 | awsKmsConfig: { 22 | enabled: true, 23 | region: atlasProps.region, 24 | customerMasterKeyId: atlasProps.customerMasterKeyId, 25 | roleId: atlasProps.roleId 26 | }, 27 | }); 28 | } 29 | 30 | getContextProps(): AtlasStackProps { 31 | const projId = this.node.tryGetContext('projId'); 32 | if (!projId) { 33 | throw "No context value specified for projId. Please specify via the cdk context." 34 | } 35 | 36 | const profile = this.node.tryGetContext('profile') ?? 'default'; 37 | const customerMasterKeyId = this.node.tryGetContext('customerMasterKeyId'); 38 | const region = this.node.tryGetContext('region'); 39 | const roleId = this.node.tryGetContext('roleId'); 40 | 41 | return { 42 | projId, 43 | profile, 44 | region, 45 | customerMasterKeyId, 46 | roleId 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/l1-resources/federated-database-instance.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnFederatedSettingsOrgRoleMapping } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly profile: string; 7 | readonly orgId: string; 8 | readonly externalGroupName: string; 9 | readonly federationSettingsId: string; 10 | } 11 | 12 | const UNDEFINED = "UNDEFINED"; 13 | 14 | export class CDKFederatedDatabaseInstanceExample extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | const federatedDatabaseInstance = new CfnFederatedSettingsOrgRoleMapping(this, 'FederatedDatabaseInstance', { 20 | profile: atlasProps.profile, 21 | orgId: atlasProps.orgId, 22 | externalGroupName: atlasProps.externalGroupName, 23 | federationSettingsId: atlasProps.federationSettingsId 24 | }); 25 | 26 | new cdk.CfnOutput(this, "ID", { 27 | value: (federatedDatabaseInstance.attrId ?? UNDEFINED).toString(), 28 | exportName: "ID", 29 | }); 30 | } 31 | 32 | getContextProps(): AtlasStackProps { 33 | const orgId = this.node.tryGetContext('projId'); 34 | if (!orgId) { 35 | throw "No context value specified for projId. Please specify via the cdk context." 36 | } 37 | 38 | const profile = this.node.tryGetContext('profile') ?? 'default'; 39 | const externalGroupName = this.node.tryGetContext('externalGroupName'); 40 | const federationSettingsId = this.node.tryGetContext('federationSettingsId'); 41 | 42 | return { 43 | profile, 44 | orgId, 45 | externalGroupName, 46 | federationSettingsId 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/l1-resources/federation-query-limit.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnFederatedQueryLimit, CfnFederatedQueryLimitPropsLimitName } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projectId: string; 7 | readonly profile: string; 8 | readonly role: string; 9 | readonly tenantName: string; 10 | readonly limitName: CfnFederatedQueryLimitPropsLimitName; 11 | readonly value: string; 12 | } 13 | 14 | export class CdkTestingStack extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | new CfnFederatedQueryLimit(this, 'Federation', { 20 | profile: atlasProps.profile, 21 | projectId: atlasProps.projectId, 22 | tenantName: atlasProps.tenantName, 23 | limitName: atlasProps.limitName, 24 | value: atlasProps.value 25 | }); 26 | } 27 | 28 | getContextProps(): AtlasStackProps { 29 | const projectId = this.node.tryGetContext('projId'); 30 | if (!projectId) { 31 | throw "No context value specified for projId. Please specify via the cdk context." 32 | } 33 | 34 | const profile = this.node.tryGetContext('profile') ?? 'default'; 35 | const role = this.node.tryGetContext('role'); 36 | const tenantName = this.node.tryGetContext('tenantName'); 37 | const limitName = this.node.tryGetContext('limitName') ?? CfnFederatedQueryLimitPropsLimitName.BYTES_PROCESSED_QUERY; 38 | const value = this.node.tryGetContext("value") ?? "2000000000" 39 | return { 40 | projectId, 41 | profile, 42 | role, 43 | tenantName, 44 | limitName, 45 | value 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /examples/l1-resources/federation-settings-org-role-mapping.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnFederatedSettingsOrgRoleMapping } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly orgId: string; 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly groupName: string; 10 | readonly role: string; 11 | readonly federationSettingsId: string; 12 | } 13 | 14 | export class CdkTestingStack extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | const federationSettings = new CfnFederatedSettingsOrgRoleMapping(this, 'FederationSettings', { 20 | profile: atlasProps.profile, 21 | orgId: atlasProps.projId, 22 | externalGroupName: atlasProps.groupName, 23 | roleAssignments: [ 24 | { 25 | role: atlasProps.role, 26 | projectId: atlasProps.projId 27 | } 28 | ], 29 | federationSettingsId: atlasProps.federationSettingsId 30 | }); 31 | } 32 | 33 | getContextProps(): AtlasStackProps { 34 | const projId = this.node.tryGetContext('projId'); 35 | if (!projId){ 36 | throw "No context value specified for projId. Please specify via the cdk context." 37 | } 38 | 39 | const profile = this.node.tryGetContext('profile') ?? 'default'; 40 | const groupName = this.node.tryGetContext('groupName'); 41 | const orgId = this.node.tryGetContext('orgId'); 42 | const role = this.node.tryGetContext('role'); 43 | const federationSettingsId = this.node.tryGetContext('federationSettingsId'); 44 | return { 45 | orgId, 46 | projId, 47 | profile, 48 | groupName, 49 | role, 50 | federationSettingsId 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /examples/l1-resources/ldap-verify.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnLdapVerify } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly bindUsername: string; 9 | readonly bindPassword: string; 10 | readonly hostName: string; 11 | readonly port: number; 12 | } 13 | 14 | export class CdkTestingStack extends cdk.Stack { 15 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 16 | super(scope, id, props); 17 | 18 | const atlasProps = this.getContextProps(); 19 | const ldapConfig = new CfnLdapVerify(this, 'CfnLdapConfiguration', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | bindPassword: atlasProps.bindPassword, 23 | bindUsername: atlasProps.bindUsername, 24 | hostName: atlasProps.hostName, 25 | port: atlasProps.port 26 | }); 27 | 28 | } 29 | 30 | getContextProps(): AtlasStackProps { 31 | const projId = this.node.tryGetContext('projId'); 32 | if (!projId) { 33 | throw "No context value specified for orgId. Please specify via the cdk context." 34 | } 35 | 36 | const profile = this.node.tryGetContext('profile') ?? 'default'; 37 | const bindUsername = this.node.tryGetContext('bindUsername'); 38 | const bindPassword = this.node.tryGetContext('bindPassword'); 39 | const hostName = this.node.tryGetContext('hostName'); 40 | const port = this.node.tryGetContext('port'); 41 | 42 | return { 43 | projId, 44 | profile, 45 | bindUsername, 46 | bindPassword, 47 | hostName, 48 | port 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /examples/l1-resources/maintanance-windows.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnMaintenanceWindow } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly dayOfWeek: number; 9 | readonly hourOfDay: number; 10 | readonly autoDeferOnceEnabled: boolean; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | const myMaintenanceWindow = new CfnMaintenanceWindow(this, 'MyMaintenanceWindow', { 19 | projectId: atlasProps.projId, 20 | profile: atlasProps.profile, 21 | dayOfWeek: atlasProps.dayOfWeek, 22 | hourOfDay: atlasProps.hourOfDay, 23 | autoDeferOnceEnabled: atlasProps.autoDeferOnceEnabled, 24 | }); 25 | } 26 | 27 | getContextProps(): AtlasStackProps { 28 | const projId = this.node.tryGetContext('projId'); 29 | if (!projId) { 30 | throw "No context value specified for orgId. Please specify via the cdk context." 31 | } 32 | 33 | const profile = this.node.tryGetContext('profile') ?? 'default'; 34 | const dayOfWeek = this.node.tryGetContext('dayOfWeek'); 35 | const hourOfDay = this.node.tryGetContext('hourOfDay'); 36 | const autoDeferOnceEnabled = this.node.tryGetContext('autoDeferOnceEnabled'); 37 | 38 | return { 39 | projId, 40 | profile, 41 | dayOfWeek, 42 | hourOfDay, 43 | autoDeferOnceEnabled 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /examples/l1-resources/network-container.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnNetworkContainer } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly atlasCidrBlock: string; 9 | readonly region: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | 18 | const myNetworkContainer = new CfnNetworkContainer(this, 'MyNetworkContainer', { 19 | projectId: atlasProps.projId, 20 | profile: atlasProps.profile, 21 | atlasCidrBlock: atlasProps.atlasCidrBlock, 22 | regionName: atlasProps.region, 23 | }); 24 | 25 | } 26 | 27 | getContextProps(): AtlasStackProps { 28 | const projId = this.node.tryGetContext('projId'); 29 | if (!projId){ 30 | throw "No context value specified for orgId. Please specify via the cdk context." 31 | } 32 | 33 | const profile = this.node.tryGetContext('profile') ?? 'default'; 34 | const atlasCidrBlock = this.node.tryGetContext('atlasCidrBlock'); 35 | const region = this.node.tryGetContext('region'); 36 | 37 | return { 38 | projId, 39 | profile, 40 | atlasCidrBlock, 41 | region 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/l1-resources/org-invitation.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnOrgInvitation, CfnOrgInvitationPropsRoles } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly orgId: string; 8 | readonly profile: string; 9 | readonly username: string; 10 | readonly teamId: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | const myOrgInvitation = new CfnOrgInvitation(this, 'MyOrgInvitation', { 20 | orgId: atlasProps.orgId, 21 | profile: atlasProps.profile, 22 | username: atlasProps.username, 23 | teamIds: [atlasProps.teamId], 24 | roles: [CfnOrgInvitationPropsRoles.GROUP_CLUSTER_MANAGER] 25 | }); 26 | } 27 | 28 | getContextProps(): AtlasStackProps { 29 | const orgId = this.node.tryGetContext('orgId'); 30 | if (!orgId){ 31 | throw "No context value specified for orgId. Please specify via the cdk context." 32 | } 33 | const username = this.node.tryGetContext('projName') ?? 'test-proj'; 34 | const profile = this.node.tryGetContext('profile') ?? 'default'; 35 | const teamId = this.node.tryGetContext('profile') ?? 'default'; 36 | 37 | return { 38 | orgId, 39 | profile, 40 | username, 41 | teamId 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/l1-resources/organization.ts: -------------------------------------------------------------------------------- 1 | 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnOrganization } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly orgOwnerId: string; 8 | readonly profile: string; 9 | readonly name: string; 10 | readonly awsSecretName: string; 11 | } 12 | 13 | interface apiKey { 14 | readonly roles: string[]; 15 | readonly description: string; 16 | } 17 | 18 | export class CdkTestingStack extends cdk.Stack { 19 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 20 | super(scope, id, props); 21 | 22 | const atlasProps = this.getContextProps(); 23 | 24 | const myOrg = new CfnOrganization(this, 'MyOrganization', { 25 | orgOwnerId: atlasProps.orgOwnerId, 26 | profile: atlasProps.profile, 27 | name: atlasProps.name, 28 | awsSecretName: atlasProps.awsSecretName, 29 | apiKey: { 30 | roles: ["ORG_OWNER"], 31 | description: "test-cdk" 32 | } 33 | 34 | }); 35 | } 36 | 37 | getContextProps(): AtlasStackProps { 38 | const orgOwnerId = this.node.tryGetContext('orgOwnerId'); 39 | if (!orgOwnerId) { 40 | throw "No context value specified for orgOwnerId. Please specify via the cdk context." 41 | } 42 | const name = this.node.tryGetContext('name') ?? 'test-org-cdk'; 43 | const awsSecretName = this.node.tryGetContext('awsSecretName') ?? 'cfn/atlas/profile/org-retest'; 44 | const profile = this.node.tryGetContext('profile') ?? 'default'; 45 | 46 | return { 47 | orgOwnerId, 48 | profile, 49 | name, 50 | awsSecretName, 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /examples/l1-resources/private-endpoint-adl.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnPrivateEndpointAdl } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly type: string; 9 | readonly endpointId: string; 10 | readonly comment: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | const myPrivateEndpointAdl = new CfnPrivateEndpointAdl(this, 'MyPrivateEndpointAdl', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | provider: 'AWS', 23 | type: atlasProps.type, 24 | endpointId: atlasProps.endpointId, 25 | comment: atlasProps.comment, 26 | }); 27 | } 28 | 29 | getContextProps(): AtlasStackProps { 30 | const projId = this.node.tryGetContext('projId'); 31 | if (!projId){ 32 | throw "No context value specified for orgId. Please specify via the cdk context." 33 | } 34 | 35 | const profile = this.node.tryGetContext('profile') ?? 'default'; 36 | const type = this.node.tryGetContext('type'); 37 | const endpointId = this.node.tryGetContext('endpointId'); 38 | const comment = this.node.tryGetContext('comment'); 39 | 40 | 41 | return { 42 | projId, 43 | profile, 44 | type, 45 | endpointId, 46 | comment, 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/l1-resources/private-endpoint-regional-mode.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnPrivateEndPointRegionalMode } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | } 9 | 10 | export class CdkTestingStack extends cdk.Stack { 11 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 12 | super(scope, id, props); 13 | 14 | const atlasProps = this.getContextProps(); 15 | const myPrivateEndpointAdl = new CfnPrivateEndPointRegionalMode(this, 'MyPrivateEndpointAdl', { 16 | projectId: atlasProps.projId, 17 | profile: atlasProps.profile, 18 | }); 19 | } 20 | 21 | getContextProps(): AtlasStackProps { 22 | const projId = this.node.tryGetContext('projId'); 23 | if (!projId){ 24 | throw "No context value specified for projId. Please specify via the cdk context." 25 | } 26 | 27 | const profile = this.node.tryGetContext('profile') ?? 'default'; 28 | 29 | 30 | return { 31 | projId, 32 | profile, 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/l1-resources/private-endpoint-v1-deprecated.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnPrivateEndpoint } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly region: string; 9 | readonly vpcId: string; 10 | readonly subnetId: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | new CfnPrivateEndpoint(this, "privateEndpoint", { 20 | groupId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | region: atlasProps.region, 23 | privateEndpoints: [ 24 | { 25 | vpcId: atlasProps.vpcId, 26 | subnetIds: [atlasProps.subnetId] 27 | } 28 | ], 29 | }); 30 | } 31 | 32 | getContextProps(): AtlasStackProps { 33 | const projId = this.node.tryGetContext('projId'); 34 | if (!projId) { 35 | throw "No context value specified for orgId. Please specify via the cdk context." 36 | } 37 | 38 | const profile = this.node.tryGetContext('profile') ?? 'default'; 39 | const region = this.node.tryGetContext('region'); 40 | const vpcId = this.node.tryGetContext('vpcId'); 41 | const subnetId = this.node.tryGetContext('comment'); 42 | 43 | 44 | return { 45 | projId, 46 | profile, 47 | region, 48 | vpcId, 49 | subnetId, 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /examples/l1-resources/privatelink-endpoint-service-data-federation-online-archive.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnPrivatelinkEndpointServiceDataFederationOnlineArchive } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly endpointId: string; 8 | readonly profile: string; 9 | } 10 | 11 | export class CDKFederatedDatabaseInstanceExample extends cdk.Stack { 12 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 13 | super(scope, id, props); 14 | 15 | const atlasProps = this.getContextProps(); 16 | const federatedDatabaseInstance = new CfnPrivatelinkEndpointServiceDataFederationOnlineArchive(this, 'FederatedDatabaseInstance', { 17 | projectId: atlasProps.projId, 18 | endpointId: atlasProps.endpointId, 19 | type: "DATA_LAKE", 20 | comment: "online-archive-private-link-endpoint", 21 | profile: atlasProps.profile, 22 | }); 23 | } 24 | 25 | getContextProps(): AtlasStackProps { 26 | const projId = this.node.tryGetContext('projId'); 27 | if (!projId){ 28 | throw "No context value specified for projId. Please specify via the cdk context." 29 | } 30 | 31 | const endpointId = this.node.tryGetContext('endpointId'); 32 | const profile = this.node.tryGetContext('profile') ?? 'default'; 33 | 34 | return { 35 | projId, 36 | endpointId, 37 | profile 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/l1-resources/project-invitation.ts: -------------------------------------------------------------------------------- 1 | // This example creates a database user in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnProjectInvitation, CfnProjectInvitationPropsRoles } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly username: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | 18 | const myProjectInvitation = new CfnProjectInvitation(this, 'MyProjectInvitation', { 19 | projectId: atlasProps.projId, 20 | profile: atlasProps.profile, 21 | username: atlasProps.username, 22 | roles: [CfnProjectInvitationPropsRoles.GROUP_OWNER] 23 | }); 24 | } 25 | 26 | getContextProps(): AtlasStackProps { 27 | const projId = this.node.tryGetContext('projId'); 28 | if (!projId){ 29 | throw "No context value specified for projId. Please specify via the cdk context." 30 | } 31 | 32 | const profile = this.node.tryGetContext('profile') ?? 'default'; 33 | const username = this.node.tryGetContext('username'); 34 | 35 | 36 | return { 37 | projId, 38 | profile, 39 | username, 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /examples/l1-resources/project-ip-access-list.ts: -------------------------------------------------------------------------------- 1 | // This example creates a database user in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnProjectIpAccessList } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly ip: string; 10 | readonly comment: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | const myProjectIpAccessList = new CfnProjectIpAccessList(this, 'MyCfnProjectIpAccessList', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | accessList: [ 23 | { 24 | ipAddress: atlasProps.ip, 25 | comment: atlasProps.comment 26 | } 27 | ] 28 | }); 29 | } 30 | 31 | getContextProps(): AtlasStackProps { 32 | const projId = this.node.tryGetContext('projId'); 33 | if (!projId){ 34 | throw "No context value specified for projId. Please specify via the cdk context." 35 | } 36 | 37 | const profile = this.node.tryGetContext('profile') ?? 'default'; 38 | const ip = this.node.tryGetContext('ip'); 39 | const comment = this.node.tryGetContext('comment'); 40 | 41 | 42 | return { 43 | projId, 44 | profile, 45 | ip, 46 | comment 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /examples/l1-resources/resource-policy.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnResourcePolicy, CfnResourcePolicyProps } from 'awscdk-resources-mongodbatlas' 4 | import { env } from 'node:process'; 5 | 6 | interface AtlasStackProps { 7 | readonly profile: string; 8 | readonly name: string; 9 | readonly orgId: string; 10 | readonly body: string; 11 | } 12 | 13 | const app = new cdk.App(); 14 | 15 | export class CdkTestStack extends cdk.Stack { 16 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 17 | super(scope, id, props); 18 | 19 | const atlasProps = this.getContextProps(); 20 | const resourcePolicy = new CfnResourcePolicy(this, "resource-policy-testing-stack", { 21 | profile: atlasProps.profile, 22 | name: atlasProps.name, 23 | orgId: atlasProps.orgId, 24 | policies: [ 25 | { 26 | body: atlasProps.body, 27 | }, 28 | ], 29 | }); 30 | } 31 | 32 | getContextProps(): AtlasStackProps { 33 | const profile = this.node.tryGetContext('profile') ?? 'default'; 34 | const name = this.node.tryGetContext('name'); 35 | const orgId = this.node.tryGetContext('orgId'); 36 | const body = this.node.tryGetContext('body'); 37 | if (!name) { 38 | throw "No context value specified for name. Please specify via the cdk context." 39 | } 40 | if (!orgId) { 41 | throw "No context value specified for orgId. Please specify via the cdk context." 42 | } 43 | if (!body) { 44 | throw "No context value specified for body. Please specify via the cdk context." 45 | } 46 | 47 | return { 48 | profile, 49 | name, 50 | orgId, 51 | body 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /examples/l1-resources/search-deployment.ts: -------------------------------------------------------------------------------- 1 | // This example creates a search deployment in Atlas using the L1 resource. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnSearchDeployment } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projectId: string; 8 | readonly profile: string; 9 | readonly clusterName: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | const searchDeployment = new CfnSearchDeployment(this, 'CfnSearchDeployment', { 18 | profile: atlasProps.profile, 19 | clusterName: atlasProps.clusterName, 20 | projectId: atlasProps.projectId, 21 | specs: [ 22 | { 23 | instanceSize: "S30_HIGHCPU_NVME", 24 | nodeCount: 2, 25 | }, 26 | ] 27 | }); 28 | 29 | } 30 | 31 | getContextProps(): AtlasStackProps { 32 | const profile = this.node.tryGetContext('profile') ?? 'default'; 33 | const projectId = this.node.tryGetContext('projectId'); 34 | if (!projectId){ 35 | throw "No context value specified for projectId. Please specify via the cdk context." 36 | } 37 | const clusterName = this.node.tryGetContext('clusterName'); 38 | if (!clusterName){ 39 | throw "No context value specified for clusterName. Please specify via the cdk context." 40 | } 41 | 42 | return { 43 | projectId, 44 | profile, 45 | clusterName 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /examples/l1-resources/stream-connection-sample.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnStreamConnection, CfnStreamConnectionPropsType } from 'awscdk-resources-mongodbatlas' 4 | 5 | interface AtlasStackProps { 6 | readonly projectId: string; 7 | readonly profile: string; 8 | readonly instanceName: string; 9 | readonly sampleDataset: string; 10 | } 11 | 12 | const app = new cdk.App(); 13 | 14 | 15 | export class CdkTestStack extends cdk.Stack { 16 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 17 | super(scope, id, props); 18 | 19 | const atlasProps = this.getContextProps(); 20 | const streamConnection = new CfnStreamConnection(this, "stream-connection-sample-stack", { 21 | profile: atlasProps.profile, 22 | instanceName: atlasProps.instanceName, 23 | projectId: atlasProps.projectId, 24 | connectionName: atlasProps.sampleDataset, 25 | type: CfnStreamConnectionPropsType.SAMPLE, 26 | }); 27 | } 28 | 29 | 30 | getContextProps(): AtlasStackProps { 31 | const profile = this.node.tryGetContext('profile') ?? 'default'; 32 | const projectId = this.node.tryGetContext('projectId'); 33 | const instanceName = this.node.tryGetContext('instanceName'); 34 | const sampleDataset = this.node.tryGetContext('sampleDataset'); 35 | if (!projectId) { 36 | throw "No context value specified for projectId. Please specify via the cdk context." 37 | } 38 | if (!instanceName) { 39 | throw "No context value specified for instanceName. Please specify via the cdk context." 40 | } 41 | if (!sampleDataset) { 42 | throw "No context value specified for sampleDataset. Please specify via the cdk context." 43 | } 44 | 45 | return { 46 | projectId, 47 | profile, 48 | instanceName, 49 | sampleDataset, 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /examples/l1-resources/teams.ts: -------------------------------------------------------------------------------- 1 | // This example creates a database user in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnTeams, CfnTeamsPropsRoleNames} from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly name: string; 10 | readonly username: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | const meTeam = new CfnTeams(this, 'MyTeam', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | name: atlasProps.name, 23 | roleNames: [CfnTeamsPropsRoleNames.GROUP_CLUSTER_MANAGER], 24 | usernames: [atlasProps.username] 25 | }) 26 | } 27 | 28 | getContextProps(): AtlasStackProps { 29 | const projId = this.node.tryGetContext('projId'); 30 | if (!projId){ 31 | throw "No context value specified for projId. Please specify via the cdk context." 32 | } 33 | const profile = this.node.tryGetContext('profile') ?? 'default'; 34 | const name = this.node.tryGetContext('name'); 35 | const username = this.node.tryGetContext('username'); 36 | 37 | 38 | return { 39 | projId, 40 | profile, 41 | name, 42 | username 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /examples/l1-resources/third-party-integration.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { CfnThirdPartyIntegration, CfnThirdPartyIntegrationPropsType} from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly url: string; 9 | } 10 | 11 | export class CdkTestingStack extends cdk.Stack { 12 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 13 | super(scope, id, props); 14 | const atlasProps = this.getContextProps(); 15 | const thirdPartyIntegration = new CfnThirdPartyIntegration(this, 'ThirdPartyIntegration', { 16 | projectId: atlasProps.projId, 17 | profile: atlasProps.profile, 18 | type: CfnThirdPartyIntegrationPropsType.WEBHOOK, 19 | url: atlasProps.url, 20 | }); 21 | } 22 | 23 | getContextProps(): AtlasStackProps { 24 | const projId = this.node.tryGetContext('projId'); 25 | if (!projId){ 26 | throw "No context value specified for projId. Please specify via the cdk context." 27 | } 28 | 29 | const profile = this.node.tryGetContext('profile') ?? 'default'; 30 | const url = this.node.tryGetContext('url'); 31 | 32 | 33 | return { 34 | projId, 35 | profile, 36 | url, 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/l1-resources/x509-authentication-db-user.ts: -------------------------------------------------------------------------------- 1 | // This example creates a database user in Atlas using the L1 resources. 2 | import * as cdk from 'aws-cdk-lib'; 3 | import { Construct } from 'constructs'; 4 | import { CfnX509AuthenticationDatabaseUser } from 'awscdk-resources-mongodbatlas'; 5 | 6 | interface AtlasStackProps { 7 | readonly projId: string; 8 | readonly profile: string; 9 | readonly username: string; 10 | readonly cas: string; 11 | } 12 | 13 | export class CdkTestingStack extends cdk.Stack { 14 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 15 | super(scope, id, props); 16 | 17 | const atlasProps = this.getContextProps(); 18 | 19 | const myCfnX509AuthenticationDatabaseUser = new CfnX509AuthenticationDatabaseUser(this, 'MyCfnX509AuthenticationDatabaseUser', { 20 | projectId: atlasProps.projId, 21 | profile: atlasProps.profile, 22 | userName: atlasProps.username, 23 | customerX509: { 24 | cas: atlasProps.cas, 25 | } 26 | }); 27 | } 28 | 29 | getContextProps(): AtlasStackProps { 30 | const projId = this.node.tryGetContext('projId'); 31 | if (!projId) { 32 | throw "No context value specified for projId. Please specify via the cdk context." 33 | } 34 | const profile = this.node.tryGetContext('profile') ?? 'default'; 35 | const cas = this.node.tryGetContext('cas'); 36 | const username = this.node.tryGetContext('username'); 37 | 38 | 39 | 40 | return { 41 | projId, 42 | profile, 43 | username, 44 | cas 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/l2-resources/atlas-encryption-at-rest.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { AtlasEncryptionAtRest } from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly customerMasterKeyId: string; 9 | readonly roleId: string; 10 | } 11 | 12 | export class CdkTestingStack extends cdk.Stack { 13 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 14 | super(scope, id, props); 15 | 16 | const atlasProps = this.getContextProps(); 17 | 18 | const atlasEncryptionAtRest = new AtlasEncryptionAtRest(this, 'AtlasEncryptionAtRest', { 19 | projectId: atlasProps.projId, 20 | profile: atlasProps.profile, 21 | roleId: atlasProps.roleId, 22 | customerMasterKeyId: atlasProps.customerMasterKeyId 23 | }); 24 | } 25 | 26 | getContextProps(): AtlasStackProps { 27 | const projId = this.node.tryGetContext('projId'); 28 | if (!projId){ 29 | throw "No context value specified for projId. Please specify via the cdk context." 30 | } 31 | 32 | const profile = this.node.tryGetContext('profile') ?? 'default'; 33 | const customerMasterKeyId = this.node.tryGetContext('customerMasterKeyId'); 34 | const roleId = this.node.tryGetContext('roleId'); 35 | 36 | return { 37 | projId, 38 | profile, 39 | customerMasterKeyId, 40 | roleId 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /examples/l2-resources/third-party-integration.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from 'aws-cdk-lib'; 2 | import { Construct } from 'constructs'; 3 | import { PagerDutyIntegration, PagerDutyRegion} from 'awscdk-resources-mongodbatlas'; 4 | 5 | interface AtlasStackProps { 6 | readonly projId: string; 7 | readonly profile: string; 8 | readonly serviceKey: string; 9 | } 10 | 11 | export class CdkTestingStack extends cdk.Stack { 12 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 13 | super(scope, id, props); 14 | const atlasProps = this.getContextProps(); 15 | 16 | const myPagerDutyIntegration = new PagerDutyIntegration(this, 'MyPagerDutyIntegration', { 17 | projectId: atlasProps.projId, 18 | profile: atlasProps.profile, 19 | region: PagerDutyRegion.EU, 20 | serviceKey: atlasProps.serviceKey, 21 | }); 22 | } 23 | 24 | getContextProps(): AtlasStackProps { 25 | const projId = this.node.tryGetContext('projId'); 26 | if (!projId){ 27 | throw "No context value specified for projId. Please specify via the cdk context." 28 | } 29 | 30 | const profile = this.node.tryGetContext('profile') ?? 'default'; 31 | const serviceKey = this.node.tryGetContext('serviceKey'); 32 | 33 | 34 | return { 35 | projId, 36 | profile, 37 | serviceKey, 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /examples/l3-resources/atlas-bootstrap.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import * as cdk from "aws-cdk-lib"; 16 | import { Construct } from 'constructs'; 17 | import { 18 | MongoAtlasBootstrap, 19 | MongoAtlasBootstrapProps, 20 | AtlasBasicResources, 21 | } from "awscdk-resources-mongodbatlas"; 22 | 23 | export class AtlasBoostrapExample extends cdk.Stack { 24 | constructor(scope: Construct, id: string, props?: cdk.StackProps) { 25 | super(scope, id, props); 26 | 27 | const mongoDBProfile = "development"; 28 | const roleName = "MongoDB-Atlas-CDK-Excecution"; 29 | 30 | const bootstrapProperties: MongoAtlasBootstrapProps = { 31 | roleName: roleName, 32 | secretProfile: mongoDBProfile, 33 | typesToActivate: AtlasBasicResources 34 | }; 35 | 36 | new MongoAtlasBootstrap(this, "cdk-bootstrap", bootstrapProperties); 37 | } 38 | } -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | config.env 3 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/README.md: -------------------------------------------------------------------------------- 1 | # mern-stack-example 2 | Mern Stack code for the [Mern Tutorial](https://www.mongodb.com/languages/mern-stack-tutorial) 3 | 4 | [![CI](https://github.com/mongodb-developer/mern-stack-example/actions/workflows/main.yaml/badge.svg)](https://github.com/mongodb-developer/mern-stack-example/actions/workflows/main.yaml) 5 | 6 | ## How To Run 7 | Create an Atlas URI connection parameter in `mern/server/config.env` with your Atlas URI: 8 | ``` 9 | ATLAS_URI=mongodb+srv://:@sandbox.jadwj.mongodb.net/myFirstDatabase?retryWrites=true&w=majority 10 | PORT=5000 11 | ``` 12 | 13 | Start server: 14 | ``` 15 | cd mern/server 16 | npm install 17 | npm start 18 | ``` 19 | 20 | Start Web server 21 | ``` 22 | cd mern/client 23 | npm install 24 | npm start 25 | ``` 26 | 27 | ## How To Test 28 | For Unit tests run: 29 | ``` 30 | npm test tests/api.unit.test.js 31 | ``` 32 | 33 | For Integration tests run: 34 | ``` 35 | npm test tests/api.integ.test.js 36 | ``` 37 | 38 | ## Disclaimer 39 | 40 | Use at your own risk; not a supported MongoDB product 41 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to your CDK TypeScript project 2 | 3 | This is a blank project for CDK development with TypeScript. 4 | 5 | The `cdk.json` file tells the CDK Toolkit how to execute your app. 6 | 7 | ## Useful commands 8 | 9 | * `npm run build` compile typescript to js 10 | * `npm run watch` watch for changes and compile 11 | * `npm run test` perform the jest unit tests 12 | * `cdk deploy` deploy this stack to your default AWS account/region 13 | * `cdk diff` compare deployed stack with current state 14 | * `cdk synth` emits the synthesized CloudFormation template 15 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/bin/atlas-integ-infra.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import 'source-map-support/register'; 3 | import * as cdk from 'aws-cdk-lib'; 4 | import { AtlasIntegInfraStack } from '../lib/atlas-integ-infra-stack'; 5 | 6 | const app = new cdk.App(); 7 | new AtlasIntegInfraStack(app, 'AtlasIntegInfraStack', { 8 | /* If you don't specify 'env', this stack will be environment-agnostic. 9 | * Account/Region-dependent features and context lookups will not work, 10 | * but a single synthesized template can be deployed anywhere. */ 11 | 12 | /* Uncomment the next line to specialize this stack for the AWS Account 13 | * and Region that are implied by the current CLI configuration. */ 14 | // env: { account: process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_DEFAULT_REGION }, 15 | 16 | /* Uncomment the next line if you know exactly what Account and Region you 17 | * want to deploy the stack to. */ 18 | // env: { account: '123456789012', region: 'us-east-1' }, 19 | 20 | /* For more information, see https://docs.aws.amazon.com/cdk/latest/guide/environments.html */ 21 | }); -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts bin/atlas-integ-infra.ts", 3 | "watch": { 4 | "include": [ 5 | "**" 6 | ], 7 | "exclude": [ 8 | "README.md", 9 | "cdk*.json", 10 | "**/*.d.ts", 11 | "**/*.js", 12 | "tsconfig.json", 13 | "package*.json", 14 | "yarn.lock", 15 | "node_modules", 16 | "test" 17 | ] 18 | }, 19 | "context": { 20 | "@aws-cdk/aws-lambda:recognizeLayerVersion": true, 21 | "@aws-cdk/core:checkSecretUsage": true, 22 | "@aws-cdk/core:target-partitions": [ 23 | "aws", 24 | "aws-cn" 25 | ], 26 | "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, 27 | "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, 28 | "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true, 29 | "@aws-cdk/aws-iam:minimizePolicies": true, 30 | "@aws-cdk/core:validateSnapshotRemovalPolicy": true, 31 | "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true, 32 | "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true, 33 | "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true, 34 | "@aws-cdk/aws-apigateway:disableCloudWatchRole": true, 35 | "@aws-cdk/core:enablePartitionLiterals": true, 36 | "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true, 37 | "@aws-cdk/aws-iam:standardizedServicePrincipals": true, 38 | "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true, 39 | "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true, 40 | "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true, 41 | "@aws-cdk/aws-route53-patters:useCertificate": true, 42 | "@aws-cdk/customresources:installLatestAwsSdkDefault": false 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/out.json: -------------------------------------------------------------------------------- 1 | {"name":"Peter","position":"Pumpkin Eater","level":"Intern"} 2 | {"name":"Jack","position":"Goes up the Hill","level":"Junior"} 3 | {"name":"Miss Muffet","position":"Sits on the Tuffet","level":"Senior"} -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atlas-integ-infra", 3 | "version": "0.1.0", 4 | "bin": { 5 | "atlas-integ-infra": "bin/atlas-integ-infra.js" 6 | }, 7 | "scripts": { 8 | "build": "tsc", 9 | "watch": "tsc -w", 10 | "test": "jest", 11 | "cdk": "cdk" 12 | }, 13 | "devDependencies": { 14 | "@types/jest": "^29.2.5", 15 | "@types/node": "18.11.18", 16 | "jest": "^29.3.1", 17 | "ts-jest": "^29.0.3", 18 | "aws-cdk": "2.62.2", 19 | "ts-node": "^10.9.1", 20 | "typescript": "~4.9.4" 21 | }, 22 | "dependencies": { 23 | "aws-cdk-lib": "2.189.1", 24 | "@mongodbatlas-awscdk/atlas-basic": "1.1.6", 25 | "constructs": "^10.0.0", 26 | "source-map-support": "^0.5.21" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/atlas-integ-infra/setup-env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | temp_atlas_url=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[0].OutputValue") 4 | temp_atlas_password=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[1].OutputValue") 5 | temp_atlas_username=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[2].OutputValue") 6 | 7 | atlas_url=$(echo "$temp_atlas_url" | cut -c 16-| tr -d '"') 8 | atlas_username=$(echo "$temp_atlas_username" | tr -d '"') 9 | atlas_password=$(echo "$temp_atlas_password" | tr -d '"') 10 | 11 | ATLAS_URI="mongodb+srv://${atlas_username}:${atlas_password}@${atlas_url}" 12 | 13 | export temp_atlas_url 14 | export temp_atlas_password 15 | export temp_atlas_username 16 | export atlas_url 17 | export atlas_username 18 | export atlas_password 19 | export ATLAS_URI 20 | 21 | mongoimport "${ATLAS_URI}" --db=employees --collection=records out.json -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/cdk-pipeline/bin/cdk-pipeline.ts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import 'source-map-support/register'; 3 | import * as cdk from 'aws-cdk-lib'; 4 | import { CdkPipelineStack } from '../lib/cdk-pipeline-stack'; 5 | 6 | const app = new cdk.App(); 7 | new CdkPipelineStack(app, 'CdkPipelineStack', { 8 | 9 | }); 10 | 11 | app.synth(); -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/cdk-pipeline/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "npx ts-node --prefer-ts-exts bin/cdk-pipeline.ts", 3 | "watch": { 4 | "include": [ 5 | "**" 6 | ], 7 | "exclude": [ 8 | "README.md", 9 | "cdk*.json", 10 | "**/*.d.ts", 11 | "**/*.js", 12 | "tsconfig.json", 13 | "package*.json", 14 | "yarn.lock", 15 | "node_modules", 16 | "test" 17 | ] 18 | }, 19 | "context": { 20 | "@aws-cdk/aws-lambda:recognizeLayerVersion": true, 21 | "@aws-cdk/core:checkSecretUsage": true, 22 | "@aws-cdk/core:target-partitions": [ 23 | "aws", 24 | "aws-cn" 25 | ], 26 | "@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver": true, 27 | "@aws-cdk/aws-ec2:uniqueImdsv2TemplateName": true, 28 | "@aws-cdk/aws-ecs:arnFormatIncludesClusterName": true, 29 | "@aws-cdk/aws-iam:minimizePolicies": true, 30 | "@aws-cdk/core:validateSnapshotRemovalPolicy": true, 31 | "@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName": true, 32 | "@aws-cdk/aws-s3:createDefaultLoggingPolicy": true, 33 | "@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption": true, 34 | "@aws-cdk/aws-apigateway:disableCloudWatchRole": true, 35 | "@aws-cdk/core:enablePartitionLiterals": true, 36 | "@aws-cdk/aws-events:eventsTargetQueueSameAccount": true, 37 | "@aws-cdk/aws-iam:standardizedServicePrincipals": true, 38 | "@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker": true, 39 | "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": true, 40 | "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true, 41 | "@aws-cdk/aws-route53-patters:useCertificate": true, 42 | "@aws-cdk/customresources:installLatestAwsSdkDefault": false 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/cdk-pipeline/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cdk-pipeline", 3 | "version": "0.1.0", 4 | "bin": { 5 | "cdk-pipeline": "bin/cdk-pipeline.js" 6 | }, 7 | "scripts": { 8 | "build": "tsc", 9 | "watch": "tsc -w", 10 | "test": "jest", 11 | "cdk": "cdk" 12 | }, 13 | "devDependencies": { 14 | "@types/jest": "^29.2.5", 15 | "@types/node": "18.11.18", 16 | "jest": "^29.3.1", 17 | "ts-jest": "^29.0.3", 18 | "aws-cdk": "2.62.2", 19 | "ts-node": "^10.9.1", 20 | "typescript": "~4.9.4" 21 | }, 22 | "dependencies": { 23 | "aws-cdk-lib": "2.189.1", 24 | "constructs": "^10.0.0", 25 | "source-map-support": "^0.5.21" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress/integration/endToEnd.spec.js: -------------------------------------------------------------------------------- 1 | 2 | describe('Web site availability', () => { 3 | 4 | after(() => { 5 | cy.contains("Delete").click({ force: true }); 6 | }); 7 | it('Sanity listings web site', () => { 8 | cy.visit('http://localhost:3000'); 9 | cy.contains('Create Record').should('exist'); 10 | }); 11 | it('Test Adding Employee listings', () => { 12 | cy.visit('http://localhost:3000/create'); 13 | cy.get('#name').type("Employee1"); 14 | cy.get('#position').type("Position1"); 15 | cy.get("#positionIntern").click({ force: true }); 16 | cy.contains("Create person").click({ force: true }); 17 | cy.visit('http://localhost:3000'); 18 | cy.contains('Employee1').should('exist'); 19 | }); 20 | /* it('Test Editing Employee listings', () => { 21 | //cy.visit('http://localhost:3000'); 22 | cy.contains('Edit').click({ force: true }) 23 | cy.on('url:changed', url => { 24 | cy.visit(url); 25 | cy.get('#position').clear(); 26 | cy.get('#position').type("Position2"); 27 | cy.contains("Update Record").click({ force: true }); 28 | cy.visit('http://localhost:3000'); 29 | cy.contains('Position2').should('exist'); 30 | }); 31 | 32 | 33 | 34 | });*/ 35 | }); -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | /// 2 | // *********************************************************** 3 | // This example plugins/index.js can be used to load plugins 4 | // 5 | // You can change the location of this file or turn off loading 6 | // the plugins file with the 'pluginsFile' configuration option. 7 | // 8 | // You can read more here: 9 | // https://on.cypress.io/plugins-guide 10 | // *********************************************************** 11 | 12 | // This function is called when a project is opened or re-opened (e.g. due to 13 | // the project's config changing) 14 | 15 | /** 16 | * @type {Cypress.PluginConfig} 17 | */ 18 | // eslint-disable-next-line no-unused-vars 19 | module.exports = (on, config) => { 20 | // `on` is used to hook into various events Cypress emits 21 | // `config` is the resolved Cypress config 22 | } 23 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add('login', (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This will overwrite an existing command -- 25 | // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/cypress/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "client", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.11.4", 7 | "@testing-library/react": "^11.1.0", 8 | "@testing-library/user-event": "^12.1.10", 9 | "bootstrap": "^5.0.0", 10 | "cypress": "^9.2.0", 11 | "react": "^17.0.2", 12 | "react-dom": "^17.0.2", 13 | "react-router-dom": "^7.5.2", 14 | "react-scripts": "5.0.1", 15 | "web-vitals": "^1.0.1" 16 | }, 17 | "overrides": { 18 | "nth-check": "2.1.1" 19 | }, 20 | "scripts": { 21 | "start": "react-scripts start", 22 | "build": "react-scripts build", 23 | "test": "react-scripts test", 24 | "eject": "react-scripts eject" 25 | }, 26 | "eslintConfig": { 27 | "extends": [ 28 | "react-app", 29 | "react-app/jest" 30 | ] 31 | }, 32 | "browserslist": { 33 | "production": [ 34 | ">0.2%", 35 | "not dead", 36 | "not op_mini all" 37 | ], 38 | "development": [ 39 | "last 1 chrome version", 40 | "last 1 firefox version", 41 | "last 1 safari version" 42 | ] 43 | } 44 | } -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/examples/mern-cdk-ci-cd/mern/client/public/favicon.ico -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | React App 15 | 16 | 17 | 18 |
19 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/examples/mern-cdk-ci-cd/mern/client/public/logo192.png -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/examples/mern-cdk-ci-cd/mern/client/public/logo512.png -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/src/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | // We use Route in order to define the different routes of our application 4 | import { Route, Routes } from "react-router-dom"; 5 | 6 | // We import all the components we need in our app 7 | import Navbar from "./components/navbar"; 8 | import RecordList from "./components/recordList"; 9 | import Edit from "./components/edit"; 10 | import Create from "./components/create"; 11 | 12 | const App = () => { 13 | return ( 14 |
15 | 16 |
17 | 18 | } /> 19 | } /> 20 | } /> 21 | 22 |
23 |
24 | ); 25 | }; 26 | 27 | export default App; 28 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/src/components/navbar.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | // We import bootstrap to make our application look better. 4 | import "bootstrap/dist/css/bootstrap.css"; 5 | 6 | // We import NavLink to utilize the react router. 7 | import { NavLink } from "react-router-dom"; 8 | 9 | // Here, we display our Navbar 10 | export default function Navbar() { 11 | return ( 12 |
13 | 39 |
40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/client/src/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import App from "./App"; 4 | import { BrowserRouter } from "react-router-dom"; 5 | 6 | 7 | ReactDOM.render( 8 | 9 | 10 | 11 | 12 | , 13 | document.getElementById("root") 14 | ); -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/db/conn.js: -------------------------------------------------------------------------------- 1 | 2 | const { MongoClient } = require("mongodb"); 3 | const Db = process.env.ATLAS_URI; 4 | const client = new MongoClient(Db, { 5 | useNewUrlParser: true, 6 | useUnifiedTopology: true, 7 | }); 8 | 9 | var _db; 10 | 11 | module.exports = { 12 | connectToServer: function (callback) { 13 | client.connect(function (err, db) { 14 | // Verify we got a good "db" object 15 | if (db) 16 | { 17 | _db = db.db("employees"); 18 | console.log("Successfully connected to MongoDB."); 19 | } 20 | return callback(err); 21 | }); 22 | }, 23 | 24 | getDb: function () { 25 | return _db; 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "jest" 8 | }, 9 | "type":"commonjs", 10 | "keywords": [], 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "axios": "^1.3.4", 15 | "cors": "^2.8.5", 16 | "dotenv": "^8.2.0", 17 | "express": "^4.17.1", 18 | "mongodb": "^3.6.6", 19 | "mongoose": "^8.8.3" 20 | }, 21 | "devDependencies": { 22 | "jest": "^29.5.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/server.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const app = express(); 3 | const cors = require("cors"); 4 | require("dotenv").config({ path: "./config.env" }); 5 | const port = process.env.PORT || 5000; 6 | app.use(cors()); 7 | app.use(express.json()); 8 | app.use(require("./routes/record")); 9 | // get driver connection 10 | const dbo = require("./db/conn"); 11 | 12 | app.listen(port, () => { 13 | // perform a database connection when server starts 14 | dbo.connectToServer(function (err) { 15 | if (err) console.error(err); 16 | 17 | }); 18 | console.log(`Server is running on port: ${port}`); 19 | }); 20 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | temp_atlas_url=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[0].OutputValue") 4 | temp_atlas_password=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[1].OutputValue") 5 | temp_atlas_username=$(aws cloudformation --region us-east-1 describe-stacks --stack-name AtlasIntegInfraStack --query "Stacks[0].Outputs[2].OutputValue") 6 | 7 | atlas_url=$(echo "$temp_atlas_url" | cut -c 16-| tr -d '"') 8 | atlas_username=$(echo "$temp_atlas_username" | tr -d '"') 9 | atlas_password=$(echo "$temp_atlas_password" | tr -d '"') 10 | 11 | ATLAS_URI="mongodb+srv://${atlas_username}:${atlas_password}@${atlas_url}" 12 | 13 | export temp_atlas_url 14 | export temp_atlas_password 15 | export temp_atlas_username 16 | export atlas_url 17 | export atlas_username 18 | export atlas_password 19 | export ATLAS_URI 20 | 21 | npm run start & -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/tests/api.integ.test.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | 3 | test('getting total records record', async () =>{ 4 | const response = await axios(`http://localhost:5000/record/`) 5 | let records = await response.data 6 | 7 | expect(records.length).toBe(3) 8 | }); 9 | 10 | test('test specific records', async () =>{ 11 | const response = await axios(`http://localhost:5000/name/Peter`) 12 | let records = await response.data 13 | 14 | expect(records.length).toBe(1) 15 | expect(records[0].level).toBe("Intern") 16 | }); 17 | -------------------------------------------------------------------------------- /examples/mern-cdk-ci-cd/mern/server/tests/api.unit.test.js: -------------------------------------------------------------------------------- 1 | 2 | test('adds 1 + 2 to equal 3', () => { 3 | expect(1+2).toBe(3); 4 | }); -------------------------------------------------------------------------------- /examples/profile-secret.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Description: MongoDB Atlas AWS CloudFormation for building a, secret profile with ApiKeys 3 | Parameters: 4 | ProfileName: 5 | Description: "Your MongoDB Atlas Profile Name" 6 | Type: String 7 | Default: "default" 8 | PublicKey: 9 | Description: "Your MongoDB Atlas Public API Key" 10 | Type: String 11 | Default: "PublicKey" 12 | PrivateKey: 13 | Description: "Your MongoDB Atlas Private API Key" 14 | Type: String 15 | Default: "PrivateKey" 16 | Resources: 17 | AtlasApiKeySecret: 18 | Type: 'AWS::SecretsManager::Secret' 19 | Properties: 20 | Name: !Sub "cfn/atlas/profile/${ProfileName}" 21 | Description: MongoDB Atlas API Key 22 | SecretString: !Join ['', ['{"PublicKey":"', !Ref "PublicKey",'", "PrivateKey":"', !Ref "PrivateKey", '"}'] ] 23 | Tags: 24 | - Key: mongodb-atlas-profile-keys 25 | Value: !Sub "${AWS::StackName}" 26 | -------------------------------------------------------------------------------- /examples/python/l1-resources/project.py: -------------------------------------------------------------------------------- 1 | from aws_cdk import Stack 2 | from constructs import Construct 3 | 4 | from awscdk_resources_mongodbatlas import CfnProject 5 | 6 | class CdkTestAppPython2Stack(Stack): 7 | 8 | def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: 9 | super().__init__(scope, construct_id, **kwargs) 10 | 11 | project_name_var = self.node.try_get_context('project_name') 12 | org_id_var = self.node.try_get_context('org_id') 13 | profile_name_var = self.node.try_get_context('profile') 14 | 15 | project_l1 = CfnProject(self, "Project-py-l1", 16 | name=project_name_var, 17 | org_id=org_id_var, 18 | profile=profile_name_var) 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/python/l2-resources/datadog_integration.py: -------------------------------------------------------------------------------- 1 | from aws_cdk import Stack 2 | from constructs import Construct 3 | 4 | from awscdk_resources_mongodbatlas import ( DatadogIntegration, DatadogRegion ) 5 | 6 | class CdkTestAppPython2Stack(Stack): 7 | 8 | def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None: 9 | super().__init__(scope, construct_id, **kwargs) 10 | 11 | project_id_var = self.node.try_get_context('project_id') 12 | api_key_var = self.node.try_get_context('api_key') 13 | profile_name_var = self.node.try_get_context('profile') 14 | 15 | datadog_integration_l2 = DatadogIntegration(self, "DatadogIntegration-py-l2", 16 | api_key=api_key_var, 17 | profile=profile_name_var, 18 | project_id=project_id_var, 19 | region=DatadogRegion.US) 20 | 21 | 22 | -------------------------------------------------------------------------------- /scripts/cdk-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2024 MongoDB Inc 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # This shell script can be use to generate all L1 CDK Constructs. 18 | # The script calls cdk.sh for each resource. 19 | # 20 | # How to use it: ./scripts/cdk-all.sh 21 | 22 | set -euo pipefail 23 | 24 | dir="src/l1-resources" 25 | 26 | for subdir in "${dir}"/*/; do 27 | if [ -d "${subdir}" ]; then 28 | resource=$(basename "${subdir}") 29 | ./scripts/cdk.sh "${resource}" 30 | fi 31 | done 32 | -------------------------------------------------------------------------------- /scripts/check-examples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2024 MongoDB Inc 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # This shell script creates a project with L1, L2 and L3 examples and builds it. 18 | # 19 | # How to use it: ./scripts/check-examples.sh 20 | 21 | set -euo pipefail 22 | 23 | rm -rf examples-bin 24 | mkdir examples-bin 25 | cd examples-bin 26 | 27 | cdk init app --language typescript 28 | 29 | cp ../examples/l1-resources/* . 30 | cp ../examples/l2-resources/* . 31 | cp ../examples/l3-resources/* . 32 | 33 | cp ../dist/js/awscdk-resources-mongodbatlas@0.0.0.jsii.tgz . 34 | npm install --save file:awscdk-resources-mongodbatlas@0.0.0.jsii.tgz 35 | 36 | npm run build 37 | -------------------------------------------------------------------------------- /src/l1-resources/access-list-api-key/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnAccessListApiKey } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "access-list-api-key", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const orgId = "63350255419cf25e3d511c95"; 13 | 14 | new CfnAccessListApiKey(stack, "access-list-api-key", { 15 | orgId: orgId, 16 | apiUserId: "64ef512fab473831c9e73b58", 17 | profile: "default", 18 | ipAddress: "203.0.113.11", 19 | }); 20 | -------------------------------------------------------------------------------- /src/l1-resources/api-key/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { 3 | CfnApiKey, 4 | CfnApiKeyProps, 5 | ProjectAssignment, 6 | ListOptions, 7 | } from "./index"; 8 | 9 | const app = new cdk.App(); 10 | const stack = new cdk.Stack(app, "api-key", { 11 | env: { 12 | region: process.env.CDK_DEFAULT_REGION, 13 | account: process.env.CDK_DEFAULT_ACCOUNT, 14 | }, 15 | }); 16 | 17 | const orgId = "63350255419cf25e3d511c95"; 18 | const projectAssignments: ProjectAssignment[] = [ 19 | { 20 | projectId: "64ee3fcfaa95ad6b7e358d56", 21 | roles: ["GROUP_READ_ONLY"], 22 | }, 23 | { 24 | projectId: "64ee3fd58bb58153335e8469", 25 | roles: ["GROUP_SEARCH_INDEX_EDITOR", "GROUP_OWNER", "GROUP_READ_ONLY"], 26 | }, 27 | ]; 28 | 29 | const listOptions: ListOptions = { 30 | pageNum: 1, 31 | itemsPerPage: 300, 32 | }; 33 | 34 | const Roles = ["ORG_MEMBER", "ORG_GROUP_CREATOR"]; 35 | const apikeyProps: CfnApiKeyProps = { 36 | orgId: orgId, 37 | description: "for cfn test api-key resource testing.", 38 | profile: "default", 39 | roles: Roles, 40 | awsSecretName: "mongodb/atlas/apikey/cfn-bot-apikey-test", 41 | projectAssignments: projectAssignments, 42 | listOptions: listOptions, 43 | }; 44 | 45 | new CfnApiKey(stack, "api-key", apikeyProps); 46 | -------------------------------------------------------------------------------- /src/l1-resources/cluster/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnCluster } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "atlas-test-cdk-test", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const atlasProject = ""; 13 | 14 | new CfnCluster(stack, "AtlasCluster", { 15 | projectId: atlasProject, 16 | name: "TestCluster", 17 | mongoDbMajorVersion: "6.0", 18 | clusterType: "REPLICASET", 19 | backupEnabled: true, 20 | tags: [ 21 | { 22 | key: "env", 23 | value: "development", 24 | }, 25 | ], 26 | replicationSpecs: [ 27 | { 28 | numShards: 1, 29 | advancedRegionConfigs: [ 30 | { 31 | autoScaling: { 32 | diskGb: { 33 | enabled: true, 34 | }, 35 | compute: { 36 | enabled: true, 37 | scaleDownEnabled: false, 38 | maxInstanceSize: "M40", 39 | }, 40 | }, 41 | electableSpecs: { 42 | ebsVolumeType: "PROVISIONED", 43 | instanceSize: "M30", 44 | nodeCount: 3, 45 | diskIops: "2000", 46 | }, 47 | priority: 7, 48 | regionName: "EU_WEST_1", 49 | }, 50 | ], 51 | }, 52 | ], 53 | }); 54 | -------------------------------------------------------------------------------- /src/l1-resources/data-lake-pipeline/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { 3 | CfnDataLakePipeline, 4 | CfnDataLakePipelineProps, 5 | Sink, 6 | Source, 7 | } from "./index"; 8 | 9 | const app = new cdk.App(); 10 | const stack = new cdk.Stack(app, "data-lake-pipeline", { 11 | env: { 12 | region: process.env.CDK_DEFAULT_REGION, 13 | account: process.env.CDK_DEFAULT_ACCOUNT, 14 | }, 15 | }); 16 | 17 | const sink: Sink = { 18 | partitionFields: [ 19 | { 20 | fieldName: "testpartition2", 21 | order: 0, 22 | }, 23 | ], 24 | }; 25 | const source: Source = { 26 | clusterName: "testclusterdatalakepipeline", 27 | collectionName: "testcollection3", 28 | databaseName: "testdatabase4", 29 | }; 30 | const transform = [ 31 | { 32 | field: "testtransformFeild", 33 | type: "EXCLUDE", 34 | }, 35 | ]; 36 | const datalakepipelineProps: CfnDataLakePipelineProps = { 37 | profile: "default", 38 | name: "testdatalakepipeline1", 39 | projectId: "64f65e99e0fe146ac753361f", 40 | sink: sink, 41 | source: source, 42 | transformations: transform, 43 | }; 44 | 45 | new CfnDataLakePipeline(stack, "data-lake-pipeline", datalakepipelineProps); 46 | -------------------------------------------------------------------------------- /src/l1-resources/encryption-at-rest/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnEncryptionAtRest } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "atlas-EncAtRest-cdk-test", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const projectId = 13 | stack.node.tryGetContext("MONGODB_PROJECT_ID") || 14 | process.env.MONGODB_ATLAS_PROJECT_ID; 15 | const customerMasterKeyId = 16 | stack.node.tryGetContext("CUSTOMER_MASTER_KEY_ID") || 17 | process.env.CUSTOMER_MASTER_KEY_ID; 18 | const roleID = stack.node.tryGetContext("ROLE_ID") || process.env.ROLE_ID; 19 | 20 | new CfnEncryptionAtRest(stack, "encryptionAtRest", { 21 | projectId: projectId, 22 | awsKmsConfig: { 23 | roleId: roleID, 24 | customerMasterKeyId: customerMasterKeyId, 25 | enabled: true, 26 | region: "AP_NORTHEAST_2", 27 | }, 28 | }); 29 | -------------------------------------------------------------------------------- /src/l1-resources/federated-settings-org-role-mapping/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnFederatedSettingsOrgRoleMapping } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "atlas-fedOrgRoleMapping-default", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const orgId = 13 | stack.node.tryGetContext("MONGODB_ATLAS_ORG_ID") || 14 | process.env.MONGODB_ATLAS_ORG_ID; 15 | const fedSettingsId = 16 | stack.node.tryGetContext("ATLAS_FEDERATED_SETTINGS_ID") || 17 | process.env.ATLAS_FEDERATED_SETTINGS_ID; 18 | 19 | new CfnFederatedSettingsOrgRoleMapping( 20 | stack, 21 | "federatedSettingsOrgRoleMapping", 22 | { 23 | profile: "federation", 24 | externalGroupName: "RG-01", 25 | orgId: orgId, 26 | federationSettingsId: fedSettingsId, 27 | roleAssignments: [ 28 | { 29 | role: "GROUP_DATA_ACCESS_READ_WRITE", 30 | projectId: "", 31 | }, 32 | ], 33 | } 34 | ); 35 | -------------------------------------------------------------------------------- /src/l1-resources/organization/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnOrganization } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "atlas-organization-cdk-test", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const awsSecretName = 13 | stack.node.tryGetContext("AWS_SECRET_NAME") || process.env.AWS_SECRET_NAME; 14 | const orgOwnerId = 15 | stack.node.tryGetContext("MONGODB_ATLAS_ORG_OWNER_ID") || 16 | process.env.MONGODB_ATLAS_ORG_OWNER_ID; 17 | const name = stack.node.tryGetContext("NAME") || process.env.NAME; 18 | const profile = stack.node.tryGetContext("PROFILE") || process.env.PROFILE; 19 | 20 | new CfnOrganization(stack, "organization", { 21 | name: name, 22 | orgOwnerId: orgOwnerId, 23 | awsSecretName: awsSecretName, 24 | profile: profile, 25 | apiKey: { 26 | roles: ["ORG_OWNER"], 27 | description: "test-cdk", 28 | }, 29 | }); 30 | -------------------------------------------------------------------------------- /src/l1-resources/private-endpoint-aws/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnPrivateEndpointAws } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "atlas-privateEndpoint", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const atlasProject = "6536c77b1c203c46c251ff0b"; 13 | 14 | new CfnPrivateEndpointAws(stack, "AtlasPrivateEndpoint", { 15 | projectId: atlasProject, 16 | endpointServiceId: "6536c7814104246bc7d0e940", 17 | profile: "default", 18 | id: "vpce-097276cb6f9eab2f5", 19 | enforceConnectionSuccess: false, 20 | }); 21 | -------------------------------------------------------------------------------- /src/l1-resources/private-endpoint-service/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import * as ec2 from "aws-cdk-lib/aws-ec2"; 3 | import { 4 | CfnPrivateEndpointService, 5 | CfnPrivateEndpointServicePropsCloudProvider, 6 | } from "./index"; 7 | import { CfnPrivateEndpointAws } from "../private-endpoint-aws"; 8 | 9 | const app = new cdk.App(); 10 | const stack = new cdk.Stack(app, "atlas-test-cdk-test", { 11 | env: { 12 | region: process.env.CDK_DEFAULT_REGION, 13 | account: process.env.CDK_DEFAULT_ACCOUNT, 14 | }, 15 | }); 16 | 17 | const atlasProject = ""; 18 | const vpcId = ""; 19 | const subnetId = ""; 20 | 21 | const atlasService = new CfnPrivateEndpointService(stack, "AtlasCluster", { 22 | projectId: atlasProject, 23 | region: "us-east-1", 24 | cloudProvider: CfnPrivateEndpointServicePropsCloudProvider.AWS, 25 | }); 26 | 27 | const awsPrivateEndpoint = new ec2.CfnVPCEndpoint(stack, "AWSPrivateEndpoint", { 28 | serviceName: atlasService.attrEndpointServiceName, 29 | subnetIds: [subnetId], 30 | vpcEndpointType: "Interface", 31 | vpcId: vpcId, 32 | }); 33 | 34 | awsPrivateEndpoint.addDependency(atlasService); 35 | 36 | const myPrivateEndpoint = new CfnPrivateEndpointAws( 37 | stack, 38 | "AtlasPrivateEndpoint", 39 | { 40 | projectId: atlasProject, 41 | endpointServiceId: atlasService.attrId, 42 | id: awsPrivateEndpoint.ref, 43 | } 44 | ); 45 | 46 | myPrivateEndpoint.addDependency(myPrivateEndpoint); 47 | -------------------------------------------------------------------------------- /src/l1-resources/project/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { CfnProject, CfnProjectProps } from "./index"; 3 | 4 | const app = new cdk.App(); 5 | const stack = new cdk.Stack(app, "CDK-Project-region-usage-restriction", { 6 | env: { 7 | region: process.env.CDK_DEFAULT_REGION, 8 | account: process.env.CDK_DEFAULT_ACCOUNT, 9 | }, 10 | }); 11 | 12 | const projectProps: CfnProjectProps = { 13 | name: "ATLAS_ORG_ID", 14 | orgId: "63350255419cf25e3d511c95", 15 | profile: "default", 16 | regionUsageRestrictions: "NONE", 17 | projectSettings: { 18 | isCollectDatabaseSpecificsStatisticsEnabled: false, 19 | isDataExplorerEnabled: false, 20 | isPerformanceAdvisorEnabled: false, 21 | isRealtimePerformancePanelEnabled: false, 22 | isSchemaAdvisorEnabled: true, 23 | isExtendedStorageSizesEnabled: true, 24 | }, 25 | projectApiKeys: [ 26 | { 27 | key: "64f75b66e205b21647ae1e58", 28 | roleNames: ["GROUP_CLUSTER_MANAGER"], 29 | }, 30 | ], 31 | projectTeams: [ 32 | { 33 | teamId: "647a04045878135ce0e8bfff", 34 | roleNames: ["GROUP_OWNER"], 35 | }, 36 | ], 37 | }; 38 | 39 | new CfnProject(stack, "project-region-usage-restriction", projectProps); 40 | -------------------------------------------------------------------------------- /src/l1-resources/serverless-private-endpoint/integ.default.ts: -------------------------------------------------------------------------------- 1 | import * as cdk from "aws-cdk-lib"; 2 | import { 3 | CfnServerlessPrivateEndpoint, 4 | CfnServerlessPrivateEndpointProps, 5 | AwsPrivateEndpointConfig, 6 | } from "./index"; 7 | 8 | const app = new cdk.App(); 9 | const stack = new cdk.Stack(app, "serverless-private-endpoint-with-aws", { 10 | env: { 11 | region: process.env.CDK_DEFAULT_REGION, 12 | account: process.env.CDK_DEFAULT_ACCOUNT, 13 | }, 14 | }); 15 | 16 | const awsPrivateEndpointConfig: AwsPrivateEndpointConfig = { 17 | vpcId: "vpc-", 18 | subnetIds: ["subnet-"], 19 | region: "us-east-1", 20 | }; 21 | 22 | const serverlessPrivateEndpointProps: CfnServerlessPrivateEndpointProps = { 23 | profile: "default", 24 | instanceName: "ServerlessInstance0", 25 | projectId: "", 26 | comment: "this is a comment", 27 | createAndAssignAwsPrivateEndpoint: true, 28 | awsPrivateEndpointConfigurationProperties: awsPrivateEndpointConfig, 29 | }; 30 | 31 | new CfnServerlessPrivateEndpoint( 32 | stack, 33 | "serverless-private-endpoint", 34 | serverlessPrivateEndpointProps 35 | ); 36 | -------------------------------------------------------------------------------- /src/l2-resources/third-party-integration/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export * from "./thirdPartyIntegrationBase"; 16 | export * from "./microsoftTeamsIntegration"; 17 | export * from "./datadogIntegration"; 18 | export * from "./pagerDutyIntegration"; 19 | -------------------------------------------------------------------------------- /src/l2-resources/third-party-integration/integ.default.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import * as cdk from "aws-cdk-lib"; 16 | import { 17 | MicrosoftTeamsIntegration, 18 | MicrosoftTeamsIntegrationProps, 19 | } from "./microsoftTeamsIntegration"; 20 | 21 | const app = new cdk.App(); 22 | const stack = new cdk.Stack(app, "third-party-integration", { 23 | env: { 24 | region: process.env.CDK_DEFAULT_REGION, 25 | account: process.env.CDK_DEFAULT_ACCOUNT, 26 | }, 27 | }); 28 | 29 | const projectId = 30 | stack.node.tryGetContext("MONGODB_ATLAS_PROJECT_ID") || 31 | process.env.MONGODB_ATLAS_PROJECT_ID; 32 | const webhookURL = 33 | stack.node.tryGetContext("TEAMS_WEBHOOK_URL") || 34 | process.env.TEAMS_WEBHOOK_URL; 35 | 36 | const props: MicrosoftTeamsIntegrationProps = { 37 | microsoftTeamsWebhookUrl: webhookURL, 38 | projectId: projectId, 39 | }; 40 | 41 | new MicrosoftTeamsIntegration(stack, "teams-integration", props); 42 | -------------------------------------------------------------------------------- /src/l2-resources/third-party-integration/thirdPartyIntegrationBase.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | export interface ThirdPartyIntegrationProps { 15 | /** 16 | * Unique 24-hexadecimal digit string that identifies your project. 17 | */ 18 | readonly projectId: string; 19 | 20 | /** 21 | * Atlas API keys. 22 | */ 23 | readonly profile?: string; 24 | } 25 | -------------------------------------------------------------------------------- /src/l2-resources/third-party-integration/util.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { ThirdPartyIntegrationProps } from "./thirdPartyIntegrationBase"; 16 | 17 | /** 18 | * This method validates that all required properties are present. 19 | * @param props 20 | */ 21 | export const validate = (props: ThirdPartyIntegrationProps) => { 22 | if (!props.projectId) { 23 | throw Error(getPropUndefinedMsg("projectId")); 24 | } 25 | }; 26 | 27 | export const getPropUndefinedMsg = (prop: string) => { 28 | return "Validation error: " + prop + " is not defined"; 29 | }; 30 | -------------------------------------------------------------------------------- /src/l3-resources/atlas-basic/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/src/l3-resources/atlas-basic/.DS_Store -------------------------------------------------------------------------------- /src/l3-resources/atlas-bootstrap/integ.default.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import * as cdk from "aws-cdk-lib"; 16 | import { 17 | MongoAtlasBootstrap, 18 | MongoAtlasBootstrapProps, 19 | AtlasBasicResources, 20 | } from "./index"; 21 | 22 | const app = new cdk.App(); 23 | 24 | const stack = new cdk.Stack(app, "atlas-cdk-bootstrap", { 25 | env: { 26 | region: process.env.CDK_DEFAULT_REGION, 27 | account: process.env.CDK_DEFAULT_ACCOUNT, 28 | }, 29 | }); 30 | 31 | const mongoDBProfile = "development"; 32 | const roleName = "MongoDB-Atlas-CDK-Excecution"; 33 | 34 | const bootstrapProperties: MongoAtlasBootstrapProps = { 35 | roleName: roleName, 36 | secretProfile: mongoDBProfile, 37 | typesToActivate: AtlasBasicResources, 38 | }; 39 | 40 | new MongoAtlasBootstrap(stack, "cdk-bootstrap", bootstrapProperties); 41 | -------------------------------------------------------------------------------- /src/l3-resources/atlas-serverless-basic/integ.default.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import * as cdk from "aws-cdk-lib"; 16 | import { AtlasServerlessBasic } from "./index"; 17 | import * as atlas from "../../index"; 18 | 19 | const app = new cdk.App(); 20 | const stack = new cdk.Stack(app, "atlas-basic-default", { 21 | env: { 22 | region: process.env.CDK_DEFAULT_REGION, 23 | account: process.env.CDK_DEFAULT_ACCOUNT, 24 | }, 25 | }); 26 | 27 | const orgId = "63350255419cf25e3d511c95"; 28 | 29 | new AtlasServerlessBasic(stack, "atlas-basic", { 30 | serverlessProps: { 31 | providerSettings: { 32 | providerName: 33 | atlas.ServerlessInstanceProviderSettingsProviderName.SERVERLESS, 34 | regionName: "US_EAST_1", 35 | }, 36 | continuousBackupEnabled: false, 37 | terminationProtectionEnabled: false, 38 | }, 39 | projectProps: { 40 | orgId: orgId, 41 | name: "AtlasServerlessBasicTest", 42 | }, 43 | profile: "default", 44 | ipAccessListProps: { 45 | accessList: [ 46 | { 47 | ipAddress: "10.10.0.0/24", 48 | comment: "open ip subnet", 49 | }, 50 | ], 51 | }, 52 | }); 53 | -------------------------------------------------------------------------------- /test/l1-resources/access-list-api-key/README.md: -------------------------------------------------------------------------------- 1 | # Api Keys Access List 2 | 3 | ## CFN resource type used 4 | 5 | - MongoDB::Atlas::AccessListAPIKey 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | ## Manual QA 10 | 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Api Keys resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/access-list-api-key/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | ### Success criteria when testing the resource 17 | 18 | 1- go to https://cloud.mongodb.com/v2#/org/{OrgId}/access/apiKeys 19 | 2- find the key created as a prerequisites 20 | 3- in the column Actions click on the "..." button, and select "View Details" 21 | 4- the API access List should be completed with the specified IPS 22 | 23 | ## Important Links 24 | 25 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys) 26 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/data-federation/config/config-aws-s3/) 27 | -------------------------------------------------------------------------------- /test/l1-resources/access-list-api-key/index.test.ts: -------------------------------------------------------------------------------- 1 | import { App, Stack } from "aws-cdk-lib"; 2 | import { Template } from "aws-cdk-lib/assertions"; 3 | import { CfnAccessListApiKey, CfnAccessListApiKeyProps } from "../../../src"; 4 | 5 | const RESOURCE_NAME = "MongoDB::Atlas::AccessListAPIKey"; 6 | const ORG_ID = "63350255419cf25e3d511c95"; 7 | const PROFILE = "default"; 8 | 9 | const propsQueryLimitProps: CfnAccessListApiKeyProps = { 10 | profile: PROFILE, 11 | orgId: ORG_ID, 12 | apiUserId: "64ef512fab473831c9e73b58", 13 | ipAddress: "203.0.113.11", 14 | }; 15 | 16 | test("CfnAccessListApiKey construct should contain default properties", () => { 17 | const mockApp = new App(); 18 | const stack = new Stack(mockApp); 19 | 20 | new CfnAccessListApiKey(stack, "testing-stack", propsQueryLimitProps); 21 | 22 | const template = Template.fromStack(stack); 23 | 24 | template.hasResourceProperties(RESOURCE_NAME, { 25 | Profile: PROFILE, 26 | OrgId: ORG_ID, 27 | APIUserId: "64ef512fab473831c9e73b58", 28 | IpAddress: "203.0.113.11", 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /test/l1-resources/alert-configuration/README.md: -------------------------------------------------------------------------------- 1 | # Alert Configurations 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::AlertConfiguration 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Alert Configuration CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/alert-configuration/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Alert Settings for the respective Project in Atlas should be correctly configured: 17 | ![image](https://user-images.githubusercontent.com/5663078/226870968-9ef8ae46-b0cf-462b-ac62-7229d2d79ac0.png) 18 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 19 | 20 | ## Important Links 21 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Alert-Configurations/operation/listAlertConfigurations) 22 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/configure-alerts/#configure-an-alert) -------------------------------------------------------------------------------- /test/l1-resources/api-key/README.md: -------------------------------------------------------------------------------- 1 | # Api Keys 2 | 3 | ## CFN resource type used 4 | 5 | - MongoDB::Atlas::APIKey 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | ## Manual QA 10 | 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Api Keys resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/api-key/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | ### Success criteria when testing the resource 17 | 18 | - go to https://cloud.mongodb.com/v2#/org/{OrgId}/access/apiKeys 19 | 20 | and verify that the ApiKeys are present 21 | 22 | ## Important Links 23 | 24 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys) 25 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/data-federation/config/config-aws-s3/) 26 | -------------------------------------------------------------------------------- /test/l1-resources/auditing/README.md: -------------------------------------------------------------------------------- 1 | # Auditing 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::Auditing 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Auditing CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/auditing/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - Database Auditing Setting for the respective Project in Atlas should be correctly configured: 19 | ![image](https://user-images.githubusercontent.com/5663078/227519864-2d147a0b-4e57-48f8-8de8-48370f1cd037.png) 20 | 21 | 22 | 23 | ## Important Links 24 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Auditing) 25 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/database-auditing/) -------------------------------------------------------------------------------- /test/l1-resources/cloud-backup-restore-jobs/README.md: -------------------------------------------------------------------------------- 1 | # Cloud Backup Restore Jobs 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::CloudBackUpRestoreJobs 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Cloud Backup Restore Jobs CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/cloud-backup-restore-jobs/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - Backup restore job for the Atlas Cluster should be shown in "Restores & Downloads" page: 19 | ![image](https://user-images.githubusercontent.com/5663078/227225795-0f1b6650-95fe-40ca-942d-99902b747aa2.png) 20 | 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/backup/cloud-backup/restore-overview/) -------------------------------------------------------------------------------- /test/l1-resources/cloud-backup-schedule/README.md: -------------------------------------------------------------------------------- 1 | # Cloud Backup Schedule 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::CloudBackupSchedule 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Cloud Backup Schedule CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/cloud-backup-schedule/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - Backup policy should be updated in the "Backup" page of your cluster: 19 | ![image](https://user-images.githubusercontent.com/5663078/227544843-152b52ee-2c23-40db-b8bd-1391ef64aebc.png) 20 | 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups-Schedule) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/backup/cloud-backup/overview/#std-label-backup-cloud-provider) -------------------------------------------------------------------------------- /test/l1-resources/cloud-backup-schedule/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnCloudBackupSchedule } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::CloudBackupSchedule"; 20 | const PROJECT_ID = "testProjectId"; 21 | const CLUSTER_NAME = "test_host_name"; 22 | const PROFILE = "default"; 23 | 24 | test("CloudBackupSchedule construct should contain default properties", () => { 25 | const mockApp = new App(); 26 | const stack = new Stack(mockApp); 27 | 28 | new CfnCloudBackupSchedule(stack, "testing-stack", { 29 | projectId: PROJECT_ID, 30 | clusterName: CLUSTER_NAME, 31 | profile: PROFILE, 32 | autoExportEnabled: true, 33 | }); 34 | 35 | const template = Template.fromStack(stack); 36 | 37 | template.hasResourceProperties(RESOURCE_NAME, { 38 | ProjectId: PROJECT_ID, 39 | ClusterName: CLUSTER_NAME, 40 | Profile: PROFILE, 41 | AutoExportEnabled: true, 42 | }); 43 | }); 44 | -------------------------------------------------------------------------------- /test/l1-resources/cloud-backup-snapshot/README.md: -------------------------------------------------------------------------------- 1 | # Cloud Backup Snapshots 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::CloudBackupSnapshot 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Cloud Backup Snapshot CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/cloud-backup-snapshot/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - Backup snapshot for the Atlas Cluster should be shown in the "Snapshots" page: 19 | ![image](https://user-images.githubusercontent.com/5663078/227233348-ea32d93a-bfc6-468a-b111-fb12bc0a50ec.png) 20 | 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Cloud-Backups-Schedule) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/backup/cloud-backup/restore-from-snapshot/) -------------------------------------------------------------------------------- /test/l1-resources/cloud-backup-snapshot/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { 18 | CfnCloudBackupSnapshot, 19 | CfnCloudBackupSnapshotPropsInstanceType, 20 | } from "../../../src"; 21 | 22 | const RESOURCE_NAME = "MongoDB::Atlas::CloudBackupSnapshot"; 23 | const PROJECT_ID = "testProjectId"; 24 | const CLUSTER_NAME = "testCluster"; 25 | 26 | test("CloudBackupSnapshot construct should contain default properties", () => { 27 | const mockApp = new App(); 28 | const stack = new Stack(mockApp); 29 | 30 | new CfnCloudBackupSnapshot(stack, "testing-stack", { 31 | projectId: PROJECT_ID, 32 | instanceName: CLUSTER_NAME, 33 | instanceType: CfnCloudBackupSnapshotPropsInstanceType.CLUSTER, 34 | description: "snapshot through cloud formation template", 35 | retentionInDays: 5, 36 | }); 37 | 38 | const template = Template.fromStack(stack); 39 | 40 | template.hasResourceProperties(RESOURCE_NAME, { 41 | ProjectId: PROJECT_ID, 42 | InstanceName: CLUSTER_NAME, 43 | InstanceType: CfnCloudBackupSnapshotPropsInstanceType.CLUSTER, 44 | Description: "snapshot through cloud formation template", 45 | RetentionInDays: 5, 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /test/l1-resources/cluster-outage-simulation/README.md: -------------------------------------------------------------------------------- 1 | # ClusterOutageSimulation 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::ClusterOutageSimulation 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Set any additional required configuration options/parameters as per your needs. 11 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 12 | 13 | ### Success criteria when testing the resource 14 | 1. Cluster Outage Simulation is created successfully. 15 | 16 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 17 | 18 | ## Important Links 19 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cluster-Outage-Simulation) 20 | -------------------------------------------------------------------------------- /test/l1-resources/clusters/README.md: -------------------------------------------------------------------------------- 1 | Cluster 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - AtlasBasic L3 CDK constructor 7 | - Encryption at Rest L3 CDK constructor 8 | - Atlas Quickstart 9 | - Atlas Quickstart Fargate 10 | 11 | ## CFN resource type used 12 | - MongoDB::Atlas::Cluster 13 | 14 | This CFN resource must be active in your AWS account while using this constructor. 15 | 16 | 17 | ## Manual QA 18 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 19 | - Follow prerequisite steps for the corresponding [Cluster CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/cluster/test/README.md). 20 | - Set any additional required configuration options/parameters as per your needs. 21 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 22 | 23 | 24 | ### Success criteria when testing the resource 25 | - A new Cluster should be added to the "Database Deployments" page: 26 | ![image](https://user-images.githubusercontent.com/5663078/227485960-fab8e1c9-b4df-41bb-8fbb-4895e37da2f1.png) 27 | 28 | 29 | ## Important Links 30 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#tag/Global-Clusters) 31 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/manage-clusters/) -------------------------------------------------------------------------------- /test/l1-resources/custom-db-role/README.md: -------------------------------------------------------------------------------- 1 | # Custom DB Roles 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::CustomDBRole 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Custom DB Roles CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/custom-db-role/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - Custom role should be available in the "Database Access" page: 19 | ![image](https://user-images.githubusercontent.com/5663078/227566882-b6bb8a83-988a-402e-9211-ffc0073c5aed.png) 20 | 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Custom-Database-Roles) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-add-mongodb-roles/) -------------------------------------------------------------------------------- /test/l1-resources/custom-dns-configuration-cluster-aws/README.md: -------------------------------------------------------------------------------- 1 | # Custom DNS Configuration Cluster for AWS 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::CustomDnsConfigurationClusterAws 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Custom DNS Configuration Cluster for AWS CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/custom-dns-configuration-cluster-aws/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. AWS custom DNS should be enabled for the project. This can be validated via a [GET API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/AWS-Clusters-DNS/operation/getAWSCustomDNS) call as: 17 | ``` 18 | https://cloud-dev.mongodb.com/api/atlas/v1.0/groups//awsCustomDNS 19 | ``` 20 | 21 | ![image](https://user-images.githubusercontent.com/122359335/227661815-d48398a9-aaa3-4978-9de4-736acab6ddf8.png) 22 | 23 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 24 | 25 | ## Important Links 26 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/AWS-Clusters-DNS/operation/toggleAWSCustomDNS) -------------------------------------------------------------------------------- /test/l1-resources/data-lake-pipeline/README.md: -------------------------------------------------------------------------------- 1 | Datalake Pipeline 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | ## CFN resource type used 7 | - MongoDB::Atlas::DataLakePipeline 8 | 9 | This CFN resource must be active in your AWS account while using this constructor. 10 | 11 | 12 | ## Manual QA 13 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 14 | - Follow prerequisite steps for the corresponding [Datalake Pipeline CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/data-lake-pipeline/README.md). 15 | - Set any additional required configuration options/parameters as per your needs. 16 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 17 | 18 | 19 | ### Success criteria when testing the resource 20 | - Once Datalake pipeline is created 21 | Open Project in the mongodAtlas : Select DataLake on the left panel -> Datalake Pipeline we created will get displayed. 22 | 23 | 24 | ## Important Links 25 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#operation/createPipeline) 26 | - [Resource Usage Documentation](https://www.mongodb.com/docs/datalake/tutorial/add-dataset-pipeline/) -------------------------------------------------------------------------------- /test/l1-resources/database-user/README.md: -------------------------------------------------------------------------------- 1 | # Database User 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - Atlas basis L3 CDK constructor 7 | - Encryption at rest L3 CDK constructor 8 | - Atlas Quickstart 9 | - Atlas Quickstart Fargate 10 | 11 | 12 | ## CFN resource type used 13 | - MongoDB::Atlas::DatabaseUser 14 | 15 | This CFN resource must be active in your AWS account while using this constructor. 16 | 17 | 18 | ## Manual QA 19 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 20 | - Follow prerequisite steps for the corresponding [Database User CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/database-user/test/README.md). 21 | - Set any additional required configuration options/parameters as per your needs. 22 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 23 | 24 | 25 | ### Success criteria when testing the resource 26 | - The Database User should be visible in the "Database Users" page: 27 | ![image](https://user-images.githubusercontent.com/5663078/227314604-d15f10a4-5e3b-4010-b94f-621ec55eceb3.png) 28 | 29 | 30 | ## Important Links 31 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Database-Users) 32 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-add-mongodb-users/) -------------------------------------------------------------------------------- /test/l1-resources/datalakes/README.md: -------------------------------------------------------------------------------- 1 | # Datalakes 2 | 3 | 4 | ## CFN resource type used 5 | - MongoDB::Atlas::DataLakes 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | 10 | ## Manual QA 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [DataLakes CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/datalakes/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | - You should see your data federation in the "Data Federation" page: 19 | ![image](https://user-images.githubusercontent.com/5663078/227923171-b9aa0067-d8a0-41b3-94c5-9e5ce5ea222c.png) 20 | 21 | 22 | ## Important Links 23 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#tag/Data-Federationt) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/data-federation/config/config-adl-datasets/) -------------------------------------------------------------------------------- /test/l1-resources/encryption-at-rest/README.md: -------------------------------------------------------------------------------- 1 | # Encryption At Rest 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - Encryption at rest L2 CDK constructor 7 | - Encryption at rest L3 CDK constructor 8 | 9 | ## CFN resource type used 10 | - MongoDB::Atlas::EncryptionAtRest 11 | 12 | This CFN resource must be active in your AWS account while using this constructor. 13 | 14 | 15 | ## Manual QA 16 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 17 | - Follow prerequisite steps for the corresponding [Encryption At Rest CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/encryption-at-rest/test/README.md). 18 | - Set any additional required configuration options/parameters as per your needs. 19 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 20 | 21 | 22 | ### Success criteria when testing the resource 23 | - You should see the option "Encryption at Rest using your Key Management" enabled in the "Advanced" page: 24 | ![image](https://user-images.githubusercontent.com/5663078/227896265-7e489e9e-2666-4faa-8d10-5c8b3ee77620.png) 25 | 26 | ## Important Links 27 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/updateEncryptionAtRest) 28 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-kms-encryption/) -------------------------------------------------------------------------------- /test/l1-resources/federated-database-instance/README.md: -------------------------------------------------------------------------------- 1 | # Federated Database Instance 2 | 3 | ## CFN resource type used 4 | 5 | # MongoDB::Atlas::FederatedDatabaseInstance 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | ## Manual QA 10 | 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Federated Database Instance CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/federated-database-instance/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | ### Success criteria when testing the resource 17 | 18 | - Custom role should be available in the "Database Access" page: 19 | ![image](./test/readmeimages/federated-database-instance.png) 20 | 21 | ## Important Links 22 | 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/createFederatedDatabase) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/data-federation/admin/manage-federated-database/) 25 | -------------------------------------------------------------------------------- /test/l1-resources/federated-query-limit/README.md: -------------------------------------------------------------------------------- 1 | # Federated Query Limit 2 | 3 | ## CFN resource type used 4 | 5 | - MongoDB::Atlas::FederatedQueryLimit 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | ## Manual QA 10 | 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Federated query limit CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/federated-query-limit/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | ### Success criteria when testing the resource 17 | 18 | - Custom role should be available in the "Database Access" page: 19 | ![image](./test/readmeimages/federated-query-limit.png) 20 | 21 | ## Important Links 22 | 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/returnFederatedDatabaseQueryLimits) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/data-federation/query/manage-query-limits/) 25 | -------------------------------------------------------------------------------- /test/l1-resources/federated-settings-org-role-mapping/README.md: -------------------------------------------------------------------------------- 1 | # Federated Settings Org Role Mapping 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::FederatedSettingsOrgRoleMapping 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [FederatedSettingsOrgRoleMapping CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/federated-settings-org-role-mapping/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | - Use this URL to view RoleMappings configured for your organization: https://cloud.mongodb.com/v2#/federation//organizations//roleMappings 14 | 15 | 16 | ### Success criteria when testing the resource 17 | 1. Role mappings should be correctly configured for the Organization under Federation settings: 18 | 19 | ![image](https://user-images.githubusercontent.com/122359335/227274727-bee557f4-8def-467e-ad37-adcae1887911.png) 20 | 21 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 22 | 23 | ## Important Links 24 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Federated-Authentication/operation/createRoleMapping) 25 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security/manage-role-mapping/#role-mapping-process) -------------------------------------------------------------------------------- /test/l1-resources/global-cluster-config/README.md: -------------------------------------------------------------------------------- 1 | # @mongodbatlas-awscdk/global-cluster-config 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::GlobalClusterConfig 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Prerequisites 9 | ### Resources needed to run the manual QA 10 | These resources are created as part of `cfn-testing-helper.sh` 11 | - Atlas Project 12 | - Atlas Cluster (at least M30) 13 | 14 | ## Manual QA 15 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 16 | - Follow prerequisite steps for the corresponding [GlobalClusterConfig CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/global-cluster-config/test/README.md). 17 | - Set any additional required configuration options/parameters as per your needs. 18 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 19 | 20 | 21 | ### Success criteria when testing the resource 22 | 1. Custom Zone Mappings and ManagedNamespaces should be configured for the global cluster as specified in the template. 23 | 24 | This can be validated via GET API call at URL: 25 | `https://cloud-dev.mongodb.com/api/atlas/v1.0/groups//clusters//globalWrites` 26 | 27 | ![image](https://user-images.githubusercontent.com/122359335/229160264-92715616-656e-4e7c-bd33-b6241041f9ae.png) 28 | 29 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 30 | 31 | ## Important Links 32 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Global-Clusters) 33 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/global-clusters/) -------------------------------------------------------------------------------- /test/l1-resources/global-cluster-config/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnGlobalClusterConfig } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::GlobalClusterConfig"; 20 | const PROFILE = "default"; 21 | const PROJECT_ID = "projID"; 22 | const CLUSTER_NAME = "ClusterName"; 23 | 24 | test("Teams construct should contain default properties", () => { 25 | const mockApp = new App(); 26 | const stack = new Stack(mockApp); 27 | 28 | new CfnGlobalClusterConfig(stack, "testing-stack", { 29 | projectId: PROJECT_ID, 30 | clusterName: CLUSTER_NAME, 31 | profile: PROFILE, 32 | }); 33 | 34 | const template = Template.fromStack(stack); 35 | 36 | template.hasResourceProperties(RESOURCE_NAME, { 37 | Profile: PROFILE, 38 | ProjectId: PROJECT_ID, 39 | ClusterName: CLUSTER_NAME, 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /test/l1-resources/ldap-configuration/README.md: -------------------------------------------------------------------------------- 1 | # LDAP Configuration 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::LDAPConfiguration 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [LDAPConfiguration CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/ldap-configuration/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. LDAP Authentication (under Advanced section) should be correctly set up in your Atlas Project as per configuration specified in the inputs/example: 17 | ![image](https://user-images.githubusercontent.com/122359335/227264049-b1e44366-553c-417a-b541-15589a636037.png) 18 | 19 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 20 | 21 | ## Important Links 22 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/LDAP-Configuration) 23 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-ldaps/) -------------------------------------------------------------------------------- /test/l1-resources/ldap-configuration/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnLdapConfiguration } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::LDAPConfiguration"; 20 | const PROJECT_ID = "testProjectId"; 21 | const HOST_NAME = "test_host_name"; 22 | const BIND_USER_NAME = "test_user_name"; 23 | const BIND_USER_PASSWORD = "test_bind"; 24 | const PORT = 9090; 25 | 26 | test("AtlasLdapVerify construct should contain default properties", () => { 27 | const mockApp = new App(); 28 | const stack = new Stack(mockApp); 29 | 30 | new CfnLdapConfiguration(stack, "testing-stack", { 31 | projectId: PROJECT_ID, 32 | bindUsername: BIND_USER_NAME, 33 | bindPassword: BIND_USER_PASSWORD, 34 | hostname: HOST_NAME, 35 | port: PORT, 36 | }); 37 | 38 | const template = Template.fromStack(stack); 39 | 40 | template.hasResourceProperties(RESOURCE_NAME, { 41 | ProjectId: PROJECT_ID, 42 | BindUsername: BIND_USER_NAME, 43 | BindPassword: BIND_USER_PASSWORD, 44 | Hostname: HOST_NAME, 45 | Port: PORT, 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /test/l1-resources/ldap-verify/README.md: -------------------------------------------------------------------------------- 1 | # LDAP Verify 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::LDAPVerify 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [LDAPVerify CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/ldap-verify/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. In the AWS CloudFormation stack, Output parameters should be correct as per LDAP configuration in your Atlas Project. 17 | ![image](https://user-images.githubusercontent.com/122359335/227264049-b1e44366-553c-417a-b541-15589a636037.png) 18 | 19 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 20 | 21 | ## Important Links 22 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api/ldaps-configuration-request-verification/) 23 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-ldaps/) -------------------------------------------------------------------------------- /test/l1-resources/ldap-verify/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnLdapVerify } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::LDAPVerify"; 20 | const PROJECT_ID = "testProjectId"; 21 | const HOST_NAME = "test_host_name"; 22 | const BIND_USER_NAME = "test_user_name"; 23 | const BIND_USER_PASSWORD = "test_bind"; 24 | const PORT = 9090; 25 | 26 | test("AtlasLdapVerify construct should contain default properties", () => { 27 | const mockApp = new App(); 28 | const stack = new Stack(mockApp); 29 | 30 | new CfnLdapVerify(stack, "testing-stack", { 31 | projectId: PROJECT_ID, 32 | bindUsername: BIND_USER_NAME, 33 | bindPassword: BIND_USER_PASSWORD, 34 | hostName: HOST_NAME, 35 | port: PORT, 36 | }); 37 | 38 | const template = Template.fromStack(stack); 39 | 40 | template.hasResourceProperties(RESOURCE_NAME, { 41 | ProjectId: PROJECT_ID, 42 | BindUsername: BIND_USER_NAME, 43 | BindPassword: BIND_USER_PASSWORD, 44 | HostName: HOST_NAME, 45 | Port: PORT, 46 | }); 47 | }); 48 | -------------------------------------------------------------------------------- /test/l1-resources/maintenance-window/README.md: -------------------------------------------------------------------------------- 1 | # Maintenance Window 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::MaintenanceWindow 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Maintenance Window CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/maintenance-window/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Atlas Project should show configured maintenance window correctly under Project Settings: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227540482-6f021ea1-7b7e-4fbf-b883-1d9e0e2eea9a.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Maintenance-Windows) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/tutorial/cluster-maintenance-window/) -------------------------------------------------------------------------------- /test/l1-resources/network-container/README.md: -------------------------------------------------------------------------------- 1 | # Network Container 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | - Network container L1 CDK constructor 6 | 7 | 8 | ## CFN resource type used 9 | - MongoDB::Atlas::NetworkContainer 10 | 11 | This CFN resource must be active in your AWS account while using this constructor. 12 | 13 | ## Manual QA 14 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 15 | - Follow prerequisite steps for the corresponding [Network container CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/network-container/test/README.md). 16 | - Set any additional required configuration options/parameters as per your needs. 17 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 18 | 19 | 20 | 21 | ### Success criteria when testing the resource 22 | 1. You should be able to see the container created when running the following Atlas CLI command: 23 | ```bash 24 | atlas networking container ls --projectId 641d818e36e2eb47d038f8c2 25 | [ 26 | { 27 | "atlasCidrBlock": "10.8.2.0/24", 28 | "id": "", 29 | "providerName": "AWS", 30 | "provisioned": false, 31 | "regionName": "US_EAST_1" 32 | } 33 | ] 34 | ``` 35 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 36 | 37 | 38 | 39 | ## Important Links 40 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Network-Peering) 41 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/reference/atlas-operator/ak8so-network-peering/) 42 | -------------------------------------------------------------------------------- /test/l1-resources/network-peering/README.md: -------------------------------------------------------------------------------- 1 | # Network peering 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - Quickstart VPC peering 7 | 8 | 9 | ## CFN resource type used 10 | - MongoDB::Atlas::NetworkPeering 11 | 12 | This CFN resource must be active in your AWS account while using this constructor. 13 | 14 | 15 | ## Manual QA 16 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 17 | - Follow prerequisite steps for the corresponding [Network peering CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/network-peering/test/README.md). 18 | - Set any additional required configuration options/parameters as per your needs. 19 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 20 | 21 | 22 | ### Success criteria when testing the resource 23 | - You should be able to see the network peering in the "Network Access" page: 24 | ![image](https://user-images.githubusercontent.com/5663078/227514067-123c7343-1066-4ba7-802a-03a73a810c78.png) 25 | 26 | 27 | ## Important Links 28 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Network-Peering) 29 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/reference/atlas-operator/ak8so-network-peering/) -------------------------------------------------------------------------------- /test/l1-resources/online-archive/README.md: -------------------------------------------------------------------------------- 1 | # Online Archive 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::OnlineArchive 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Online Archive CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/online-archive/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Online archive should be created in the specified test project: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227655088-8c1d44d3-da02-4413-af2a-5d814ab113a8.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Online-Archive) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/online-archive/connect-to-online-archive/) 25 | -------------------------------------------------------------------------------- /test/l1-resources/org-invitation/README.md: -------------------------------------------------------------------------------- 1 | # Org Invitation 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::OrgInvitation 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [OrgInvitation CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/org-invitation/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Under Access Manager for your Atlas Organization, you should see a new entry under “Users” tab with status “PENDING INVITE” 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227275914-4af66737-fa72-49f8-8713-9d298606bc4f.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api/organization-create-one-invitation/#invite-one-user-to-an-service-organization) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/invitations/#invitations-to-organizations-and-projects) -------------------------------------------------------------------------------- /test/l1-resources/organization/README.md: -------------------------------------------------------------------------------- 1 | # Organization 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::Organization 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Set any additional required configuration options/parameters as per your needs. 11 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 12 | 13 | ### Success criteria when testing the resource 14 | 1. The Atlas Organization is created successfully. 15 | 16 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 17 | 18 | ## Important Links 19 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations) 20 | -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-adl/README.md: -------------------------------------------------------------------------------- 1 | # Private Endpoint ADL 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::PrivateEndpointADL 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [PrivateEndpointADL CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/private-endpoint-adl/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Private Endpoint should be correctly set up in your Atlas Project as per configuration specified in the inputs/example: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227305880-c6c70d20-7f38-4885-a3ed-1de7b4921aa3.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Private-Endpoint-Services) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-cluster-private-endpoint/#set-up-a-private-endpoint-for-a-dedicated-cluster) -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-adl/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnPrivateEndpointAdl } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::PrivateEndpointADL"; 20 | const PROJECT_ID = "testProjectId"; 21 | const PROVIDER = "AWS"; 22 | 23 | test("CfnPrivateEndpointAdl construct should contain default properties", () => { 24 | const mockApp = new App(); 25 | const stack = new Stack(mockApp); 26 | 27 | new CfnPrivateEndpointAdl(stack, "testing-stack", { 28 | projectId: PROJECT_ID, 29 | provider: PROVIDER, 30 | }); 31 | 32 | const template = Template.fromStack(stack); 33 | 34 | template.hasResourceProperties(RESOURCE_NAME, { 35 | ProjectId: PROJECT_ID, 36 | Provider: PROVIDER, 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-aws/README.md: -------------------------------------------------------------------------------- 1 | # Private Endpoint 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::PrivateEndpoint 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [PrivateEndpoint CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/private-endpoint/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Private Endpoint should be correctly set up in your Atlas Project as per configuration specified in the inputs/example: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227300711-ca08e118-8718-4285-a975-8ec4e01899f9.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Private-Endpoint-Services) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-cluster-private-endpoint/#set-up-a-private-endpoint-for-a-dedicated-cluster) -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-aws/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnPrivateEndpointAws } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::PrivateEndpointAWS"; 20 | const ENDPOINT_SERVICE_ID = "testendpointserviceId"; 21 | const PROJECT_NAME = "projtest"; 22 | const PROFILE = "default"; 23 | const INTERFACE_ENDPOINT_ID = "testinterface"; 24 | 25 | test("CfnPrivateEndpointService construct should contain default properties", () => { 26 | const mockApp = new App(); 27 | const stack = new Stack(mockApp); 28 | 29 | new CfnPrivateEndpointAws(stack, "testing-stack", { 30 | projectId: PROJECT_NAME, 31 | endpointServiceId: ENDPOINT_SERVICE_ID, 32 | profile: PROFILE, 33 | id: INTERFACE_ENDPOINT_ID, 34 | enforceConnectionSuccess: true, 35 | }); 36 | 37 | const template = Template.fromStack(stack); 38 | 39 | template.hasResourceProperties(RESOURCE_NAME, { 40 | ProjectId: PROJECT_NAME, 41 | EndpointServiceId: ENDPOINT_SERVICE_ID, 42 | Profile: PROFILE, 43 | Id: INTERFACE_ENDPOINT_ID, 44 | EnforceConnectionSuccess: true, 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-regional-mode/README.md: -------------------------------------------------------------------------------- 1 | # Private Endpoint Regional Mode 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::PrivateEndPointRegionalMode 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [PrivateEndPointRegionalMode CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/private-endpoint-regional-mode/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Regionalized private endpoints setting should be enabled under Project Settings: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227656275-fd32b882-8b7d-4427-af6c-c4dc68fefd76.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Private-Endpoint-Services/operation/returnRegionalizedPrivateEndpointStatus) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-private-endpoint/#enable-regionalized-private-endpoints-1) -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-regional-mode/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnPrivateEndPointRegionalMode } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::PrivateEndPointRegionalMode"; 20 | const PROJECT_ID = "testProjectId"; 21 | 22 | test("CfnPrivateEndPointRegionalMode construct should contain default properties", () => { 23 | const mockApp = new App(); 24 | const stack = new Stack(mockApp); 25 | 26 | new CfnPrivateEndPointRegionalMode(stack, "testing-stack", { 27 | projectId: PROJECT_ID, 28 | }); 29 | 30 | const template = Template.fromStack(stack); 31 | 32 | template.hasResourceProperties(RESOURCE_NAME, { 33 | ProjectId: PROJECT_ID, 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-service/README.md: -------------------------------------------------------------------------------- 1 | # Private Endpoint 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::PrivateEndpoint 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [PrivateEndpoint CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/private-endpoint/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Private Endpoint should be correctly set up in your Atlas Project as per configuration specified in the inputs/example: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227300711-ca08e118-8718-4285-a975-8ec4e01899f9.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Private-Endpoint-Services) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-cluster-private-endpoint/#set-up-a-private-endpoint-for-a-dedicated-cluster) -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint-service/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { 18 | CfnPrivateEndpointService, 19 | CfnPrivateEndpointServicePropsCloudProvider, 20 | } from "../../../src"; 21 | 22 | const RESOURCE_NAME = "MongoDB::Atlas::PrivateEndpointService"; 23 | const REGION = "US_EAST_1"; 24 | const PROJECT_ID = "projtest"; 25 | const PROFILE = "default"; 26 | 27 | test("CfnCloudBackUpRestoreJobs construct should contain default properties", () => { 28 | const mockApp = new App(); 29 | const stack = new Stack(mockApp); 30 | 31 | new CfnPrivateEndpointService(stack, "testing-stack", { 32 | projectId: PROJECT_ID, 33 | region: REGION, 34 | profile: PROFILE, 35 | cloudProvider: CfnPrivateEndpointServicePropsCloudProvider.AWS, 36 | }); 37 | 38 | const template = Template.fromStack(stack); 39 | 40 | template.hasResourceProperties(RESOURCE_NAME, { 41 | ProjectId: PROJECT_ID, 42 | Region: REGION, 43 | Profile: PROFILE, 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /test/l1-resources/private-endpoint/README.md: -------------------------------------------------------------------------------- 1 | # Private Endpoint 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::PrivateEndpoint 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [PrivateEndpoint CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/private-endpoint/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Private Endpoint should be correctly set up in your Atlas Project as per configuration specified in the inputs/example: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227300711-ca08e118-8718-4285-a975-8ec4e01899f9.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Private-Endpoint-Services) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-cluster-private-endpoint/#set-up-a-private-endpoint-for-a-dedicated-cluster) -------------------------------------------------------------------------------- /test/l1-resources/privatelink-endpoint-service-data-federation-online-archive/README.md: -------------------------------------------------------------------------------- 1 | # Privatelink Endpoint Service Data Federation Online Archive 2 | 3 | ## CFN resource type used 4 | 5 | - MongoDB::Atlas::PrivatelinkEndpointServiceDataFederationOnlineArchive 6 | 7 | This CFN resource must be active in your AWS account while using this constructor. 8 | 9 | ## Manual QA 10 | 11 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 12 | - Follow prerequisite steps for the corresponding [Privatelink Endpoint Service Data Federation Online Archive CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/custom-db-role/test/README.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | ### Success criteria when testing the resource 17 | 18 | - Custom role should be available in the "Database Access" page: 19 | ![image](https://user-images.githubusercontent.com/5663078/227566882-b6bb8a83-988a-402e-9211-ffc0073c5aed.png) 20 | 21 | ## Important Links 22 | 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Custom-Database-Roles) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-add-mongodb-roles/) 25 | -------------------------------------------------------------------------------- /test/l1-resources/project-invitation/README.md: -------------------------------------------------------------------------------- 1 | # Project Invitation 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::ProjectInvitation 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [ProjectInvitation CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/project-invitation/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | - Atlas Project Access Manager should show `PENDING INVITE` for invited user: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227505950-afc41fa7-abb5-478b-807d-c9510a40888c.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Projects/operation/createProjectInvitation) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/invitations/) -------------------------------------------------------------------------------- /test/l1-resources/project-invitation/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnProjectInvitation } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::ProjectInvitation"; 20 | const PROFILE = "default"; 21 | 22 | test("CfnProjectInvitation construct should contain default properties", () => { 23 | const mockApp = new App(); 24 | const stack = new Stack(mockApp); 25 | 26 | new CfnProjectInvitation(stack, "testing-stack", { 27 | profile: PROFILE, 28 | }); 29 | 30 | const template = Template.fromStack(stack); 31 | 32 | template.hasResourceProperties(RESOURCE_NAME, { 33 | Profile: PROFILE, 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /test/l1-resources/project-ip-access-list/README.md: -------------------------------------------------------------------------------- 1 | # Project IP Access List 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - Atlas Basic L3 CDK constructor 7 | - Encryption at rest L3 CDK constructor 8 | - Atlas Quickstart 9 | 10 | 11 | ## CFN resource type used 12 | - MongoDB::Atlas::ProjectIpAccessList 13 | 14 | This CFN resource must be active in your AWS account while using this constructor. 15 | 16 | 17 | ## Manual QA 18 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 19 | - Follow prerequisite steps for the corresponding [Project Access List CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/project-ip-access-list/test/README.md). 20 | - Set any additional required configuration options/parameters as per your needs. 21 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 22 | 23 | 24 | ### Success criteria when testing the resource 25 | - A new entry should be added to the "Network Access" page: 26 | ![image](https://user-images.githubusercontent.com/5663078/227484402-9189af3d-a3f0-4bde-a288-9ee847e6eeab.png) 27 | ## Important Links 28 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#operation/createProjectIpAccessList) 29 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security/ip-access-list/) 30 | 31 | 32 | ## Important Links 33 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#operation/createProjectIpAccessList) 34 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security/ip-access-list/) -------------------------------------------------------------------------------- /test/l1-resources/project/README.md: -------------------------------------------------------------------------------- 1 | # Project IP Access List 2 | 3 | ## Impact 4 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 5 | 6 | - Atlas Basic L3 CDK constructor 7 | - Encryption at rest L3 CDK constructor 8 | - Atlas Quickstart 9 | 10 | 11 | ## CFN resource type used 12 | - MongoDB::Atlas::ProjectIpAccessList 13 | 14 | This CFN resource must be active in your AWS account while using this constructor. 15 | 16 | 17 | ## Manual QA 18 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 19 | - Follow prerequisite steps for the corresponding [Project Access List CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/project-ip-access-list/test/README.md). 20 | - Set any additional required configuration options/parameters as per your needs. 21 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 22 | 23 | 24 | ### Success criteria when testing the resource 25 | - A new entry should be added to the "Network Access" page: 26 | ![image](https://user-images.githubusercontent.com/5663078/227484402-9189af3d-a3f0-4bde-a288-9ee847e6eeab.png) 27 | ## Important Links 28 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#operation/createProjectIpAccessList) 29 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security/ip-access-list/) 30 | 31 | 32 | ## Important Links 33 | - [API Documentation](https://docs-atlas-staging.mongodb.com/cloud-docs/docsworker-xlarge/openapi-docs-test/reference/api-resources-spec/#operation/createProjectIpAccessList) 34 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security/ip-access-list/) -------------------------------------------------------------------------------- /test/l1-resources/search-index/README.md: -------------------------------------------------------------------------------- 1 | # Search Index 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::SearchIndex 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [SearchIndex CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/search-index/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Search Index should be created in `ACTIVE` state for the database: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227660157-b51c16cd-7a87-40b6-bdd9-9bbf44efeeec.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Atlas-Search) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/atlas-search/create-index/) -------------------------------------------------------------------------------- /test/l1-resources/serverless-instance/README.md: -------------------------------------------------------------------------------- 1 | # Serverless Instance 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::ServerlessInstance 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Serverless instance CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/serverless-instance/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. A serverless instance should show correctly configured for the database: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/228200365-6e5950d8-1284-426c-97c8-57a6b24181d6.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Serverless-Instances) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/tutorial/create-serverless-instance/) -------------------------------------------------------------------------------- /test/l1-resources/serverless-private-endpoint/README.md: -------------------------------------------------------------------------------- 1 | # Serverless Private Endpoint 2 | 3 | ## Impact 4 | 5 | The following components use this resource and are potentially impacted by any changes. They should also be validated to ensure the changes do not cause a regression. 6 | 7 | - Serverless private endpoint L1 CDK constructor 8 | 9 | ## CFN resource type used 10 | 11 | - MongoDB::Atlas::ServerlessPrivateEndpoint 12 | 13 | This CFN resource must be active in your AWS account while using this constructor. 14 | 15 | ## Manual QA 16 | 17 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 18 | - Follow prerequisite steps for the corresponding [Network container CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/serverless-private-endpoint/test/README.md). 19 | - Set any additional required configuration options/parameters as per your needs. 20 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 21 | 22 | ### Success criteria when testing the resource 23 | 24 | 1. Go to https://cloud.mongodb.com/v2/{projectId}/security/network/privateEndpoint 25 | 2. go to the private ednpoint tab 26 | 3. go to the Serverless Instance tab 27 | 4. validate that the private endpoint is created and available 28 | 29 | ## Important Links 30 | 31 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Network-Peering) 32 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/reference/atlas-operator/ak8so-network-peering/) 33 | -------------------------------------------------------------------------------- /test/l1-resources/serverless-private-endpoint/index.test.ts: -------------------------------------------------------------------------------- 1 | import { App, Stack } from "aws-cdk-lib"; 2 | import { Template } from "aws-cdk-lib/assertions"; 3 | import { 4 | CfnServerlessPrivateEndpoint, 5 | AwsPrivateEndpointConfig, 6 | } from "../../../src"; 7 | 8 | const RESOURCE_NAME = "MongoDB::Atlas::ServerlessPrivateEndpoint"; 9 | const INSTANCE_NAME = "testserverlessprivateendpoint"; 10 | const PROJECT_ID = "64f0d46e7d714b7c26d984d8"; 11 | const PROFILE = "default"; 12 | 13 | test("CfnServerlessPrivateEndpoint construct should contain default properties", () => { 14 | const mockApp = new App(); 15 | const stack = new Stack(mockApp); 16 | 17 | const awsPrivateEndpointConfig: AwsPrivateEndpointConfig = { 18 | vpcId: "vpc-078fe50fc2313c001", 19 | subnetIds: ["subnet-0a2f7a198e5d6d6a6"], 20 | region: "", 21 | }; 22 | 23 | new CfnServerlessPrivateEndpoint( 24 | stack, 25 | "testing-serverlessPrivateEndpointWithAws", 26 | { 27 | projectId: PROJECT_ID, 28 | profile: PROFILE, 29 | instanceName: INSTANCE_NAME, 30 | createAndAssignAwsPrivateEndpoint: false, 31 | comment: "this is a comment", 32 | awsPrivateEndpointConfigurationProperties: awsPrivateEndpointConfig, 33 | } 34 | ); 35 | 36 | const template = Template.fromStack(stack); 37 | 38 | template.hasResourceProperties(RESOURCE_NAME, { 39 | ProjectId: PROJECT_ID, 40 | Profile: PROFILE, 41 | InstanceName: INSTANCE_NAME, 42 | CreateAndAssignAWSPrivateEndpoint: false, 43 | Comment: "this is a comment", 44 | AwsPrivateEndpointConfigurationProperties: { 45 | VpcId: "vpc-078fe50fc2313c001", 46 | SubnetIds: ["subnet-0a2f7a198e5d6d6a6"], 47 | Region: "", 48 | }, 49 | }); 50 | }); 51 | -------------------------------------------------------------------------------- /test/l1-resources/teams/README.md: -------------------------------------------------------------------------------- 1 | # Teams 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::Teams 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Teams CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/teams/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Atlas Team should show correctly configured in respective Organization's Access Manager (and in Project Access Manager, if applicable): 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227534552-a338f068-2e60-4179-91cd-7a634a2dc9b3.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Teams) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/access/manage-teams-in-orgs/) -------------------------------------------------------------------------------- /test/l1-resources/teams/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnTeams } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::Teams"; 20 | const PROFILE = "default"; 21 | 22 | test("Teams construct should contain default properties", () => { 23 | const mockApp = new App(); 24 | const stack = new Stack(mockApp); 25 | 26 | new CfnTeams(stack, "testing-stack", { 27 | profile: PROFILE, 28 | }); 29 | 30 | const template = Template.fromStack(stack); 31 | 32 | template.hasResourceProperties(RESOURCE_NAME, { 33 | Profile: PROFILE, 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /test/l1-resources/third-party-integration/README.md: -------------------------------------------------------------------------------- 1 | # Third Party Integrations 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::ThirdPartyIntegration 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Third Party Integration CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/third-party-inetgration/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Atlas Project should show correctly configured integration with chosen third-party service, for example Datadog: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227501805-7eee80cc-12a0-4a80-8400-09a283655187.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Third-Party-Integrations/operation/createThirdPartyIntegration) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/tutorial/third-party-service-integrations/) -------------------------------------------------------------------------------- /test/l1-resources/trigger/README.md: -------------------------------------------------------------------------------- 1 | # Trigger 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::Trigger 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Trigger CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/trigger/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Trigger should be set up in your Atlas account as per configuration specified in the inputs/example. 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227495196-59063691-c475-449c-b6b1-f206f4404715.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/app-services/admin/api/v3/#tag/triggers) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/triggers/#service-functions-provide-server-side-logic) -------------------------------------------------------------------------------- /test/l1-resources/trigger/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnTrigger } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::Trigger"; 20 | const PROJECT_ID = "testProjectId"; 21 | const APPID = "appId"; 22 | const NAME = "name"; 23 | const TYPE = "type"; 24 | 25 | test("Trigger construct should contain default properties", () => { 26 | const mockApp = new App(); 27 | const stack = new Stack(mockApp); 28 | 29 | new CfnTrigger(stack, "testing-stack", { 30 | projectId: PROJECT_ID, 31 | appId: APPID, 32 | name: NAME, 33 | type: TYPE, 34 | }); 35 | 36 | const template = Template.fromStack(stack); 37 | 38 | template.hasResourceProperties(RESOURCE_NAME, { 39 | ProjectId: PROJECT_ID, 40 | AppId: APPID, 41 | Name: NAME, 42 | Type: TYPE, 43 | }); 44 | }); 45 | -------------------------------------------------------------------------------- /test/l1-resources/x509-authentication-database-user/README.md: -------------------------------------------------------------------------------- 1 | # X509 Authentication Database User 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::X509AuthenticationDatabaseUser 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [X509AuthenticationDatabaseUser CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/blob/master/cfn-resources/x509-authentication-database-user/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. X.509 Authentication should be enabled correctly set up in your Atlas Project as per configuration specified in the inputs/example. This can be found under Security section -> Advanced: 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227374480-1afa48a4-5265-4a2a-ad92-067f5015eeca.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/X.509-Authentication/operation/createDatabaseUserCertificate) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-self-managed-x509/#set-up-self-managed-x.509-authentication) -------------------------------------------------------------------------------- /test/l1-resources/x509-authentication-database-user/index.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | import { App, Stack } from "aws-cdk-lib"; 16 | import { Template } from "aws-cdk-lib/assertions"; 17 | import { CfnX509AuthenticationDatabaseUser } from "../../../src"; 18 | 19 | const RESOURCE_NAME = "MongoDB::Atlas::X509AuthenticationDatabaseUser"; 20 | const PROJECT_ID = "testProjectId"; 21 | 22 | test("X509AuthenticationDatabaseUser construct should contain default properties", () => { 23 | const mockApp = new App(); 24 | const stack = new Stack(mockApp); 25 | 26 | new CfnX509AuthenticationDatabaseUser(stack, "testing-stack", { 27 | projectId: PROJECT_ID, 28 | }); 29 | 30 | const template = Template.fromStack(stack); 31 | 32 | template.hasResourceProperties(RESOURCE_NAME, { 33 | ProjectId: PROJECT_ID, 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /test/l2-resources/encryption-at-rest/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-encryption-at-rest 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::EncryptionAtRest 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | 9 | ## Manual QA 10 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 11 | - Follow prerequisite steps for the corresponding [Encryption At Rest CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/cfn-resources/encryption-at-rest/test/README.md). 12 | - Set any additional required configuration options/parameters as per your needs. 13 | - Please, follows the steps in [TESTING.md](../../../TESTING.md). 14 | 15 | 16 | ### Success criteria when testing the resource 17 | - You should see the option "Encryption at Rest using your Key Management" enabled in the "Advanced" page: 18 | ![image](https://user-images.githubusercontent.com/5663078/227896265-7e489e9e-2666-4faa-8d10-5c8b3ee77620.png) 19 | 20 | ## Important Links 21 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/updateEncryptionAtRest) 22 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/security-kms-encryption/) 23 | -------------------------------------------------------------------------------- /test/l2-resources/third-party-integration/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-integrations 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::ThirdPartyIntegration 5 | 6 | This CFN resource must be active in your AWS account while using this constructor. 7 | 8 | ## Manual QA 9 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 10 | - Follow prerequisite steps for the corresponding [Third Party Integration CFN resource](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/cfn-resources/third-party-inetgration/test/README.md). 11 | - Set any additional required configuration options/parameters as per your needs. 12 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 13 | 14 | 15 | ### Success criteria when testing the resource 16 | 1. Atlas Project should show correctly configured integration with chosen third-party service, for example DatadogIntegration(..): 17 | 18 | ![image](https://user-images.githubusercontent.com/122359335/227501805-7eee80cc-12a0-4a80-8400-09a283655187.png) 19 | 20 | 2. Ensure general [CDK resource success criteria](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/TESTING.md) for this resource is met. 21 | 22 | ## Important Links 23 | - [API Documentation](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/#tag/Third-Party-Integrations/operation/createThirdPartyIntegration) 24 | - [Resource Usage Documentation](https://www.mongodb.com/docs/atlas/tutorial/third-party-service-integrations/) 25 | -------------------------------------------------------------------------------- /test/l2-resources/third-party-integration/constants.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2023 MongoDB Inc 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | export const THIRD_PARTY_INTEGRATION_RESOURCE_NAME: string = 16 | "MongoDB::Atlas::ThirdPartyIntegration"; 17 | export const TEST_PROJECT_ID: string = "testProjectId"; 18 | export const TEST_WEBHOOK_URL: string = "https://testwebhook.com/tst"; 19 | export const TEST_KEY: string = "testKey"; 20 | -------------------------------------------------------------------------------- /test/l3-resources/atlas-basic/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-basic 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::Project 5 | - MongoDB::Atlas::Cluster 6 | - MongoDB::Atlas::DatabaseUser 7 | - MongoDB::Atlas::ProjectIpAccessList 8 | 9 | These CFN resources must be active in your AWS account while using this constructor. 10 | 11 | ## Manual QA 12 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/TESTING.md). 13 | - Set any additional required configuration options/parameters as per your needs. 14 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 15 | 16 | 17 | ### Success criteria when testing the resource 18 | 1. Ensure all underlying resources are configured correctly as specified (Atlas Project, Cluster, Network IPAccessList and DatabaseUser): 19 | 20 | ![image](https://user-images.githubusercontent.com/122359335/228263898-9d9c3a8a-ddc5-4cf6-9f7e-256b7c976b54.png) 21 | 22 | ![image](https://user-images.githubusercontent.com/122359335/228263913-8fbad8e7-7a60-4eae-aac5-9bccc2dc9242.png) 23 | 24 | ![image](https://user-images.githubusercontent.com/122359335/228263944-f4b35480-7cc3-4b6d-afbb-cd8975ecab19.png) 25 | 26 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 27 | -------------------------------------------------------------------------------- /test/l3-resources/atlas-bootstrap/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-basic 2 | 3 | ## CFN resource type used 4 | 5 | - AWS::IAM::Role 6 | - AWS::IAM::Policy 7 | - AWS::CloudFormation::TypeActivation 8 | - AWS::SecretsManager::Secret 9 | 10 | These CFN resources must be active in your AWS account while using this constructor. 11 | 12 | ## Manual QA 13 | 14 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/TESTING.md). 15 | - Set any additional required configuration options/parameters as per your needs. 16 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 17 | 18 | ### Success criteria when testing the resource 19 | 20 | 1. Ensure all underlying resources are configured correctly as specified (Atlas Project, Cluster, Network IPAccessList and DatabaseUser): 21 | 22 | 2) Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 23 | -------------------------------------------------------------------------------- /test/l3-resources/atlas-private-endpoint/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-private-endpoint 2 | 3 | ## CFN resource type used 4 | - MongoDB::Atlas::Project 5 | - MongoDB::Atlas::Cluster 6 | - MongoDB::Atlas::DatabaseUser 7 | - MongoDB::Atlas::ProjectIpAccessList 8 | - MongoDB::Atlas::PrivateEndpoint 9 | 10 | These CFN resources must be active in your AWS account while using this constructor. 11 | 12 | ## Manual QA 13 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](../../../TESTING.md). 14 | - Set any additional required configuration options/parameters as per your needs. 15 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 16 | 17 | 18 | ### Success criteria when testing the resource 19 | 1. Ensure all underlying resources are configured correctly as specified (Atlas Project, Cluster, Network IPAccessList, DatabaseUser, PrivateEndpoint): 20 | 21 | ![image](https://user-images.githubusercontent.com/122359335/228276480-0cadd908-e674-4d26-9e17-c9203d1e5072.png) 22 | 23 | ![image](https://user-images.githubusercontent.com/122359335/228276519-0fccfa24-84c0-4ff4-aebf-508009cc6db8.png) 24 | 25 | ![image](https://user-images.githubusercontent.com/122359335/228276560-3d2104e1-bed8-49de-bc4d-290e6ee4a5da.png) 26 | 27 | ![image](https://user-images.githubusercontent.com/122359335/228276604-116e6251-ac5d-4f91-aa6e-87a221ee0f15.png) 28 | 29 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 30 | -------------------------------------------------------------------------------- /test/l3-resources/atlas-serverless-basic/README.md: -------------------------------------------------------------------------------- 1 | # @awscdk-resources-mongodbatlas/atlas-basic-serverless 2 | 3 | ## CFN resource type used 4 | 5 | - MongoDB::Atlas::Project 6 | - MongoDB::Atlas::ServerlessInstance 7 | - MongoDB::Atlas::DatabaseUser 8 | - MongoDB::Atlas::ProjectIpAccessList 9 | 10 | These CFN resources must be active in your AWS account while using this constructor. 11 | 12 | ## Manual QA 13 | 14 | - Follow prerequisite steps for testing a CDK construct in [TESTING.md](https://github.com/mongodb/mongodbatlas-cloudformation-resources/tree/master/TESTING.md). 15 | - Set any additional required configuration options/parameters as per your needs. 16 | - Please follow the steps in [TESTING.md](../../../TESTING.md). 17 | 18 | ### Success criteria when testing the resource 19 | 20 | 1. Ensure all underlying resources are configured correctly as specified (Atlas Project, ServerlessInstance, Network IPAccessList and DatabaseUser): 21 | 22 | ![image](https://user-images.githubusercontent.com/122359335/228263898-9d9c3a8a-ddc5-4cf6-9f7e-256b7c976b54.png) 23 | 24 | ![image](https://user-images.githubusercontent.com/122359335/228263913-8fbad8e7-7a60-4eae-aac5-9bccc2dc9242.png) 25 | 26 | ![image](https://user-images.githubusercontent.com/122359335/228263944-f4b35480-7cc3-4b6d-afbb-cd8975ecab19.png) 27 | 28 | 2. Ensure general [CDK resource success criteria](../../../TESTING.md) for this resource is met. 29 | -------------------------------------------------------------------------------- /test/readmeimages/federated-database-instance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/test/readmeimages/federated-database-instance.png -------------------------------------------------------------------------------- /test/readmeimages/federated-query-limit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/test/readmeimages/federated-query-limit.png -------------------------------------------------------------------------------- /test/readmeimages/privatelink_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/awscdk-resources-mongodbatlas/17c4fafdaf9f2cfab2e565a6e472b34fe3afd428/test/readmeimages/privatelink_endpoint.png -------------------------------------------------------------------------------- /tsconfig.dev.json: -------------------------------------------------------------------------------- 1 | // ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". 2 | { 3 | "compilerOptions": { 4 | "alwaysStrict": true, 5 | "declaration": true, 6 | "esModuleInterop": true, 7 | "experimentalDecorators": true, 8 | "inlineSourceMap": true, 9 | "inlineSources": true, 10 | "lib": [ 11 | "es2019" 12 | ], 13 | "module": "CommonJS", 14 | "noEmitOnError": false, 15 | "noFallthroughCasesInSwitch": true, 16 | "noImplicitAny": true, 17 | "noImplicitReturns": true, 18 | "noImplicitThis": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "resolveJsonModule": true, 22 | "strict": true, 23 | "strictNullChecks": true, 24 | "strictPropertyInitialization": true, 25 | "stripInternal": true, 26 | "target": "ES2019" 27 | }, 28 | "include": [ 29 | "src/**/*.ts", 30 | "test/**/*.ts", 31 | ".projenrc.js" 32 | ], 33 | "exclude": [ 34 | "node_modules" 35 | ] 36 | } 37 | --------------------------------------------------------------------------------