This folder contains the source code for each of the AWS CloudFormation MongoDB Atlas Resources.
Note these are also hosted on AWS CloudFormation Public Registry under Third Party Extensions.
All MongoDB Atlas AWS CloudFormation resources support the import operation, allowing you to bring existing Atlas resources under CloudFormation management. When importing resources, please consider the following:
-
DeletionPolicy Attribute: Your resource template must include the DeletionPolicy attribute in order to specify what happens to the resource when it is removed from the stack.
-
UPDATE Operation Required: The import operation executes the UPDATE operation behind the scenes. Therefore, UPDATE functionality must be properly implemented for the resource type to support import. For more datails on when the update is run, please see Create a stack from existing resources using the AWS Management Console or Import an existing resource into a stack using the AWS Management Console or
-
Outputs Restrictions: You cannot modify or add Outputs to the template during the import operation. However, you can add outputs after the import is complete.
For more details, refer to the official AWS Resource Import documentation.
| Badge | Meaning |
|---|---|
| GA, production ready | |
| Beta status, stable dev/testing | |
| Not fully tested | |
| Beta status, stable for dev/testing but not only for advanced use | |
| Deprecated |
- aws cli
- cfn cli
- python
- go
- bash
- atlascli (you don't need this but will make testing easier)
All apikey are injected through environment variables.
We have a helper script which can export your mongocli profile, so this makes it very easy to switch Atlas environments.
To use this, first download and install mongocli.
Next, run mongocli config and then;
$source <(./quickstart-mongodb-atlas/scripts/export-mongocli-config.py)
$env | grep ATLAS
MONGODB_ATLAS_PUBLIC_KEY=XXXXXX
MONGODB_ATLAS_PRIVATE_KEY=XXXXXX
MONGODB_ATLAS_ORG_ID=XXXXXXNote: section for project example line #145 contains an s3 bucket configuration string please edit value to S3 bucket that you require --> (SchemaHandlerPackage="s3://replace-placeholder-bucket-name-here/resources/mongodb-atlas-project.zip",)
Each resource has a folder called test with 3 items:
-
<resource_name>.sample-cfn-request.json Sample JSON template request to use for local testing with
cfn invoke -
<resource_name>.create-sample-cfn-request.sh The create-sample-cfn-request script injects parameters into the sample json template. You run this script, passing resource specific parameters, and the tooling will inject ApiKeys based upon the exported configuration from above. See each resource README for specific testing documentation.
-
<resource_name>.sample-template.yaml Sample real cloudformation template you can run with
aws cloudformation create-stackor using ../../quickstart-mongodb-atlas/scripts/launch-x-quickstart.sh See each resource README for specific testing documentation.