├── .gitignore ├── .gitmodules ├── .nojekyll ├── .taskcat.yml ├── CODEOWNERS ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── atlas-cfn-dataplatform.png ├── scripts ├── create.taskcat_overrides.sh ├── export-aws-env.sh ├── export-mongocli-config.py ├── launch-new-quickstart.sh └── launch-x-quickstart.sh └── templates ├── activate-mongodb-atlas-resources.template.yaml ├── mongodb-atlas-main.template.yaml ├── mongodb-atlas-peering-existingvpc.template.yaml ├── mongodb-atlas-peering-newvpc.template.yaml ├── mongodb-atlas-peering.template.yaml ├── mongodb-atlas.base.template.yaml ├── mongodb-atlas.private-endpoint.template.yaml └── mongodb-atlas.template.yaml /.gitignore: -------------------------------------------------------------------------------- 1 | taskcat_outputs/ 2 | .taskcat_overrides.yml 3 | .taskcat/ 4 | *.zip 5 | .idea 6 | index.html -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "submodules/quickstart-aws-vpc"] 2 | path = submodules/quickstart-aws-vpc 3 | url = git@github.com:aws-quickstart/quickstart-aws-vpc.git 4 | branch = main 5 | -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-mongodb-atlas/4702874e6ca769008dbd5e2994b29aa766731852/.nojekyll -------------------------------------------------------------------------------- /.taskcat.yml: -------------------------------------------------------------------------------- 1 | general: 2 | s3_regional_buckets: true 3 | project: 4 | name: quickstart-mongodb-atlas 5 | owner: quickstart-eng@amazon.com 6 | shorten_stack_name: true 7 | tests: 8 | mdb-atlas: 9 | regions: 10 | - us-east-1 11 | parameters: 12 | OrgId: override 13 | ProjectName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 14 | QSS3BucketName: $[taskcat_autobucket] 15 | QSS3BucketRegion: $[taskcat_current_region] 16 | ClusterName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 17 | ClusterRegion: US_EAST_1 18 | DatabasePassword: $[taskcat_genpass_12] 19 | template: templates/mongodb-atlas-main.template.yaml 20 | mdb-atlas-vpc: 21 | regions: 22 | - us-west-1 23 | parameters: 24 | OrgId: override 25 | ProjectName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 26 | QSS3BucketName: $[taskcat_autobucket] 27 | QSS3BucketRegion: $[taskcat_current_region] 28 | RouteTableCIDRBlock: 10.8.0.0/21 29 | AvailabilityZones: $[taskcat_genaz_2] 30 | ClusterName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 31 | ClusterRegion: US_WEST_1 32 | DatabasePassword: $[taskcat_genpass_12] 33 | template: templates/mongodb-atlas-peering-newvpc.template.yaml 34 | mdb-atlas-pvt-endpoint: 35 | regions: 36 | - us-east-2 37 | parameters: 38 | OrgId: override 39 | ProjectName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 40 | QSS3BucketName: $[taskcat_autobucket] 41 | QSS3BucketRegion: $[taskcat_current_region] 42 | ClusterRegion: US_EAST_2 43 | AvailabilityZone: us-east-2a 44 | VPCRegion: $[taskcat_current_region] 45 | ClusterName: tcat-$[taskcat_random-string]-$[taskcat_current_region] 46 | DatabasePassword: $[taskcat_genpass_12] 47 | template: templates/mongodb-atlas.private-endpoint.template.yaml -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @vsnyc @aws-quickstart/aws_quickstart_team 2 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2016-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at 4 | 5 | http://aws.amazon.com/apache2.0/ 6 | 7 | or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # quickstart-mongodb-atlas 2 | ## Deprecation Notice 3 | 4 | :x: This repository is subject to deprecation in Q4 2024. For more details, [please review this announcement](https://github.com/aws-ia/.announcements/issues/1). 5 | 6 | ## This repository has been deprecated in favor of https://github.com/aws-ia/cfn-ps-mongodb-atlas. 7 | ***We will archive this repository and keep it publicly available until May 1, 2024.*** 8 | -------------------------------------------------------------------------------- /atlas-cfn-dataplatform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-quickstart/quickstart-mongodb-atlas/4702874e6ca769008dbd5e2994b29aa766731852/atlas-cfn-dataplatform.png -------------------------------------------------------------------------------- /scripts/create.taskcat_overrides.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | cat << EOF 6 | PublicKey: "${ATLAS_PUBLIC_KEY}" 7 | PrivateKey: "${ATLAS_PRIVATE_KEY}" 8 | OrgId: "${ATLAS_ORG_ID}" 9 | EOF 10 | -------------------------------------------------------------------------------- /scripts/export-aws-env.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | 6 | temp=$(mktemp) 7 | aws sts get-session-token > "${temp}" 8 | echo "export AWS_SESSION_TOKEN=$(cat "${temp}" | jq -r '.Credentials.SessionToken')" 9 | echo "export AWS_SECRET_ACCESS_KEY=$(cat "${temp}" | jq -r '.Credentials.SecretAccessKey')" 10 | echo "export AWS_ACCESS_KEY_ID=$(cat "${temp}" | jq -r '.Credentials.AccessKeyId')" 11 | rm "${temp}" 12 | -------------------------------------------------------------------------------- /scripts/export-mongocli-config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # export-mongocli-config.py 4 | # usage: source this to export a mongocli project to the current environment 5 | # 6 | # $source <(./export-mongocli-config.py) 7 | # 8 | import os, sys, toml 9 | config=f"/home/{os.getenv('USER')}/.config/mongocli.toml" 10 | t=toml.load(config) 11 | if len(sys.argv)>1: 12 | profile = sys.argv[1] 13 | else: 14 | profile="default" 15 | if not profile in t: 16 | raise Exception(f"No profile '{profile}' found in {config}") 17 | d=t[profile] 18 | print(f"export ATLAS_PUBLIC_KEY={d['public_api_key']}") 19 | print(f"export ATLAS_PRIVATE_KEY={d['private_api_key']}") 20 | print(f"export ATLAS_ORG_ID={d['org_id']}") 21 | -------------------------------------------------------------------------------- /scripts/launch-new-quickstart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | STACK_NAME="${1:-aws-quickstart}" 3 | aws cloudformation create-stack \ 4 | --capabilities CAPABILITY_IAM --disable-rollback \ 5 | --template-body file://templates/mongodb-atlas.template.yaml \ 6 | --parameters ParameterKey=PublicKey,ParameterValue=${ATLAS_PUBLIC_KEY} \ 7 | ParameterKey=PrivateKey,ParameterValue=${ATLAS_PRIVATE_KEY} \ 8 | ParameterKey=OrgId,ParameterValue=${ATLAS_ORG_ID} \ 9 | --stack-name "${STACK_NAME}" 10 | -------------------------------------------------------------------------------- /scripts/launch-x-quickstart.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -ex 3 | TEMPLATE="${1:-templates/mongodb-atlas.template.yaml}" 4 | STACK_NAME="${2:-aws-quickstart}" 5 | EXTRA_PARAMS="${@: 3}" 6 | echo "STACK_NAME=${STACK_NAME}, TEMPLATE=${TEMPLATE}" 7 | echo "EXTRA_PARAMS=${EXTRA_PARAMS}" 8 | aws cloudformation create-stack \ 9 | --capabilities CAPABILITY_IAM --disable-rollback \ 10 | --template-body "file://${TEMPLATE}" \ 11 | --parameters ParameterKey=PublicKey,ParameterValue=${ATLAS_PUBLIC_KEY} \ 12 | ParameterKey=PrivateKey,ParameterValue=${ATLAS_PRIVATE_KEY} \ 13 | ParameterKey=OrgId,ParameterValue=${ATLAS_ORG_ID} \ 14 | ${EXTRA_PARAMS} \ 15 | --stack-name "${STACK_NAME}" 16 | -------------------------------------------------------------------------------- /templates/activate-mongodb-atlas-resources.template.yaml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: '2010-09-09' 2 | Description: MongoDB Resource activation. (qs-1tq8f0hrt) 3 | Metadata: 4 | cfn-lint: { config: { ignore_checks: [ W9002, W9003, W9006, E3001, E1010 ] } } 5 | AWS::CloudFormation::Interface: 6 | ParameterGroups: 7 | - Label: 8 | default: MongoDB Region 9 | Parameters: 10 | - Region 11 | Mappings: 12 | DefaultConfiguration: 13 | MongoDB: 14 | PublisherID: bb989456c78c398a858fef18f2ca1bfc1fbba082 15 | Parameters: 16 | Region: 17 | Default: us-east-1 18 | Description: The AWS Region where resources would be activated 19 | Type: String 20 | AllowedValues: 21 | - "ap-south-2" 22 | - "ap-southeast-4" 23 | - "eu-central-2" 24 | - "eu-south-2" 25 | - "me-central-1" 26 | - "us-east-1" 27 | - "us-east-2" 28 | - "ca-central-1" 29 | - "us-west-1" 30 | - "us-west-2" 31 | - "sa-east-1" 32 | - "ap-south-1" 33 | - "ap-east-1" 34 | - "ap-southeast-1" 35 | - "ap-southeast-2" 36 | - "ap-southeast-3" 37 | - "ap-northeast-1" 38 | - "ap-northeast-2" 39 | - "ap-northeast-3" 40 | - "eu-central-1" 41 | - "eu-west-1" 42 | - "eu-north-1" 43 | - "eu-west-1" 44 | - "eu-west-2" 45 | - "eu-west-3" 46 | - "eu-south-1" 47 | - "me-south-1" 48 | - "af-south-1" 49 | Resources: 50 | ActivateClusterType: 51 | Type: AWS::CloudFormation::TypeActivation 52 | Properties: 53 | PublicTypeArn: !Sub 54 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-Cluster' 55 | - publisher_id: !FindInMap 56 | - DefaultConfiguration 57 | - MongoDB 58 | - PublisherID 59 | Type: RESOURCE 60 | TypeName: MongoDB::Atlas::Cluster 61 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 62 | ActivateServerlessInstanceType: 63 | Type: AWS::CloudFormation::TypeActivation 64 | Properties: 65 | PublicTypeArn: !Sub 66 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-ServerlessInstance' 67 | - publisher_id: !FindInMap 68 | - DefaultConfiguration 69 | - MongoDB 70 | - PublisherID 71 | Type: RESOURCE 72 | TypeName: MongoDB::Atlas::ServerlessInstance 73 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 74 | ActivateProjectIpAccessListType: 75 | Type: AWS::CloudFormation::TypeActivation 76 | Properties: 77 | PublicTypeArn: !Sub 78 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-ProjectIpAccessList' 79 | - publisher_id: !FindInMap 80 | - DefaultConfiguration 81 | - MongoDB 82 | - PublisherID 83 | Type: RESOURCE 84 | TypeName: MongoDB::Atlas::ProjectIpAccessList 85 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 86 | ActivateDatabaseUserType: 87 | Type: AWS::CloudFormation::TypeActivation 88 | Properties: 89 | PublicTypeArn: !Sub 90 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-DatabaseUser' 91 | - publisher_id: !FindInMap 92 | - DefaultConfiguration 93 | - MongoDB 94 | - PublisherID 95 | Type: RESOURCE 96 | TypeName: MongoDB::Atlas::DatabaseUser 97 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 98 | ActivateProjectType: 99 | Type: AWS::CloudFormation::TypeActivation 100 | Properties: 101 | PublicTypeArn: !Sub 102 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-Project' 103 | - publisher_id: !FindInMap 104 | - DefaultConfiguration 105 | - MongoDB 106 | - PublisherID 107 | Type: RESOURCE 108 | TypeName: MongoDB::Atlas::Project 109 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 110 | ActivateNetworkPeeringType: 111 | Type: AWS::CloudFormation::TypeActivation 112 | Properties: 113 | PublicTypeArn: !Sub 114 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-NetworkPeering' 115 | - publisher_id: !FindInMap 116 | - DefaultConfiguration 117 | - MongoDB 118 | - PublisherID 119 | Type: RESOURCE 120 | TypeName: MongoDB::Atlas::NetworkPeering 121 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 122 | ActivatePrivateEndpointType: 123 | Type: AWS::CloudFormation::TypeActivation 124 | Properties: 125 | PublicTypeArn: !Sub 126 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-PrivateEndpoint' 127 | - publisher_id: !FindInMap 128 | - DefaultConfiguration 129 | - MongoDB 130 | - PublisherID 131 | Type: RESOURCE 132 | TypeName: MongoDB::Atlas::PrivateEndpoint 133 | ExecutionRoleArn: !GetAtt MongoDBPrivateEndpointExecutionRole.Arn 134 | ActivateNetworkContainerType: 135 | Type: AWS::CloudFormation::TypeActivation 136 | Properties: 137 | PublicTypeArn: !Sub 138 | - 'arn:aws:cloudformation:${Region}::type/resource/${publisher_id}/MongoDB-Atlas-NetworkContainer' 139 | - publisher_id: !FindInMap 140 | - DefaultConfiguration 141 | - MongoDB 142 | - PublisherID 143 | Type: RESOURCE 144 | TypeName: MongoDB::Atlas::NetworkContainer 145 | ExecutionRoleArn: !GetAtt MongoDBCustomResourceExecutionRole.Arn 146 | MongoDBCustomResourceExecutionRole: 147 | Type: AWS::IAM::Role 148 | Properties: 149 | MaxSessionDuration: 8400 150 | AssumeRolePolicyDocument: 151 | Version: '2012-10-17' 152 | Statement: 153 | - Effect: Allow 154 | Principal: 155 | Service: 156 | - "resources.cloudformation.amazonaws.com" 157 | Action: sts:AssumeRole 158 | Path: "/" 159 | Policies: 160 | - PolicyName: ResourceTypePolicy 161 | PolicyDocument: 162 | Version: '2012-10-17' 163 | Statement: 164 | - Effect: Allow 165 | Action: 166 | - "secretsmanager:GetSecretValue" 167 | Resource: !Sub arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:* 168 | MongoDBPrivateEndpointExecutionRole: 169 | Metadata: 170 | cfn-lint: 171 | config: 172 | ignore_checks: 173 | - EIAMPolicyWildcardResource 174 | ignore_reasons: 175 | EIAMPolicyWildcardResource: >- 176 | Create and Delete VPC Endpoint permissions are necessary. 177 | Type: 'AWS::IAM::Role' 178 | Properties: 179 | AssumeRolePolicyDocument: 180 | Version: 2012-10-17 181 | Statement: 182 | - Effect: Allow 183 | Principal: 184 | Service: 185 | - resources.cloudformation.amazonaws.com 186 | Action: 187 | - 'sts:AssumeRole' 188 | Path: "/" 189 | Policies: 190 | - PolicyName: vpcEndpointPolicy 191 | PolicyDocument: 192 | Version: 2012-10-17 193 | Statement: 194 | - Effect: Allow 195 | Action: 196 | - 'ec2:CreateVpcEndpoint' 197 | - 'ec2:DeleteVpcEndpoints' 198 | - "secretsmanager:GetSecretValue" 199 | Resource: '*' -------------------------------------------------------------------------------- /templates/mongodb-atlas-main.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: "MongoDB Atlas AWS CloudFormation Quick Start (qs-1rkorhef6)." 4 | Metadata: 5 | cfn-lint: 6 | config: 7 | ignore_checks: 8 | - W9006 # temporary to get rid of warnings 9 | QuickStartDocumentation: 10 | EntrypointName: "Parameters for deploying MongoDB Atlas without VPC peering." 11 | Order: "1" 12 | AWS::CloudFormation::Interface: 13 | ParameterGroups: 14 | - Label: 15 | default: Instance Configuration 16 | Parameters: 17 | - InstanceType 18 | - InstanceName 19 | - Region 20 | - Label: 21 | default: MongoDB Atlas API key configuration 22 | Parameters: 23 | - Profile 24 | - OrgId 25 | - Label: 26 | default: MongoDB Atlas configuration 27 | Parameters: 28 | - ActivateMongoDBResources 29 | - ProjectName 30 | - DatabaseUserName 31 | - DatabasePassword 32 | - Label: 33 | default: Atlas Cluster configuration 34 | Parameters: 35 | - ClusterMongoDBMajorVersion 36 | - InstanceName 37 | - Region 38 | - ClusterInstanceSize 39 | - Label: 40 | default: Atlas Serverless configuration 41 | Parameters: 42 | - ServerlessProviderName 43 | - ServerlessTerminationProtectionEnabled 44 | - ServerlessContinuousBackupEnabled 45 | - Label: 46 | default: AWS Quick Start configuration 47 | Parameters: 48 | - QSS3BucketName 49 | - QSS3BucketRegion 50 | ParameterLabels: 51 | Profile: 52 | default: "A secret with name cfn/atlas/profile/{Profile}" 53 | OrgId: 54 | default: MongoDB Atlas API organization ID 55 | ActivateMongoDBResources: 56 | default: Activate MongoDB Atlas CloudFormation resources 57 | ProjectName: 58 | default: Name of new Atlas project 59 | ClusterMongoDBMajorVersion: 60 | default: MongoDB version 61 | InstanceName: 62 | default: Name of new cluster 63 | Region: 64 | default: AWS Region for Atlas cluster 65 | ClusterInstanceSize: 66 | default: MongoDB Atlas instance size 67 | QSS3BucketName: 68 | default: Quick Start S3 bucket name 69 | QSS3BucketRegion: 70 | default: Quick Start S3 bucket Region 71 | DatabaseUserName: 72 | default: MongoDB Atlas Database User Name 73 | DatabasePassword: 74 | default: MongoDB Atlas Database User Password 75 | Parameters: 76 | InstanceType: 77 | Description: 'choose wich instance you want to create' 78 | Type: String 79 | Default: 'Dedicated Cluster' 80 | AllowedValues: 81 | - 'Dedicated Cluster' 82 | - 'Serverless Instance' 83 | Profile: 84 | Description: "A secret with name cfn/atlas/profile/{Profile}" 85 | Type: String 86 | Default: "default" 87 | OrgId: 88 | Description: "MongoDB cloud organization ID." 89 | Type: String 90 | Default: "OrgId" 91 | ProjectName: 92 | Description: "Name of the project." 93 | Type: String 94 | Default: "aws-quickstart" 95 | InstanceName: 96 | Description: Name of the cluster as it appears in Atlas. This name cannot be changed after the cluster is created. 97 | Type: String 98 | Default: "Cluster/Serverless Name" 99 | ClusterInstanceSize: 100 | Default: "M10" 101 | Description: "Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you choose is used for all data-bearing hosts in your cluster tier (see https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws)." 102 | Type: String 103 | AllowedValues: 104 | - "M10" 105 | - "M20" 106 | - "M30" 107 | - "M40" 108 | - "R40" 109 | - "M40_NVME" 110 | - "M50" 111 | - "R50" 112 | - "M50_NVME" 113 | - "M60" 114 | - "R60" 115 | - "M60_NVME" 116 | - "M80" 117 | - "R80" 118 | - "M80_NVME" 119 | - "M140" 120 | - "M200" 121 | - "R200" 122 | - "M200_NVME" 123 | - "M300" 124 | - "R300" 125 | - "R400" 126 | - "M400_NVME" 127 | - "R700" 128 | Region: 129 | Default: "US_EAST_1" 130 | Description: AWS Region where the Atlas database runs. 131 | Type: String 132 | AllowedValues: 133 | - "US_EAST_1" 134 | - "US_EAST_2" 135 | - "CA_CENTRAL_1" 136 | - "US_WEST_1" 137 | - "US_WEST_2" 138 | - "SA_EAST_1" 139 | - "AP_SOUTH_1" 140 | - "AP_EAST_1" 141 | - "AP_SOUTHEAST_1" 142 | - "AP_SOUTHEAST_2" 143 | - "AP_SOUTHEAST_3" 144 | - "AP_NORTHEAST_1" 145 | - "AP_NORTHEAST_2" 146 | - "AP_NORTHEAST_3" 147 | - "EU_CENTRAL_1" 148 | - "EU_WEST_1" 149 | - "EU_NORTH_1" 150 | - "EU_WEST_2" 151 | - "EU_WEST_3" 152 | - "EU_SOUTH_1" 153 | - "ME_SOUTH_1" 154 | - "AF_SOUTH_1" 155 | ClusterMongoDBMajorVersion: 156 | Description: MongoDB version. 157 | Type: String 158 | Default: "5.0" 159 | AllowedValues: 160 | - "4.4" 161 | - "5.0" 162 | - "6.0" 163 | ActivateMongoDBResources: 164 | Description: 'Choose "Yes" to activate MongoDB Atlas CloudFormation resource types. If you already activated resources in your AWS Region, enter "No."' 165 | Type: String 166 | Default: "Yes" 167 | AllowedValues: 168 | - "No" 169 | - "Yes" 170 | QSS3KeyPrefix: 171 | AllowedPattern: ^[0-9a-zA-Z-/.]*$ 172 | ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters, 173 | uppercase letters, hyphens (-), and forward slashes (/). 174 | Default: quickstart-mongodb-atlas/ 175 | Description: S3 key prefix for the Quick Start assets. Quick Start key prefix 176 | can include numbers, lowercase letters, uppercase letters, hyphens (-), and 177 | forward slashes (/). 178 | Type: String 179 | QSS3BucketName: 180 | AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$ 181 | ConstraintDescription: Quick Start bucket name can include numbers, lowercase 182 | letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen 183 | (-). 184 | Default: aws-quickstart 185 | Description: S3 bucket name for the Quick Start assets. This string can include 186 | numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start 187 | or end with a hyphen (-). 188 | Type: String 189 | QSS3BucketRegion: 190 | Default: 'us-east-1' 191 | Description: AWS Region where the Quick Start S3 bucket (QSS3BucketName) is 192 | hosted. If you use your own bucket, you must specify this value. 193 | Type: String 194 | DatabaseUserName: 195 | Description: MongoDB Atlas Database User Name. 196 | Type: String 197 | Default: "testUser" 198 | ServerlessProviderName: 199 | Type: String 200 | Description: Human-readable label that identifies the cloud service provider. Used only on the Serverless Instance 201 | Default: "SERVERLESS" 202 | ServerlessTerminationProtectionEnabled: 203 | Type: String 204 | Description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to true MongoDB Cloud won't delete the serverless instance. If set to false MongoDB cloud will delete the serverless instance. 205 | ConstraintDescription: boolean 206 | AllowedValues: 207 | - "true" 208 | - "false" 209 | Default: "false" 210 | ServerlessContinuousBackupEnabled: 211 | Type: String 212 | Description: Flag that indicates whether the serverless instances uses Serverless Continuous Backup. If this parameter is false the serverless instance uses Basic Backup. | Option | Description | |---|---| | Serverless Continuous Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and lets you restore the data from a selected point in time within the last 72 hours. Atlas also takes daily snapshots and retains these daily snapshots for 35 days. To learn more see Serverless Instance Costs. | | Basic Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and retains only the two most recent snapshots. You can use this option for free. 213 | ConstraintDescription: boolean 214 | AllowedValues: 215 | - "true" 216 | - "false" 217 | Default: "true" 218 | DatabasePassword: 219 | Description: MongoDB Atlas Database User Password. 220 | Type: String 221 | NoEcho: true 222 | Conditions: 223 | UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart'] 224 | ActivateResources: !Equals [!Ref ActivateMongoDBResources, 'Yes'] 225 | CreateCluster: !Equals [!Ref InstanceType, 'Dedicated Cluster'] 226 | CreateServerless: !Equals [!Ref InstanceType, 'Serverless Instance'] 227 | Resources: 228 | ActivateAtlasResources: 229 | Condition: ActivateResources 230 | Type: AWS::CloudFormation::Stack 231 | Properties: 232 | TemplateURL: !Sub 233 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/activate-mongodb-atlas-resources.template.yaml' 234 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 235 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 236 | Parameters: 237 | Region: !Ref QSS3BucketRegion 238 | Atlas: 239 | Type: AWS::CloudFormation::Stack 240 | Metadata: 241 | PseudoDependsOn: !If 242 | - ActivateResources 243 | - - !Ref ActivateAtlasResources 244 | - '' 245 | Properties: 246 | TemplateURL: !Sub 247 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/mongodb-atlas.template.yaml' 248 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 249 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 250 | Parameters: 251 | ProjectName: !Ref ProjectName 252 | InstanceName: !Ref InstanceName 253 | Region: !Ref Region 254 | OrgId: !Ref OrgId 255 | Profile: !Ref Profile 256 | InstanceType: !Ref InstanceType 257 | DatabaseUserName: !Ref DatabaseUserName 258 | DatabasePassword: !Ref DatabasePassword 259 | ClusterInstanceSize: !Ref ClusterInstanceSize 260 | ClusterMongoDBMajorVersion: !Ref ClusterMongoDBMajorVersion 261 | ServerlessProviderName: !Ref ServerlessProviderName 262 | ServerlessTerminationProtectionEnabled: !Ref ServerlessTerminationProtectionEnabled 263 | ServerlessContinuousBackupEnabled: !Ref ServerlessContinuousBackupEnabled 264 | Outputs: 265 | AtlasIAMRole: 266 | Description: "ARN for AWS IAM role database cluster access." 267 | Value: !GetAtt "Atlas.Outputs.AtlasIAMRole" 268 | AtlasDatabaseUser: 269 | Description: "Atlas database user, configured for AWS IAM role access." 270 | Value: !GetAtt "Atlas.Outputs.AtlasDatabaseUser" 271 | AtlasProject: 272 | Description: "Information about your Atlas deployment." 273 | Value: !GetAtt "Atlas.Outputs.AtlasProject" 274 | AtlasProjectIPAccessList: 275 | Description: "Atlas project IP access list." 276 | Value: !GetAtt "Atlas.Outputs.AtlasProjectIPAccessList" 277 | AtlasCluster: 278 | Condition: CreateCluster 279 | Description: "Information about your Atlas cluster." 280 | Value: !GetAtt "Atlas.Outputs.AtlasCluster" 281 | ClusterSrvAddress: 282 | Condition: CreateCluster 283 | Description: "Hostname for the mongodb+srv:// connection string." 284 | Value: !GetAtt "Atlas.Outputs.ClusterSrvAddress" 285 | ServerlessStr: 286 | Condition: CreateServerless 287 | Description: "Id of the serverless Instance." 288 | Value: !GetAtt "Atlas.Outputs.ServerlessConnectionStr" -------------------------------------------------------------------------------- /templates/mongodb-atlas-peering-existingvpc.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: "MongoDB Atlas AWS CloudFormation Quick Start with VPC peering (qs-1rkorhefm)." 4 | Metadata: 5 | cfn-lint: 6 | config: 7 | ignore_checks: 8 | - W9006 # temporary to get rid of warnings 9 | QuickStartDocumentation: 10 | EntrypointName: "Parameters for deploying MongoDB Atlas with VPC peering into an existing VPC." 11 | Order: "3" 12 | AWS::CloudFormation::Interface: 13 | ParameterGroups: 14 | - Label: 15 | default: Network configuration 16 | Parameters: 17 | - VPC 18 | - RouteTableCIDRBlock 19 | - AtlasCidrBlock 20 | - Label: 21 | default: MongoDB Atlas API key configuration 22 | Parameters: 23 | - Profile 24 | - OrgId 25 | - Label: 26 | default: MongoDB Atlas configuration 27 | Parameters: 28 | - ActivateMongoDBResources 29 | - ProjectName 30 | - ClusterMongoDBMajorVersion 31 | - ClusterName 32 | - ClusterRegion 33 | - ClusterInstanceSize 34 | - DatabaseUserName 35 | - DatabasePassword 36 | - Label: 37 | default: AWS Quick Start configuration 38 | Parameters: 39 | - QSS3BucketName 40 | - QSS3KeyPrefix 41 | - QSS3BucketRegion 42 | ParameterLabels: 43 | VPC: 44 | default: AWS VPC to peer with 45 | AtlasCidrBlock: 46 | default: IP addresses expressed in Classless Inter-Domain Routing (CIDR) notation. 47 | QSS3BucketName: 48 | default: Quick Start S3 bucket name 49 | QSS3KeyPrefix: 50 | default: Quick Start S3 key prefix 51 | QSS3BucketRegion: 52 | default: Quick Start S3 bucket Region 53 | RouteTableCIDRBlock: 54 | default: VPC peering CIDR block 55 | Profile: 56 | default: MongoDB Atlas API public key 57 | OrgId: 58 | default: MongoDB Atlas API organization ID 59 | ActivateMongoDBResources: 60 | default: Activate MongoDB Atlas CloudFormation resources 61 | ProjectName: 62 | default: Name of new Atlas project 63 | ClusterMongoDBMajorVersion: 64 | default: MongoDB version 65 | ClusterName: 66 | default: Name of new cluster 67 | ClusterRegion: 68 | default: AWS Region for Atlas cluster 69 | ClusterInstanceSize: 70 | default: MongoDB Atlas instance size 71 | DatabaseUserName: 72 | default: MongoDB Atlas Database User Name 73 | DatabasePassword: 74 | default: MongoDB Atlas Database User Password 75 | Parameters: 76 | Profile: 77 | Description: "A secret with name cfn/atlas/profile/{Profile}" 78 | Type: String 79 | Default: "default" 80 | OrgId: 81 | Description: "MongoDB cloud organization ID." 82 | Type: String 83 | Default: "OrgId" 84 | ProjectName: 85 | Description: "Name of the project." 86 | Type: String 87 | Default: "aws-quickstart-vpc" 88 | ClusterName: 89 | Description: Name of the cluster as it appears in Atlas. This name cannot be changed after the cluster is created. 90 | Type: String 91 | Default: "Cluster-1" 92 | ClusterInstanceSize: 93 | Default: "M10" 94 | Description: "Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you choose is used for all data-bearing hosts in your cluster tier (see https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws)." 95 | Type: String 96 | AllowedValues: 97 | - "M10" 98 | - "M20" 99 | - "M30" 100 | - "M40" 101 | - "R40" 102 | - "M40_NVME" 103 | - "M50" 104 | - "R50" 105 | - "M50_NVME" 106 | - "M60" 107 | - "R60" 108 | - "M60_NVME" 109 | - "M80" 110 | - "R80" 111 | - "M80_NVME" 112 | - "M140" 113 | - "M200" 114 | - "R200" 115 | - "M200_NVME" 116 | - "M300" 117 | - "R300" 118 | - "R400" 119 | - "M400_NVME" 120 | - "R700" 121 | ClusterRegion: 122 | Default: "US_EAST_1" 123 | Description: AWS Region where the Atlas database runs. 124 | Type: String 125 | AllowedValues: 126 | - "US_EAST_1" 127 | - "US_EAST_2" 128 | - "CA_CENTRAL_1" 129 | - "US_WEST_1" 130 | - "US_WEST_2" 131 | - "SA_EAST_1" 132 | - "AP_SOUTH_1" 133 | - "AP_EAST_1" 134 | - "AP_SOUTHEAST_1" 135 | - "AP_SOUTHEAST_2" 136 | - "AP_SOUTHEAST_3" 137 | - "AP_NORTHEAST_1" 138 | - "AP_NORTHEAST_2" 139 | - "AP_NORTHEAST_3" 140 | - "EU_CENTRAL_1" 141 | - "EU_WEST_1" 142 | - "EU_NORTH_1" 143 | - "EU_WEST_2" 144 | - "EU_WEST_3" 145 | - "EU_SOUTH_1" 146 | - "ME_SOUTH_1" 147 | - "AF_SOUTH_1" 148 | ClusterMongoDBMajorVersion: 149 | Description: MongoDB version. 150 | Type: String 151 | Default: "5.0" 152 | AllowedValues: 153 | - "4.4" 154 | - "5.0" 155 | - "6.0" 156 | VPC: 157 | Type: AWS::EC2::VPC::Id 158 | Description: VPC ID of your existing VPC that you want to peer to. This is typically the VPC that your application uses. 159 | ActivateMongoDBResources: 160 | Description: 'Choose "Yes" to activate MongoDB Atlas CloudFormation resource types. If you already activated resources in your AWS Region, enter "No."' 161 | Type: String 162 | Default: "Yes" 163 | AllowedValues: 164 | - "No" 165 | - "Yes" 166 | RouteTableCIDRBlock: 167 | Type: String 168 | Description: CIDR block to use for VPC peering. 169 | QSS3BucketName: 170 | AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$ 171 | ConstraintDescription: Quick Start bucket name can include numbers, lowercase 172 | letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen 173 | (-). 174 | Default: aws-quickstart 175 | Description: S3 bucket name for the Quick Start assets. This string can include 176 | numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start 177 | or end with a hyphen (-). 178 | Type: String 179 | QSS3KeyPrefix: 180 | AllowedPattern: ^[0-9a-zA-Z-/.]*$ 181 | ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters, 182 | uppercase letters, hyphens (-), and forward slashes (/). 183 | Default: quickstart-mongodb-atlas/ 184 | Description: S3 key prefix for the Quick Start assets. Quick Start key prefix 185 | can include numbers, lowercase letters, uppercase letters, hyphens (-), and 186 | forward slashes (/). 187 | Type: String 188 | QSS3BucketRegion: 189 | Default: 'us-east-1' 190 | Description: AWS Region where the Quick Start S3 bucket (QSS3BucketName) is 191 | hosted. If you use your own bucket, you must specify this value. 192 | Type: String 193 | DatabaseUserName: 194 | Description: MongoDB Atlas Database User Name. 195 | Type: String 196 | Default: "testUser" 197 | DatabasePassword: 198 | Description: MongoDB Atlas Database User Password. 199 | Type: String 200 | NoEcho: true 201 | AtlasCidrBlock: 202 | Type: String 203 | Description: IP addresses expressed in Classless Inter-Domain Routing (CIDR) notation. 204 | Conditions: 205 | UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart'] 206 | ActivateResources: !Equals [!Ref ActivateMongoDBResources, 'Yes'] 207 | Resources: 208 | ActivateAtlasResources: 209 | Condition: ActivateResources 210 | Type: AWS::CloudFormation::Stack 211 | Properties: 212 | TemplateURL: !Sub 213 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/activate-mongodb-atlas-resources.template.yaml' 214 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 215 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 216 | Parameters: 217 | Region: !Ref QSS3BucketRegion 218 | Atlas: 219 | Metadata: 220 | PseudoDependsOn: !If 221 | - ActivateResources 222 | - - !Ref ActivateAtlasResources 223 | - '' 224 | Type: AWS::CloudFormation::Stack 225 | Properties: 226 | TemplateURL: !Sub 227 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/mongodb-atlas-peering.template.yaml' 228 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 229 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 230 | Parameters: 231 | ClusterInstanceSize: !Ref ClusterInstanceSize 232 | ClusterMongoDBMajorVersion: !Ref ClusterMongoDBMajorVersion 233 | ProjectName: !Ref ProjectName 234 | ClusterName: !Ref ClusterName 235 | ClusterRegion: !Ref ClusterRegion 236 | OrgId: !Ref OrgId 237 | Profile: !Ref Profile 238 | RouteTableCIDRBlock: !Ref RouteTableCIDRBlock 239 | VPCRegion: !Ref QSS3BucketRegion 240 | VPC: !Ref VPC 241 | DatabaseUserName: !Ref DatabaseUserName 242 | DatabasePassword: !Ref DatabasePassword 243 | AtlasCidrBlock: !Ref AtlasCidrBlock 244 | Outputs: 245 | AtlasIAMRole: 246 | Description: "ARN for AWS IAM role database cluster access." 247 | Value: !GetAtt "Atlas.Outputs.AtlasIAMRole" 248 | AtlasDatabaseUser: 249 | Description: "Atlas database user, configured for AWS IAM role access." 250 | Value: !GetAtt "Atlas.Outputs.AtlasDatabaseUser" 251 | AtlasProject: 252 | Description: "Information about your Atlas deployment." 253 | Value: !GetAtt "Atlas.Outputs.AtlasProject" 254 | AtlasCluster: 255 | Description: "Information about your Atlas cluster." 256 | Value: !GetAtt "Atlas.Outputs.AtlasCluster" 257 | ClusterState: 258 | Description: "State of your MongoDB cluster." 259 | Value: !GetAtt "Atlas.Outputs.ClusterState" 260 | ClusterSrvAddress: 261 | Description: "Hostname for the mongodb+srv:// connection string." 262 | Value: !GetAtt "Atlas.Outputs.ClusterSrvAddress" 263 | AtlasNetworkPeering: 264 | Description: "Information about the network peering connection." 265 | Value: !GetAtt "Atlas.Outputs.AtlasNetworkPeering" 266 | 267 | -------------------------------------------------------------------------------- /templates/mongodb-atlas-peering-newvpc.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: "MongoDB Atlas AWS CloudFormation Quick Start with VPC peering (qs-1rkorheg3)." 4 | Metadata: 5 | cfn-lint: 6 | config: 7 | ignore_checks: 8 | - W9006 # temporary to get rid of warnings 9 | QuickStartDocumentation: 10 | EntrypointName: Parameters for deploying MongoDB Atlas with VPC peering into a new VPC. 11 | Order: "2" 12 | AWS::CloudFormation::Interface: 13 | ParameterGroups: 14 | - Label: 15 | default: Network configuration 16 | Parameters: 17 | - AvailabilityZones 18 | - AtlasCidrBlock 19 | - PrivateSubnet1CIDR 20 | - PrivateSubnet2CIDR 21 | - PublicSubnet1CIDR 22 | - PublicSubnet2CIDR 23 | - RouteTableCIDRBlock 24 | - Label: 25 | default: MongoDB Atlas API key configuration 26 | Parameters: 27 | - Profile 28 | - OrgId 29 | - Label: 30 | default: MongoDB Atlas configuration 31 | Parameters: 32 | - ActivateMongoDBResources 33 | - ProjectName 34 | - ClusterMongoDBMajorVersion 35 | - ClusterName 36 | - ClusterRegion 37 | - ClusterInstanceSize 38 | - DatabaseUserName 39 | - DatabasePassword 40 | - Label: 41 | default: AWS Quick Start configuration 42 | Parameters: 43 | - QSS3BucketName 44 | - QSS3KeyPrefix 45 | - QSS3BucketRegion 46 | ParameterLabels: 47 | AvailabilityZones: 48 | default: Availability Zones 49 | VPCCIDR: 50 | default: VPC CIDR. 51 | AtlasCidrBlock: 52 | default: AtlasCidrBlock - IP addresses expressed in (CIDR) notation. 53 | PrivateSubnet1CIDR: 54 | default: Private subnet 1 CIDR 55 | PrivateSubnet2CIDR: 56 | default: Private subnet 2 CIDR 57 | PublicSubnet1CIDR: 58 | default: Public subnet 1 CIDR 59 | PublicSubnet2CIDR: 60 | default: Public subnet 2 CIDR 61 | QSS3BucketName: 62 | default: Quick Start S3 bucket name 63 | QSS3KeyPrefix: 64 | default: Quick Start S3 key prefix 65 | QSS3BucketRegion: 66 | default: Quick Start S3 bucket Region 67 | RouteTableCIDRBlock: 68 | default: VPC peering CIDR block 69 | Profile: 70 | default: A secret with name cfn/atlas/profile/{Profile} 71 | OrgId: 72 | default: MongoDB Atlas API organization ID 73 | ActivateMongoDBResources: 74 | default: Activate MongoDB Atlas CloudFormation resources 75 | ProjectName: 76 | default: Name of new Atlas project 77 | ClusterMongoDBMajorVersion: 78 | default: MongoDB version 79 | ClusterName: 80 | default: Name of new cluster 81 | ClusterRegion: 82 | default: AWS Region for Atlas cluster 83 | ClusterInstanceSize: 84 | default: MongoDB Atlas instance size 85 | DatabaseUserName: 86 | default: MongoDB Atlas Database User Name 87 | DatabasePassword: 88 | default: MongoDB Atlas Database User Password 89 | Parameters: 90 | AvailabilityZones: 91 | Description: List of Availability Zones to use for the VPC subnets. 92 | You can specify two Availability Zones. 93 | Type: List 94 | PrivateSubnet1CIDR: 95 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 96 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 97 | Default: 10.0.0.0/19 98 | Description: CIDR block for the private subnet, located in Availability Zone 1. 99 | Type: String 100 | PrivateSubnet2CIDR: 101 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 102 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 103 | Default: 10.0.32.0/19 104 | Description: CIDR block for the private subnet, located in Availability Zone 2. 105 | Type: String 106 | PublicSubnet1CIDR: 107 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 108 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 109 | Default: 10.0.128.0/20 110 | Description: CIDR block for public (DMZ) subnet 1, located in Availability Zone 1. 111 | Type: String 112 | PublicSubnet2CIDR: 113 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 114 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 115 | Default: 10.0.144.0/20 116 | Description: CIDR block for public (DMZ) subnet 2, located in Availability Zone 2. 117 | Type: String 118 | VPCCIDR: 119 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 120 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 121 | Default: 10.0.0.0/16 122 | Description: CIDR block for the VPC. 123 | Type: String 124 | AtlasCidrBlock: 125 | Type: String 126 | Description: AtlasCidrBlock - IP addresses expressed in (CIDR) notation. 127 | Default: 10.8.0.0/21 128 | Profile: 129 | Description: "A secret with name cfn/atlas/profile/{Profile}" 130 | Type: String 131 | Default: "default" 132 | OrgId: 133 | Description: "Your MongoDB cloud organization ID." 134 | Type: String 135 | Default: "OrgId" 136 | ProjectName: 137 | Description: "Name of the project." 138 | Type: String 139 | Default: "aws-quickstart-newvpc" 140 | ClusterName: 141 | Description: Name of the cluster as it appears in Atlas. This name cannot be changed after the cluster is created. 142 | Type: String 143 | Default: "Cluster-1" 144 | ClusterInstanceSize: 145 | Default: "M10" 146 | Description: "Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you choose is used for all data-bearing hosts in your cluster tier (see https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws)." 147 | Type: String 148 | AllowedValues: 149 | - "M10" 150 | - "M20" 151 | - "M30" 152 | - "M40" 153 | - "R40" 154 | - "M40_NVME" 155 | - "M50" 156 | - "R50" 157 | - "M50_NVME" 158 | - "M60" 159 | - "R60" 160 | - "M60_NVME" 161 | - "M80" 162 | - "R80" 163 | - "M80_NVME" 164 | - "M140" 165 | - "M200" 166 | - "R200" 167 | - "M200_NVME" 168 | - "M300" 169 | - "R300" 170 | - "R400" 171 | - "M400_NVME" 172 | - "R700" 173 | ClusterRegion: 174 | Default: US_EAST_1 175 | Description: AWS Region where the Atlas database runs. 176 | Type: String 177 | AllowedValues: 178 | - "US_EAST_1" 179 | - "US_EAST_2" 180 | - "CA_CENTRAL_1" 181 | - "US_WEST_1" 182 | - "US_WEST_2" 183 | - "SA_EAST_1" 184 | - "AP_SOUTH_1" 185 | - "AP_EAST_1" 186 | - "AP_SOUTHEAST_1" 187 | - "AP_SOUTHEAST_2" 188 | - "AP_SOUTHEAST_3" 189 | - "AP_NORTHEAST_1" 190 | - "AP_NORTHEAST_2" 191 | - "AP_NORTHEAST_3" 192 | - "EU_CENTRAL_1" 193 | - "EU_WEST_1" 194 | - "EU_NORTH_1" 195 | - "EU_WEST_2" 196 | - "EU_WEST_3" 197 | - "EU_SOUTH_1" 198 | - "ME_SOUTH_1" 199 | - "AF_SOUTH_1" 200 | ClusterMongoDBMajorVersion: 201 | Description: MongoDB version 202 | Type: String 203 | Default: "5.0" 204 | AllowedValues: 205 | - "4.4" 206 | - "5.0" 207 | - "6.0" 208 | ActivateMongoDBResources: 209 | Description: 'Enter "Yes" to activate MongoDB Atlas CloudFormation resource types. If you already activated resources in your AWS Region, enter "No."' 210 | Type: String 211 | Default: "Yes" 212 | AllowedValues: 213 | - "No" 214 | - "Yes" 215 | RouteTableCIDRBlock: 216 | Type: String 217 | Description: CIDR block for VPC peering. 218 | QSS3BucketName: 219 | AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$ 220 | ConstraintDescription: Quick Start bucket name can include numbers, lowercase 221 | letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen 222 | (-). 223 | Default: aws-quickstart 224 | Description: S3 bucket name for the Quick Start assets. This string can include 225 | numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start 226 | or end with a hyphen (-). 227 | Type: String 228 | QSS3KeyPrefix: 229 | AllowedPattern: ^[0-9a-zA-Z-/.]*$ 230 | ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters, 231 | uppercase letters, hyphens (-), and forward slashes (/). 232 | Default: quickstart-mongodb-atlas/ 233 | Description: S3 key prefix for the Quick Start assets. Quick Start key prefix 234 | can include numbers, lowercase letters, uppercase letters, hyphens (-), and 235 | forward slashes (/). 236 | Type: String 237 | QSS3BucketRegion: 238 | Default: 'us-east-1' 239 | Description: AWS Region where the Quick Start S3 bucket (QSS3BucketName) is 240 | hosted. If you use your own bucket, you must specify this value. 241 | Type: String 242 | DatabaseUserName: 243 | Description: MongoDB Atlas Database User Name. 244 | Type: String 245 | Default: "testUser" 246 | DatabasePassword: 247 | Description: MongoDB Atlas Database User Password. 248 | Type: String 249 | NoEcho: true 250 | Conditions: 251 | UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart'] 252 | Resources: 253 | VPCStack: 254 | Type: AWS::CloudFormation::Stack 255 | Properties: 256 | TemplateURL: 257 | Fn::Sub: 258 | - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}submodules/quickstart-aws-vpc/templates/aws-vpc.template.yaml 259 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 260 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 261 | Parameters: 262 | AvailabilityZones: 263 | Fn::Join: 264 | - ',' 265 | - !Ref AvailabilityZones 266 | NumberOfAZs: '2' 267 | PrivateSubnet1ACIDR: !Ref PrivateSubnet1CIDR 268 | PrivateSubnet2ACIDR: !Ref PrivateSubnet2CIDR 269 | PublicSubnet1CIDR: !Ref PublicSubnet1CIDR 270 | PublicSubnet2CIDR: !Ref PublicSubnet2CIDR 271 | VPCCIDR: !Ref VPCCIDR 272 | Atlas: 273 | Type: AWS::CloudFormation::Stack 274 | Properties: 275 | TemplateURL: !Sub 276 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/mongodb-atlas-peering-existingvpc.template.yaml' 277 | - S3Region: !If [UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion] 278 | S3Bucket: !If [UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName] 279 | Parameters: 280 | ClusterInstanceSize: !Ref ClusterInstanceSize 281 | ClusterMongoDBMajorVersion: !Ref ClusterMongoDBMajorVersion 282 | ProjectName: !Ref ProjectName 283 | ClusterName: !Ref ClusterName 284 | ClusterRegion: !Ref ClusterRegion 285 | OrgId: !Ref OrgId 286 | Profile: !Ref Profile 287 | RouteTableCIDRBlock: !Ref RouteTableCIDRBlock 288 | VPC: !GetAtt VPCStack.Outputs.VPCID 289 | ActivateMongoDBResources: !Ref ActivateMongoDBResources 290 | QSS3BucketName: !Ref QSS3BucketName 291 | QSS3BucketRegion: !Ref QSS3BucketRegion 292 | QSS3KeyPrefix: !Ref QSS3KeyPrefix 293 | DatabaseUserName: !Ref DatabaseUserName 294 | DatabasePassword: !Ref DatabasePassword 295 | AtlasCidrBlock: !Ref AtlasCidrBlock 296 | 297 | Outputs: 298 | AtlasIAMRole: 299 | Description: "ARN for AWS IAM role database cluster access." 300 | Value: !GetAtt "Atlas.Outputs.AtlasIAMRole" 301 | AtlasDatabaseUser: 302 | Description: "Atlas database user, configured for AWS IAM role access." 303 | Value: !GetAtt "Atlas.Outputs.AtlasDatabaseUser" 304 | AtlasProject: 305 | Description: "Information about your Atlas deployment." 306 | Value: !GetAtt "Atlas.Outputs.AtlasProject" 307 | AtlasCluster: 308 | Description: "Information about your Atlas cluster." 309 | Value: !GetAtt "Atlas.Outputs.AtlasCluster" 310 | ClusterState: 311 | Description: "State of your MongoDB cluster." 312 | Value: !GetAtt "Atlas.Outputs.ClusterState" 313 | ClusterSrvAddress: 314 | Description: "Hostname for the mongodb+srv:// connection string." 315 | Value: !GetAtt "Atlas.Outputs.ClusterSrvAddress" 316 | AtlasNetworkPeering: 317 | Description: "Information about the network peering connection." 318 | Value: !GetAtt "Atlas.Outputs.AtlasNetworkPeering" 319 | 320 | -------------------------------------------------------------------------------- /templates/mongodb-atlas-peering.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: MongoDB Atlas AWS CloudFormation Quickstart with VPC Peering. (qs-1rkorhefe) 4 | Metadata: 5 | cfn-lint: { config: { ignore_checks: [ W9002, W9003, W9006, E3001, E1010 ] } } 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - Label: 9 | default: Network Configuration 10 | Parameters: 11 | - VPC 12 | - RouteTableCIDRBlock 13 | - VPCRegion 14 | - AtlasCidrBlock 15 | - Label: 16 | default: MongoDB Atlas ApiKey Configuration 17 | Parameters: 18 | - Profile 19 | - Label: 20 | default: MongoDB Atlas Configuration 21 | Parameters: 22 | - ProjectName 23 | - ClusterName 24 | - ClusterRegion 25 | - ClusterInstanceSize 26 | - DatabaseUserRoleDatabaseName 27 | - DatabaseUserName 28 | - DatabasePassword 29 | ParameterLabels: 30 | VPC: 31 | default: VPC-id to peer with Atlas cluster 32 | AtlasCidrBlock: 33 | default: IP addresses expressed in Classless Inter-Domain Routing (CIDR) notation. 34 | RouteTableCIDRBlock: 35 | default: CIDR block for app to use in VPC Peering. 36 | Profile: 37 | default: A secret with name cfn/atlas/profile/{Profile} 38 | OrgId: 39 | default: MongoDB Atlas API OrgId 40 | ProjectName: 41 | default: Name of new Atlas Project 42 | ClusterName: 43 | default: Name of new cluster 44 | ClusterRegion: 45 | default: The AWS Region for Atlas Cluster 46 | ClusterInstanceSize: 47 | default: MongoDB Atlas Instance Size 48 | DatabaseUserRoleDatabaseName: 49 | default: MongoDB Atlas Database User Role Database Name 50 | VPCRegion: 51 | default: The AWS Region for VPC 52 | DatabaseUserName: 53 | default: MongoDB Atlas Database User Name 54 | DatabasePassword: 55 | default: MongoDB Atlas Database User Password 56 | Parameters: 57 | Profile: 58 | Description: "A secret with name cfn/atlas/profile/{Profile}" 59 | Type: String 60 | Default: "default" 61 | OrgId: 62 | Description: "Your MongoDB Cloud Organization Id" 63 | Type: String 64 | Default: "OrgId" 65 | ProjectName: 66 | Description: "The name of the project." 67 | Type: String 68 | Default: "aws-quickstart-vpc" 69 | ClusterName: 70 | Description: Name of the cluster as it appears in Atlas. Once the cluster is created, 71 | its name cannot be changed. 72 | Type: String 73 | Default: "Cluster-1" 74 | ClusterInstanceSize: 75 | Default: "M10" 76 | Description: Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you select is used for all the data-bearing hosts in your cluster tier. See https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws. 77 | Type: String 78 | AllowedValues: 79 | - "M10" 80 | - "M20" 81 | - "M30" 82 | - "M40" 83 | - "R40" 84 | - "M40_NVME" 85 | - "M50" 86 | - "R50" 87 | - "M50_NVME" 88 | - "M60" 89 | - "R60" 90 | - "M60_NVME" 91 | - "M80" 92 | - "R80" 93 | - "M80_NVME" 94 | - "M140" 95 | - "M200" 96 | - "R200" 97 | - "M200_NVME" 98 | - "M300" 99 | - "R300" 100 | - "R400" 101 | - "M400_NVME" 102 | - "R700" 103 | ClusterRegion: 104 | Default: "US_EAST_1" 105 | Description: AWS Region where the Atlas database runs. 106 | Type: String 107 | AllowedValues: 108 | - "US_EAST_1" 109 | - "US_EAST_2" 110 | - "CA_CENTRAL_1" 111 | - "US_WEST_1" 112 | - "US_WEST_2" 113 | - "SA_EAST_1" 114 | - "AP_SOUTH_1" 115 | - "AP_EAST_1" 116 | - "AP_SOUTHEAST_1" 117 | - "AP_SOUTHEAST_2" 118 | - "AP_SOUTHEAST_3" 119 | - "AP_NORTHEAST_1" 120 | - "AP_NORTHEAST_2" 121 | - "AP_NORTHEAST_3" 122 | - "EU_CENTRAL_1" 123 | - "EU_WEST_1" 124 | - "EU_NORTH_1" 125 | - "EU_WEST_2" 126 | - "EU_WEST_3" 127 | - "EU_SOUTH_1" 128 | - "ME_SOUTH_1" 129 | - "AF_SOUTH_1" 130 | ClusterMongoDBMajorVersion: 131 | Description: The version of MongoDB 132 | Type: String 133 | Default: "5.0" 134 | AllowedValues: 135 | - "4.4" 136 | - "5.0" 137 | - "6.0" 138 | DatabaseUserRoleDatabaseName: 139 | Description: Database Name 140 | Type: String 141 | Default: "admin" 142 | VPC: 143 | Type: AWS::EC2::VPC::Id 144 | Description: VPC-ID of your existing Virtual Private Cloud (VPC) which you wish to peer to your new MongoDB Atlas cluster. This is the VPC that your application uses usually. 145 | RouteTableCIDRBlock: 146 | Type: String 147 | Description: CIDR block to use for your VPC Peering. 148 | VPCRegion: 149 | Default: 'us-east-1' 150 | Description: AWS Region where the Quick Start S3 bucket (QSS3BucketName) is hosted. If you use your own bucket, you must specify this value. 151 | Type: String 152 | DatabaseUserName: 153 | Description: MongoDB Atlas Database User Name. 154 | Type: String 155 | Default: "testUser" 156 | DatabasePassword: 157 | Description: MongoDB Atlas Database User Password. 158 | Type: String 159 | NoEcho: true 160 | AtlasCidrBlock: 161 | Type: String 162 | Description: IP addresses expressed in Classless Inter-Domain Routing (CIDR) notation that MongoDB Cloud uses for the network peering containers in your project. 163 | Resources: 164 | AtlasIAMRole: 165 | Type: AWS::IAM::Role 166 | Properties: 167 | AssumeRolePolicyDocument: 168 | Version: 2012-10-17 169 | Statement: 170 | - Effect: Allow 171 | Principal: 172 | AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root" 173 | Action: 'sts:AssumeRole' 174 | AtlasProject: 175 | Type: MongoDB::Atlas::Project 176 | DependsOn: AtlasIAMRole 177 | Properties: 178 | OrgId: !Ref "OrgId" 179 | Profile: !Ref "Profile" 180 | Name: !Ref "ProjectName" 181 | AtlasProjectIPAccessList: 182 | Type: MongoDB::Atlas::ProjectIpAccessList 183 | Properties: 184 | ProjectId: !GetAtt "AtlasProject.Id" 185 | Profile: !Ref "Profile" 186 | AccessList: 187 | - IPAddress: "0.0.0.0/0" 188 | Comment: "Testing open all ips" 189 | AtlasNetworkPeering: 190 | Type: MongoDB::Atlas::NetworkPeering 191 | Properties: 192 | ProjectId: !GetAtt "AtlasProject.Id" 193 | Profile: !Ref "Profile" 194 | AccepterRegionName: !Ref "VPCRegion" 195 | AwsAccountId: !Sub "${AWS::AccountId}" 196 | RouteTableCIDRBlock: !Ref "RouteTableCIDRBlock" 197 | VpcId: !Ref "VPC" 198 | ContainerId: !GetAtt "NetworkContainer.Id" 199 | AtlasCluster: 200 | Type: MongoDB::Atlas::Cluster 201 | DependsOn: NetworkContainer # Important to wait for the Network Container, otherwise the network container deletion will fail when deleting the stack 202 | Properties: 203 | Profile: !Ref "Profile" 204 | ProjectId: !GetAtt "AtlasProject.Id" 205 | Name: !Ref "ClusterName" 206 | MongoDBMajorVersion: !Ref "ClusterMongoDBMajorVersion" 207 | ClusterType: "REPLICASET" 208 | ReplicationSpecs: 209 | - NumShards: '1' 210 | AdvancedRegionConfigs: 211 | - AutoScaling: 212 | DiskGB: 213 | Enabled: 'true' 214 | Compute: 215 | Enabled: 'false' 216 | ScaleDownEnabled: 'false' 217 | AnalyticsSpecs: 218 | EbsVolumeType: STANDARD 219 | InstanceSize: !Ref "ClusterInstanceSize" 220 | NodeCount: '3' 221 | ElectableSpecs: 222 | EbsVolumeType: STANDARD 223 | InstanceSize: !Ref "ClusterInstanceSize" 224 | NodeCount: '3' 225 | ReadOnlySpecs: 226 | EbsVolumeType: STANDARD 227 | InstanceSize: !Ref "ClusterInstanceSize" 228 | NodeCount: '3' 229 | Priority: '7' 230 | RegionName: !Ref ClusterRegion 231 | AtlasDatabaseUser: 232 | Type: MongoDB::Atlas::DatabaseUser 233 | DependsOn: AtlasCluster 234 | Properties: 235 | ProjectId: !GetAtt "AtlasProject.Id" 236 | Profile: !Ref "Profile" 237 | Username: !Ref "DatabaseUserName" 238 | Password: !Ref "DatabasePassword" 239 | DatabaseName: "admin" 240 | Roles: 241 | - RoleName: "readWrite" 242 | DatabaseName: !Ref "DatabaseUserRoleDatabaseName" 243 | Scopes: 244 | - Name: !Ref "ClusterName" 245 | Type: "CLUSTER" 246 | NetworkContainer: 247 | Type: MongoDB::Atlas::NetworkContainer 248 | Properties: 249 | Profile: !Ref "Profile" 250 | AtlasCidrBlock: !Ref AtlasCidrBlock 251 | RegionName: !Ref ClusterRegion 252 | ProjectId: !GetAtt "AtlasProject.Id" 253 | Outputs: 254 | AtlasIAMRole: 255 | Description: "ARN for AWS IAM Role database cluster access" 256 | Value: !GetAtt "AtlasIAMRole.Arn" 257 | Export: 258 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasIAMRoleARN" ] ] 259 | AtlasDatabaseUser: 260 | Description: "Atlas database user, configured for AWS IAM Role access." 261 | Value: !Ref AtlasDatabaseUser 262 | Export: 263 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasDatabaseUser" ] ] 264 | AtlasProject: 265 | Description: "Info on your Atlas deployment" 266 | Value: !Ref AtlasProject 267 | Export: 268 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectId" ] ] 269 | AtlasProjectIPAccessList: 270 | Description: "Atlas project ip access list" 271 | Value: !Ref AtlasProjectIPAccessList 272 | Export: 273 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectIPAccessList" ] ] 274 | AtlasCluster: 275 | Description: "Info on your Atlas Cluster" 276 | Value: !Ref AtlasCluster 277 | Export: 278 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasCluster" ] ] 279 | ClusterState: 280 | Description: "Cluster State" 281 | Value: !GetAtt "AtlasCluster.StateName" 282 | Export: 283 | Name: !Join [ "-", [ !Ref "AWS::StackName","ClusterState" ] ] 284 | ClusterSrvAddress: 285 | Description: "Hostname for mongodb+srv:// connection string" 286 | Value: !GetAtt "AtlasCluster.ConnectionStrings.StandardSrv" 287 | Export: 288 | Name: !Join [ "-", [ !Ref "AWS::StackName","ClusterSrvAddress" ] ] 289 | AtlasNetworkPeering: 290 | Description: "Info on the network peering connection" 291 | Value: !Ref AtlasNetworkPeering 292 | Export: 293 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasNetworkPeering" ] ] -------------------------------------------------------------------------------- /templates/mongodb-atlas.base.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: MongoDB Atlas AWS CloudFormation Quickstart. (qs-1tq8f0hrt) 4 | Metadata: 5 | cfn-lint: { config: { ignore_checks: [ W9002, W9003, W9006, E3001, E1010 ] } } 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - Label: 9 | default: MongoDB Atlas Common Configuration 10 | Parameters: 11 | - InstanceType 12 | - Profile 13 | - OrgId 14 | - InstanceName 15 | - InstanceRegion 16 | - ProjectName 17 | - Label: 18 | default: MongoDB Atlas Serverless Private endpoint Configuration 19 | Parameters: 20 | - CreateAndAssignAWSPrivateEndpoint 21 | - VpcId 22 | - Label: 23 | default: MongoDB Atlas Cluster Configuration 24 | Parameters: 25 | - ClusterInstanceSize 26 | - DatabaseUserRoleDatabaseName 27 | - VPCCIDR 28 | - PrivateSubnetCIDR 29 | - AvailabilityZone 30 | - VPCRegion 31 | - DatabaseUserName 32 | - DatabasePassword 33 | ParameterLabels: 34 | Profile: 35 | default: Secret profile 36 | OrgId: 37 | default: MongoDB Atlas API OrgId 38 | ProjectName: 39 | default: Name of new Atlas Project 40 | InstanceName: 41 | default: Name of new cluster 42 | InstanceRegion: 43 | default: The AWS Region for Atlas Cluster 44 | ClusterInstanceSize: 45 | default: MongoDB Atlas Instance Size 46 | DatabaseUserRoleDatabaseName: 47 | default: MongoDB Atlas Database User Role Database Name 48 | VPCCIDR: 49 | default: VPC CIDR. 50 | PrivateSubnetCIDR: 51 | default: Private subnet CIDR 52 | AvailabilityZone: 53 | default: AZ for subnet 54 | VPCRegion: 55 | default: The AWS Region for VPC private endpoint. 56 | DatabaseUserName: 57 | default: MongoDB Atlas Database User Name 58 | DatabasePassword: 59 | default: MongoDB Atlas Database User Password 60 | Parameters: 61 | InstanceType: 62 | Description: 'choose wich instance you want to create' 63 | Type: String 64 | Default: 'Dedicated Cluster' 65 | AllowedValues: 66 | - 'Dedicated Cluster' 67 | - 'Serverless Instance' 68 | Profile: 69 | Description: "A secret with the cfn/atlas/profile/{Profile}" 70 | Type: String 71 | Default: "default" 72 | OrgId: 73 | Description: "Your MongoDB Cloud Organization Id" 74 | Type: String 75 | Default: "OrgId" 76 | ProjectName: 77 | Description: "The name of the project." 78 | Type: String 79 | Default: "aws-quickstart" 80 | CreateAndAssignAWSPrivateEndpoint: 81 | Type: String 82 | Description: "If true the resource will create the aws private endpoint and assign the Endpoint ID" 83 | Default: "false" 84 | AllowedValues: 85 | - "true" 86 | - "false" 87 | VpcId: 88 | Description: "String Representing the AWS VPC ID (like: vpc-xxxxxxxxxxxxxxxx) (Used For Creating the AWS VPC Endpoint)" 89 | Type: String 90 | ServerlessProviderName: 91 | Type: String 92 | Description: Human-readable label that identifies the cloud service provider. Used only on the Serverless Instance 93 | Default: "SERVERLESS" 94 | ServerlessTerminationProtectionEnabled: 95 | Type: String 96 | Description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to true MongoDB Cloud won't delete the serverless instance. If set to false MongoDB cloud will delete the serverless instance. 97 | ConstraintDescription: boolean 98 | AllowedValues: 99 | - "true" 100 | - "false" 101 | Default: "false" 102 | ServerlessContinuousBackupEnabled: 103 | Type: String 104 | Description: Flag that indicates whether the serverless instances uses Serverless Continuous Backup. If this parameter is false the serverless instance uses Basic Backup. | Option | Description | |---|---| | Serverless Continuous Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and lets you restore the data from a selected point in time within the last 72 hours. Atlas also takes daily snapshots and retains these daily snapshots for 35 days. To learn more see Serverless Instance Costs. | | Basic Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and retains only the two most recent snapshots. You can use this option for free. 105 | ConstraintDescription: boolean 106 | AllowedValues: 107 | - "true" 108 | - "false" 109 | Default: "true" 110 | InstanceName: 111 | Description: Name of the cluster as it appears in Atlas. Once the cluster is created,its name cannot be changed. 112 | Type: String 113 | Default: "ServerlessInstance-Cluster-1" 114 | ClusterInstanceSize: 115 | Default: "M10" 116 | Description: Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you select is used for all the data-bearing hosts in your cluster tier. See https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws. 117 | Type: String 118 | AllowedValues: 119 | - "M10" 120 | - "M20" 121 | - "M30" 122 | - "M40" 123 | - "R40" 124 | - "M40_NVME" 125 | - "M50" 126 | - "R50" 127 | - "M50_NVME" 128 | - "M60" 129 | - "R60" 130 | - "M60_NVME" 131 | - "M80" 132 | - "R80" 133 | - "M80_NVME" 134 | - "M140" 135 | - "M200" 136 | - "R200" 137 | - "M200_NVME" 138 | - "M300" 139 | - "R300" 140 | - "R400" 141 | - "M400_NVME" 142 | - "R700" 143 | InstanceRegion: 144 | Default: US_EAST_1 145 | Description: AWS Region where the Atlas database runs. 146 | Type: String 147 | AllowedValues: 148 | - "US_EAST_1" 149 | - "US_EAST_2" 150 | - "CA_CENTRAL_1" 151 | - "US_WEST_1" 152 | - "US_WEST_2" 153 | - "SA_EAST_1" 154 | - "AP_SOUTH_1" 155 | - "AP_EAST_1" 156 | - "AP_SOUTHEAST_1" 157 | - "AP_SOUTHEAST_2" 158 | - "AP_SOUTHEAST_3" 159 | - "AP_NORTHEAST_1" 160 | - "AP_NORTHEAST_2" 161 | - "AP_NORTHEAST_3" 162 | - "EU_CENTRAL_1" 163 | - "EU_WEST_1" 164 | - "EU_NORTH_1" 165 | - "EU_WEST_2" 166 | - "EU_WEST_3" 167 | - "EU_SOUTH_1" 168 | - "ME_SOUTH_1" 169 | - "AF_SOUTH_1" 170 | ClusterMongoDBMajorVersion: 171 | Description: The version of MongoDB 172 | Type: String 173 | Default: "5.0" 174 | AllowedValues: 175 | - "4.4" 176 | - "5.0" 177 | - "6.0" 178 | DatabaseUserRoleDatabaseName: 179 | Description: Database Name 180 | Type: String 181 | Default: "test" 182 | PrivateSubnetCIDR: 183 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 184 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 185 | Default: 10.0.0.0/19 186 | Description: CIDR block for the private subnet, located in Availability Zone 1. 187 | Type: String 188 | VPCCIDR: 189 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 190 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 191 | Default: 10.0.0.0/16 192 | Description: CIDR block for the VPC. 193 | Type: String 194 | AvailabilityZone: 195 | Description: For subnets 196 | Type: String 197 | Default: "us-east-1a" 198 | VPCRegion: 199 | Default: "us-west-2" 200 | Description: The AWS Region where the Atlas DB Cluster will run. 201 | Type: String 202 | AllowedValues: 203 | - "us-east-1" 204 | - "us-east-2" 205 | - "ca-central-1" 206 | - "us-west-1" 207 | - "us-west-2" 208 | - "sa-east-1" 209 | - "ap-south-1" 210 | - "ap-east-2" 211 | - "ap-southeast-1" 212 | - "ap-southeast-2" 213 | - "ap-southeast-3" 214 | - "ap-northeast-1" 215 | - "ap-northeast-2" 216 | - "ap-northeast-3" 217 | - "eu-central-1" 218 | - "eu-west-1" 219 | - "eu-north-1" 220 | - "eu-west-1" 221 | - "eu-west-2" 222 | - "eu-west-3" 223 | - "eu-south-1" 224 | - "me-south-1" 225 | - "af-south-1" 226 | DatabaseUserName: 227 | Description: MongoDB Atlas Database User Name. 228 | Type: String 229 | Default: "testUser" 230 | DatabasePassword: 231 | Description: MongoDB Atlas Database User Password. 232 | Type: String 233 | NoEcho: true 234 | Conditions: 235 | CreateCluster: !Equals [!Ref InstanceType, 'Dedicated Cluster'] 236 | CreateServerless: !Equals [!Ref InstanceType, 'Serverless Instance'] 237 | Resources: 238 | AtlasIAMRole: 239 | Type: AWS::IAM::Role 240 | Properties: 241 | AssumeRolePolicyDocument: 242 | Version: 2012-10-17 243 | Statement: 244 | - Effect: Allow 245 | Principal: 246 | AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root" 247 | Action: 'sts:AssumeRole' 248 | - Effect: Allow 249 | Principal: 250 | AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root" 251 | Service: ecs-tasks.amazonaws.com 252 | Action: 'sts:AssumeRole' 253 | ManagedPolicyArns: 254 | - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy 255 | - !Sub arn:${AWS::Partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly 256 | AtlasProject: 257 | Type: MongoDB::Atlas::Project 258 | DependsOn: AtlasIAMRole 259 | Properties: 260 | OrgId: !Ref "OrgId" 261 | Profile: !Ref "Profile" 262 | Name: !Ref "ProjectName" 263 | AtlasProjectIPAccessList: 264 | Type: MongoDB::Atlas::ProjectIpAccessList 265 | Properties: 266 | ProjectId: !GetAtt "AtlasProject.Id" 267 | Profile: !Ref "Profile" 268 | AccessList: 269 | - IPAddress: "0.0.0.0/0" 270 | Comment: "Testing open all ips" 271 | AtlasServerlessInstance: 272 | Type: MongoDB::Atlas::ServerlessInstance 273 | Condition: CreateServerless 274 | Properties: 275 | Name: !Ref InstanceName 276 | Profile: !Ref "Profile" 277 | ProjectID: !GetAtt "AtlasProject.Id" 278 | ProviderSettings: 279 | RegionName: !Ref InstanceRegion 280 | ProviderName: !Ref ServerlessProviderName 281 | TerminationProtectionEnabled: !Ref ServerlessTerminationProtectionEnabled 282 | ContinuousBackupEnabled : !Ref ServerlessContinuousBackupEnabled 283 | AtlasServerlessPrivateEndpoint: 284 | Type: MongoDB::Atlas::ServerlessPrivateEndpoint 285 | Condition: CreateServerless 286 | DependsOn: AtlasServerlessInstance 287 | Properties: 288 | ProjectId: !GetAtt "AtlasProject.Id" 289 | Profile: !Ref "Profile" 290 | InstanceName: !Ref InstanceName 291 | CreateAndAssignAWSPrivateEndpoint : !Ref CreateAndAssignAWSPrivateEndpoint 292 | AwsPrivateEndpointConfigurationProperties: 293 | VpcId: !Ref VpcId 294 | Region: !Ref InstanceRegion 295 | AtlasCluster: 296 | Type: MongoDB::Atlas::Cluster 297 | Condition: CreateCluster 298 | Properties: 299 | Profile: !Ref "Profile" 300 | ProjectId: !GetAtt "AtlasProject.Id" 301 | Name: !Ref "InstanceName" 302 | MongoDBMajorVersion: !Ref "ClusterMongoDBMajorVersion" 303 | ClusterType: "REPLICASET" 304 | ReplicationSpecs: 305 | - NumShards: '1' 306 | AdvancedRegionConfigs: 307 | - AutoScaling: 308 | DiskGB: 309 | Enabled: 'true' 310 | Compute: 311 | Enabled: 'false' 312 | ScaleDownEnabled: 'false' 313 | ElectableSpecs: 314 | EbsVolumeType: STANDARD 315 | InstanceSize: !Ref ClusterInstanceSize 316 | NodeCount: '3' 317 | ReadOnlySpecs: 318 | EbsVolumeType: STANDARD 319 | InstanceSize: !Ref ClusterInstanceSize 320 | NodeCount: '1' 321 | Priority: '7' 322 | RegionName: !Ref InstanceRegion 323 | AtlasDatabaseUser: 324 | Type: MongoDB::Atlas::DatabaseUser 325 | Properties: 326 | ProjectId: !GetAtt "AtlasProject.Id" 327 | Profile: !Ref "Profile" 328 | Username: !Ref "DatabaseUserName" 329 | Password: !Ref "DatabasePassword" 330 | DatabaseName: "admin" 331 | Roles: 332 | - RoleName: "readWrite" 333 | DatabaseName: !Ref "DatabaseUserRoleDatabaseName" 334 | Scopes: 335 | - Name: !Ref "InstanceName" 336 | Type: "CLUSTER" 337 | PrivateEndpoint: 338 | Type: MongoDB::Atlas::PrivateEndpoint 339 | Condition: CreateCluster 340 | DependsOn: AtlasCluster 341 | Properties: 342 | GroupId: !GetAtt "AtlasProject.Id" 343 | Profile: !Ref "Profile" 344 | Region: !Ref "VPCRegion" 345 | PrivateEndpoints: 346 | - VpcId: !Ref PrivateVPC 347 | SubnetIds: 348 | - !Ref PrivateSubnet 349 | PrivateVPC: 350 | Type: 'AWS::EC2::VPC' 351 | Properties: 352 | CidrBlock: !Ref VPCCIDR 353 | PrivateSubnet: 354 | Type: 'AWS::EC2::Subnet' 355 | Properties: 356 | VpcId: !Ref PrivateVPC 357 | AvailabilityZone: !Ref AvailabilityZone 358 | CidrBlock: !Ref PrivateSubnetCIDR 359 | 360 | Outputs: 361 | AtlasIAMRole: 362 | Description: "ARN for AWS IAM Role database cluster access" 363 | Value: !GetAtt "AtlasIAMRole.Arn" 364 | Export: 365 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasIAMRoleARN" ] ] 366 | AtlasDatabaseUser: 367 | Description: "Atlas database user, configured for AWS IAM Role access." 368 | Value: !Ref AtlasDatabaseUser 369 | Export: 370 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasDatabaseUser" ] ] 371 | AtlasProject: 372 | Description: "Info on your Atlas deployment" 373 | Value: !Ref AtlasProject 374 | Export: 375 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectId" ] ] 376 | AtlasProjectIPAccessList: 377 | Description: "Atlas project ip access list" 378 | Value: !Ref AtlasProjectIPAccessList 379 | Export: 380 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectIPAccessList" ] ] 381 | AtlasCluster: 382 | Condition: CreateCluster 383 | Description: "Info on your Atlas Cluster" 384 | Value: !Ref AtlasCluster 385 | Export: 386 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasCluster" ] ] 387 | ClusterSrvAddress: 388 | Condition: CreateCluster 389 | Description: "Hostname for mongodb+srv:// connection string" 390 | Value: !GetAtt "AtlasCluster.ConnectionStrings.StandardSrv" 391 | Export: 392 | Name: !Join [ "-", [ !Ref "AWS::StackName","ClusterSrvAddress" ] ] 393 | 394 | -------------------------------------------------------------------------------- /templates/mongodb-atlas.private-endpoint.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: MongoDB Atlas AWS Partner Solution with Private Endpoint. (qs-1tq8f0hrt) 4 | Metadata: 5 | cfn-lint: { config: { ignore_checks: [ W9002, W9003, W9006, E3001, E1010 ] } } 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - Label: 9 | default: MongoDB Atlas Common Configuration 10 | Parameters: 11 | - InstanceType 12 | - Profile 13 | - OrgId 14 | - InstanceName 15 | - InstanceRegion 16 | - ProjectName 17 | - Label: 18 | default: Network Configuration 19 | Parameters: 20 | - VPCCIDR 21 | - PrivateSubnetCIDR 22 | - VPCRegion 23 | - Label: 24 | default: MongoDB Atlas Configuration 25 | Parameters: 26 | - ProjectName 27 | - InstanceName 28 | - InstanceRegion 29 | - ClusterInstanceSize 30 | - DatabaseUserRoleDatabaseName 31 | - ActivateMongoDBResources 32 | - AvailabilityZone 33 | - DatabaseUserName 34 | - DatabasePassword 35 | - Label: 36 | default: AWS Quick Start configuration 37 | Parameters: 38 | - QSS3BucketName 39 | - QSS3KeyPrefix 40 | - QSS3BucketRegion 41 | ParameterLabels: 42 | Profile: 43 | default: A secret with the name cfn/atlas/profile/{Profile} 44 | OrgId: 45 | default: MongoDB Atlas API OrgId 46 | ProjectName: 47 | default: Name of new Atlas Project 48 | InstanceName: 49 | default: Name of new cluster 50 | InstanceRegion: 51 | default: The AWS Region for Atlas Cluster 52 | ClusterInstanceSize: 53 | default: MongoDB Atlas Instance Size 54 | DatabaseUserRoleDatabaseName: 55 | default: MongoDB Atlas Database Name 56 | ActivateMongoDBResources: 57 | default: Activate MongoDB Atlas CloudFormation resources 58 | VPCCIDR: 59 | default: VPC CIDR. 60 | PrivateSubnetCIDR: 61 | default: Private subnet CIDR 62 | AvailabilityZone: 63 | default: AZ fo subnet 64 | VPCRegion: 65 | default: The AWS Region for VPC private endpoint. 66 | DatabaseUserName: 67 | default: MongoDB Atlas Database User Name 68 | DatabasePassword: 69 | default: MongoDB Atlas Database User Password 70 | Parameters: 71 | InstanceType: 72 | Description: 'choose wich instance you want to create' 73 | Type: String 74 | Default: 'Dedicated Cluster' 75 | AllowedValues: 76 | - 'Dedicated Cluster' 77 | - 'Serverless Instance' 78 | Profile: 79 | Description: "A secret with the cfn/atlas/profile/{Profile}" 80 | Type: String 81 | Default: "default" 82 | OrgId: 83 | Description: "Your MongoDB Cloud Organization Id" 84 | Type: String 85 | Default: "OrgId" 86 | ProjectName: 87 | Description: "The name of the project." 88 | Type: String 89 | Default: "aws-quickstart-pvt" 90 | CreateAndAssignAWSPrivateEndpoint: 91 | Type: String 92 | Description: "If true the resource will create the aws private endpoint and assign the Endpoint ID" 93 | Default: "false" 94 | AllowedValues: 95 | - "true" 96 | - "false" 97 | VpcId: 98 | Description: "String Representing the AWS VPC ID (like: vpc-xxxxxxxxxxxxxxxx) (Used For Creating the AWS VPC Endpoint)" 99 | Type: String 100 | ServerlessProviderName: 101 | Type: String 102 | Description: Human-readable label that identifies the cloud service provider. Used only on the Serverless Instance 103 | Default: "SERVERLESS" 104 | ServerlessTerminationProtectionEnabled: 105 | Type: String 106 | Description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to true MongoDB Cloud won't delete the serverless instance. If set to false MongoDB cloud will delete the serverless instance. 107 | ConstraintDescription: boolean 108 | AllowedValues: 109 | - "true" 110 | - "false" 111 | Default: "false" 112 | ServerlessContinuousBackupEnabled: 113 | Type: String 114 | Description: Flag that indicates whether the serverless instances uses Serverless Continuous Backup. If this parameter is false the serverless instance uses Basic Backup. | Option | Description | |---|---| | Serverless Continuous Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and lets you restore the data from a selected point in time within the last 72 hours. Atlas also takes daily snapshots and retains these daily snapshots for 35 days. To learn more see Serverless Instance Costs. | | Basic Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and retains only the two most recent snapshots. You can use this option for free. 115 | ConstraintDescription: boolean 116 | AllowedValues: 117 | - "true" 118 | - "false" 119 | Default: "true" 120 | InstanceName: 121 | Description: Name of the cluster as it appears in Atlas. Once the cluster is created, 122 | its name cannot be changed. 123 | Type: String 124 | Default: "Serverless-Cluster-1" 125 | ClusterInstanceSize: 126 | Default: "M10" 127 | Description: Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you select is used for all the data-bearing hosts in your cluster tier. See https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws. 128 | Type: String 129 | AllowedValues: 130 | - "M10" 131 | - "M20" 132 | - "M30" 133 | - "M40" 134 | - "R40" 135 | - "M40_NVME" 136 | - "M50" 137 | - "R50" 138 | - "M50_NVME" 139 | - "M60" 140 | - "R60" 141 | - "M60_NVME" 142 | - "M80" 143 | - "R80" 144 | - "M80_NVME" 145 | - "M140" 146 | - "M200" 147 | - "R200" 148 | - "M200_NVME" 149 | - "M300" 150 | - "R300" 151 | - "R400" 152 | - "M400_NVME" 153 | - "R700" 154 | InstanceRegion: 155 | Default: US_EAST_1 156 | Description: AWS Region where the Atlas database runs. 157 | Type: String 158 | AllowedValues: 159 | - "US_EAST_1" 160 | - "US_EAST_2" 161 | - "CA_CENTRAL_1" 162 | - "US_WEST_1" 163 | - "US_WEST_2" 164 | - "SA_EAST_1" 165 | - "AP_SOUTH_1" 166 | - "AP_EAST_1" 167 | - "AP_SOUTHEAST_1" 168 | - "AP_SOUTHEAST_2" 169 | - "AP_SOUTHEAST_3" 170 | - "AP_NORTHEAST_1" 171 | - "AP_NORTHEAST_2" 172 | - "AP_NORTHEAST_3" 173 | - "EU_CENTRAL_1" 174 | - "EU_WEST_1" 175 | - "EU_NORTH_1" 176 | - "EU_WEST_2" 177 | - "EU_WEST_3" 178 | - "EU_SOUTH_1" 179 | - "ME_SOUTH_1" 180 | - "AF_SOUTH_1" 181 | ClusterMongoDBMajorVersion: 182 | Description: The version of MongoDB 183 | Type: String 184 | Default: "5.0" 185 | AllowedValues: 186 | - "4.4" 187 | - "5.0" 188 | - "6.0" 189 | DatabaseUserRoleDatabaseName: 190 | Description: Database User Role Database Name 191 | Type: String 192 | Default: "test" 193 | VPCRegion: 194 | Default: "us-east-1" 195 | Description: The AWS Region where the Atlas DB Cluster will run. 196 | Type: String 197 | AllowedValues: 198 | - "us-east-1" 199 | - "us-east-2" 200 | - "ca-central-1" 201 | - "us-west-1" 202 | - "us-west-2" 203 | - "sa-east-1" 204 | - "ap-south-1" 205 | - "ap-east-2" 206 | - "ap-southeast-1" 207 | - "ap-southeast-2" 208 | - "ap-southeast-3" 209 | - "ap-northeast-1" 210 | - "ap-northeast-2" 211 | - "ap-northeast-3" 212 | - "eu-central-1" 213 | - "eu-west-1" 214 | - "eu-north-1" 215 | - "eu-west-1" 216 | - "eu-west-2" 217 | - "eu-west-3" 218 | - "eu-south-1" 219 | - "me-south-1" 220 | - "af-south-1" 221 | VPCCIDR: 222 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 223 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 224 | Default: 10.0.0.0/16 225 | Description: CIDR block for the VPC. 226 | Type: String 227 | ActivateMongoDBResources: 228 | Description: 'Enter "Yes" to activate MongoDB Atlas CloudFormation resource types. If you already activated resources in your AWS Region, enter "No."' 229 | Type: String 230 | Default: "Yes" 231 | AllowedValues: 232 | - "No" 233 | - "Yes" 234 | QSS3BucketName: 235 | AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$ 236 | ConstraintDescription: Quick Start bucket name can include numbers, lowercase 237 | letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen 238 | (-). 239 | Default: aws-quickstart 240 | Description: S3 bucket name for the Quick Start assets. This string can include 241 | numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start 242 | or end with a hyphen (-). 243 | Type: String 244 | QSS3KeyPrefix: 245 | AllowedPattern: ^[0-9a-zA-Z-/.]*$ 246 | ConstraintDescription: Quick Start key prefix can include numbers, lowercase letters, 247 | uppercase letters, hyphens (-), and forward slashes (/). 248 | Default: quickstart-mongodb-atlas/ 249 | Description: S3 key prefix for the Quick Start assets. Quick Start key prefix 250 | can include numbers, lowercase letters, uppercase letters, hyphens (-), and 251 | forward slashes (/). 252 | Type: String 253 | QSS3BucketRegion: 254 | Default: 'us-east-1' 255 | Description: AWS Region where the Quick Start S3 bucket (QSS3BucketName) is 256 | hosted. If you use your own bucket, you must specify this value. 257 | Type: String 258 | PrivateSubnetCIDR: 259 | AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ 260 | ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16–28. 261 | Default: 10.0.0.0/19 262 | Description: CIDR block for the private subnet, located in Availability Zone 1. 263 | Type: String 264 | AvailabilityZone: 265 | Description: AZ for subnet creation 266 | Type: String 267 | Default: "us-east-1a" 268 | DatabaseUserName: 269 | Description: MongoDB Atlas Database User Name. 270 | Type: String 271 | Default: "testUser" 272 | DatabasePassword: 273 | Description: MongoDB Atlas Database User Password. 274 | Type: String 275 | NoEcho: true 276 | Conditions: 277 | UsingDefaultBucket: !Equals [!Ref QSS3BucketName, 'aws-quickstart'] 278 | ActivateResources: !Equals [!Ref ActivateMongoDBResources, 'Yes'] 279 | Resources: 280 | Atlas: 281 | Type: AWS::CloudFormation::Stack 282 | Metadata: 283 | PseudoDependsOn: !If 284 | - ActivateResources 285 | - - !Ref ActivateAtlasResources 286 | - '' 287 | Properties: 288 | TemplateURL: !Sub 289 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/mongodb-atlas.base.template.yaml' 290 | - S3Region: !If [ UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion ] 291 | S3Bucket: !If [ UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName ] 292 | Parameters: 293 | ClusterInstanceSize: !Ref ClusterInstanceSize 294 | ClusterMongoDBMajorVersion: !Ref ClusterMongoDBMajorVersion 295 | ProjectName: !Ref ProjectName 296 | InstanceName: !Ref InstanceName 297 | InstanceRegion: !Ref InstanceRegion 298 | OrgId: !Ref OrgId 299 | Profile: !Ref Profile 300 | PrivateSubnetCIDR: !Ref PrivateSubnetCIDR 301 | VPCCIDR: !Ref VPCCIDR 302 | AvailabilityZone: !Ref AvailabilityZone 303 | VPCRegion: !Ref VPCRegion 304 | DatabaseUserRoleDatabaseName: !Ref DatabaseUserRoleDatabaseName 305 | DatabaseUserName: !Ref DatabaseUserName 306 | DatabasePassword: !Ref DatabasePassword 307 | ServerlessProviderName: !Ref ServerlessProviderName 308 | ServerlessTerminationProtectionEnabled: !Ref ServerlessTerminationProtectionEnabled 309 | ServerlessContinuousBackupEnabled: !Ref ServerlessContinuousBackupEnabled 310 | CreateAndAssignAWSPrivateEndpoint : !Ref CreateAndAssignAWSPrivateEndpoint 311 | VpcId: !Ref VpcId 312 | InstanceType: !Ref InstanceType 313 | 314 | ActivateAtlasResources: 315 | Condition: ActivateResources 316 | Type: AWS::CloudFormation::Stack 317 | Properties: 318 | TemplateURL: !Sub 319 | - 'https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/activate-mongodb-atlas-resources.template.yaml' 320 | - S3Region: !If [ UsingDefaultBucket, !Ref 'AWS::Region', !Ref QSS3BucketRegion ] 321 | S3Bucket: !If [ UsingDefaultBucket, !Sub '${QSS3BucketName}-${AWS::Region}', !Ref QSS3BucketName ] 322 | Parameters: 323 | Region: !Ref QSS3BucketRegion 324 | -------------------------------------------------------------------------------- /templates/mongodb-atlas.template.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | AWSTemplateFormatVersion: '2010-09-09' 3 | Description: MongoDB Atlas AWS CloudFormation Quickstart. (qs-1rkorhec7) 4 | Metadata: 5 | cfn-lint: { config: { ignore_checks: [ W9002, W9003, W9006, E3001, E1010 ] } } 6 | AWS::CloudFormation::Interface: 7 | ParameterGroups: 8 | - Label: 9 | default: MongoDB Atlas ApiKey Configuration 10 | Parameters: 11 | - Profile 12 | - OrgId 13 | - Label: 14 | default: MongoDB Atlas Configuration 15 | Parameters: 16 | - ProjectName 17 | - InstanceName 18 | - Region 19 | - ClusterInstanceSize 20 | - DatabaseUserRoleDatabaseName 21 | - DatabaseUserName 22 | - DatabasePassword 23 | ParameterLabels: 24 | Profile: 25 | default: A secret with name cfn/atlas/profile/{Profile} 26 | OrgId: 27 | default: MongoDB Atlas API OrgId 28 | ProjectName: 29 | default: Name of new Atlas Project 30 | InstanceName: 31 | default: Name of new cluster or the serverless Instance to be created 32 | Region: 33 | default: The AWS Region for Atlas Cluster or the serverless instance created 34 | ClusterInstanceSize: 35 | default: MongoDB Atlas Instance Size 36 | DatabaseUserRoleDatabaseName: 37 | default: MongoDB Atlas Database User Role Database Name 38 | DatabaseUserName: 39 | default: MongoDB Atlas Database User Name 40 | DatabasePassword: 41 | default: MongoDB Atlas Database User Password 42 | Parameters: 43 | InstanceType: 44 | Description: 'choose wich instance you want to create' 45 | Type: String 46 | Default: 'Dedicated Cluster' 47 | AllowedValues: 48 | - 'Dedicated Cluster' 49 | - 'Serverless Instance' 50 | ServerlessProviderName: 51 | Type: String 52 | Description: Human-readable label that identifies the cloud service provider. Used only on the Serverless Instance 53 | Default: "SERVERLESS" 54 | ServerlessTerminationProtectionEnabled: 55 | Type: String 56 | Description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to true MongoDB Cloud won't delete the serverless instance. If set to false MongoDB cloud will delete the serverless instance. 57 | ConstraintDescription: boolean 58 | AllowedValues: 59 | - "true" 60 | - "false" 61 | Default: "false" 62 | ServerlessContinuousBackupEnabled: 63 | Type: String 64 | Description: Flag that indicates whether the serverless instances uses Serverless Continuous Backup. If this parameter is false the serverless instance uses Basic Backup. | Option | Description | |---|---| | Serverless Continuous Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and lets you restore the data from a selected point in time within the last 72 hours. Atlas also takes daily snapshots and retains these daily snapshots for 35 days. To learn more see Serverless Instance Costs. | | Basic Backup | Atlas takes incremental snapshots of the data in your serverless instance every six hours and retains only the two most recent snapshots. You can use this option for free. 65 | ConstraintDescription: boolean 66 | AllowedValues: 67 | - "true" 68 | - "false" 69 | Default: "true" 70 | Profile: 71 | Description: "A secret with name cfn/atlas/profile/{Profile}" 72 | Type: String 73 | Default: "default" 74 | OrgId: 75 | Description: "Your MongoDB Cloud Organization Id" 76 | Type: String 77 | Default: "OrgId" 78 | ProjectName: 79 | Description: "The name of the project." 80 | Type: String 81 | Default: "aws-quickstart" 82 | InstanceName: 83 | Description: Name of the cluster or the serverless instances as it appears in Atlas. Once the cluster/serverlessInstance is created, 84 | its name cannot be changed. 85 | Type: String 86 | Default: "Cluster-1" 87 | ClusterInstanceSize: 88 | Default: "M10" 89 | Description: Atlas provides different cluster tiers, each with a default storage capacity and RAM size. The cluster you select is used for all the data-bearing hosts in your cluster tier. See https://docs.atlas.mongodb.com/reference/amazon-aws/#amazon-aws. 90 | Type: String 91 | AllowedValues: 92 | - "M10" 93 | - "M20" 94 | - "M30" 95 | - "M40" 96 | - "R40" 97 | - "M40_NVME" 98 | - "M50" 99 | - "R50" 100 | - "M50_NVME" 101 | - "M60" 102 | - "R60" 103 | - "M60_NVME" 104 | - "M80" 105 | - "R80" 106 | - "M80_NVME" 107 | - "M140" 108 | - "M200" 109 | - "R200" 110 | - "M200_NVME" 111 | - "M300" 112 | - "R300" 113 | - "R400" 114 | - "M400_NVME" 115 | - "R700" 116 | Region: 117 | Default: "US_EAST_1" 118 | Description: AWS Region where the Atlas database runs. 119 | Type: String 120 | AllowedValues: 121 | - "US_EAST_1" 122 | - "US_EAST_2" 123 | - "CA_CENTRAL_1" 124 | - "US_WEST_1" 125 | - "US_WEST_2" 126 | - "SA_EAST_1" 127 | - "AP_SOUTH_1" 128 | - "AP_EAST_1" 129 | - "AP_SOUTHEAST_1" 130 | - "AP_SOUTHEAST_2" 131 | - "AP_NORTHEAST_1" 132 | - "AP_NORTHEAST_2" 133 | - "EU_CENTRAL_1" 134 | - "EU_WEST_1" 135 | - "EU_NORTH_1" 136 | - "EU_WEST_2" 137 | - "EU_WEST_3" 138 | - "EU_SOUTH_1" 139 | - "ME_SOUTH_1" 140 | - "AF_SOUTH_1" 141 | ClusterMongoDBMajorVersion: 142 | Description: The version of MongoDB 143 | Type: String 144 | Default: "5.0" 145 | AllowedValues: 146 | - "4.4" 147 | - "5.0" 148 | - "6.0" 149 | DatabaseUserRoleDatabaseName: 150 | Description: Database Name 151 | Type: String 152 | Default: "test" 153 | DatabaseUserName: 154 | Description: MongoDB Atlas Database User Name. 155 | Type: String 156 | Default: "testUser" 157 | DatabasePassword: 158 | Description: MongoDB Atlas Database User Password. 159 | Type: String 160 | NoEcho: true 161 | Conditions: 162 | CreateCluster: !Equals [!Ref InstanceType, 'Dedicated Cluster'] 163 | CreateServerless: !Equals [!Ref InstanceType, 'Serverless Instance'] 164 | Resources: 165 | AtlasIAMRole: 166 | Type: AWS::IAM::Role 167 | Properties: 168 | AssumeRolePolicyDocument: 169 | Version: 2012-10-17 170 | Statement: 171 | - Effect: Allow 172 | Principal: 173 | AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root" 174 | Action: 'sts:AssumeRole' 175 | - Effect: Allow 176 | Principal: 177 | AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root" 178 | Service: ecs-tasks.amazonaws.com 179 | Action: 'sts:AssumeRole' 180 | ManagedPolicyArns: 181 | - !Sub arn:${AWS::Partition}:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy 182 | - !Sub arn:${AWS::Partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly 183 | AtlasProject: 184 | Type: MongoDB::Atlas::Project 185 | DependsOn: AtlasIAMRole 186 | Properties: 187 | OrgId: !Ref "OrgId" 188 | Profile: !Ref "Profile" 189 | Name: !Ref "ProjectName" 190 | AtlasProjectIPAccessList: 191 | Type: MongoDB::Atlas::ProjectIpAccessList 192 | Properties: 193 | ProjectId: !GetAtt "AtlasProject.Id" 194 | Profile: !Ref "Profile" 195 | AccessList: 196 | - IPAddress: "0.0.0.0/0" 197 | Comment: "Testing open all ips" 198 | AtlasServerlessInstance: 199 | Type: MongoDB::Atlas::ServerlessInstance 200 | Condition: CreateServerless 201 | Properties: 202 | Name: !Ref "InstanceName" 203 | Profile: !Ref "Profile" 204 | ProjectID: !GetAtt "AtlasProject.Id" 205 | ProviderSettings: 206 | RegionName: !Ref "Region" 207 | ProviderName: !Ref "ServerlessProviderName" 208 | TerminationProtectionEnabled: !Ref "ServerlessTerminationProtectionEnabled" 209 | ContinuousBackupEnabled : !Ref "ServerlessContinuousBackupEnabled" 210 | AtlasCluster: 211 | Type: MongoDB::Atlas::Cluster 212 | Condition: CreateCluster 213 | Properties: 214 | Profile: !Ref "Profile" 215 | ProjectId: !GetAtt "AtlasProject.Id" 216 | Name: !Ref "InstanceName" 217 | MongoDBMajorVersion: !Ref "ClusterMongoDBMajorVersion" 218 | ClusterType: "REPLICASET" 219 | ReplicationSpecs: 220 | - NumShards: '1' 221 | AdvancedRegionConfigs: 222 | - AutoScaling: 223 | DiskGB: 224 | Enabled: 'true' 225 | Compute: 226 | Enabled: 'false' 227 | ScaleDownEnabled: 'false' 228 | AnalyticsSpecs: 229 | EbsVolumeType: STANDARD 230 | InstanceSize: !Ref "ClusterInstanceSize" 231 | NodeCount: '3' 232 | ElectableSpecs: 233 | EbsVolumeType: STANDARD 234 | InstanceSize: !Ref "ClusterInstanceSize" 235 | NodeCount: '3' 236 | ReadOnlySpecs: 237 | EbsVolumeType: STANDARD 238 | InstanceSize: !Ref "ClusterInstanceSize" 239 | NodeCount: '3' 240 | Priority: '7' 241 | RegionName: !Ref Region 242 | AtlasDatabaseUser: 243 | Type: MongoDB::Atlas::DatabaseUser 244 | Properties: 245 | ProjectId: !GetAtt "AtlasProject.Id" 246 | Profile: !Ref "Profile" 247 | Username: !Ref "DatabaseUserName" 248 | Password: !Ref "DatabasePassword" 249 | DatabaseName: "admin" 250 | Roles: 251 | - RoleName: "readWrite" 252 | DatabaseName: !Ref "DatabaseUserRoleDatabaseName" 253 | Scopes: 254 | - Name: !Ref "InstanceName" 255 | Type: "CLUSTER" 256 | Outputs: 257 | AtlasIAMRole: 258 | Description: "ARN for AWS IAM Role database cluster access" 259 | Value: !GetAtt "AtlasIAMRole.Arn" 260 | Export: 261 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasIAMRoleARN" ] ] 262 | AtlasDatabaseUser: 263 | Description: "Atlas database user, configured for AWS IAM Role access." 264 | Value: !Ref AtlasDatabaseUser 265 | Export: 266 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasDatabaseUser" ] ] 267 | AtlasProject: 268 | Description: "Info on your Atlas deployment" 269 | Value: !Ref AtlasProject 270 | Export: 271 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectId" ] ] 272 | AtlasProjectIPAccessList: 273 | Description: "Atlas project ip access list" 274 | Value: !Ref AtlasProjectIPAccessList 275 | Export: 276 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasProjectIPAccessList" ] ] 277 | AtlasCluster: 278 | Condition: CreateCluster 279 | Description: "Info on your Atlas Cluster" 280 | Value: !Ref AtlasCluster 281 | Export: 282 | Name: !Join [ "-", [ !Ref "AWS::StackName","AtlasCluster" ] ] 283 | ClusterState: 284 | Condition: CreateCluster 285 | Description: "Cluster State" 286 | Value: !GetAtt "AtlasCluster.StateName" 287 | Export: 288 | Name: !Join [ "-", [ !Ref "AWS::StackName","ClusterState" ] ] 289 | ClusterSrvAddress: 290 | Condition: CreateCluster 291 | Description: "Hostname for mongodb+srv:// connection string" 292 | Value: !GetAtt "AtlasCluster.ConnectionStrings.StandardSrv" 293 | Export: 294 | Name: !Join [ "-", [ !Ref "AWS::StackName","ClusterSrvAddress" ] ] 295 | ServerlessConnectionStr: 296 | Condition: CreateServerless 297 | Description: "Id of the Serverless Instances" 298 | Value: !GetAtt "AtlasServerlessInstance.ConnectionStrings.StandardSrv" --------------------------------------------------------------------------------