This repo contains several modules that together ared used to run a production-ready MongoDB cluster.
⚠️ IMPORTANT UPDATE: THIS REPO IS CURRENTLY ON HOLD.⚠️
As of November, 2019, we are putting this repo on hold and will not be investing in further improvements to it. This
is because:
Maintaining the code for a complicated, distributed, sharded, stateful system like MongoDB is very time consuming.
We've had very little customer usage / interest in a self-managed MongoDB offering, so it does not make sense to
continue to make a large investment in it.
Therefore, for the time being, if you need to use MongoDB, we strongly recommend using one of the following
alternatives:
MongoDB Atlas: Deploy fully managed MongoDB across AWS, Azure, or GCP. This
is the official service from the creators of MongoDB.
mLab: Database-as-a-Service for MongoDB. Note that mLab has been acquired by MongoDB and may be
integrated into Atlas in the future.
mongodb-cluster - Terraform code to deploy a cluster of mongod, mongos, or Mongo Config
servers in an Auto Scaling Group.
mongodb-backup - Terraform code to create an S3 Bucket, IAM Policy, and CloudWatch alarm
used to setup backup for a MongoDB cluster.
Bash Script Modules
setup-ec2-instance - Bash scripts that attach an EBS Volume and Elastic Network Interface
so that a Mongo node can mount a data volume on a separate EBS Volume and have a static private IP address.
install-mongodb - Bash script that runs during a Packer build that installs MongoDB, Supervisord,
and OS optimizations recommended for Mongo.
run-mongodb - Bash script that runs in EC2 User Data
that generates the configuration files for MongoDB and supervisord.
backup-mongodb - This module runs mongodump, uploads the file to S3, and notifies a CloudWatch alarm it's working.
What is a module?
At Gruntwork, we've taken the thousands of hours we spent building infrastructure on AWS and
condensed all that experience and code into pre-built packages or modules. Each module is a battle-tested,
best-practices definition of a piece of infrastructure, such as a VPC, ECS cluster, or an Auto Scaling Group. Modules
are versioned using Semantic Versioning to allow Gruntwork clients to keep up to date with the
latest infrastructure best practices in a systematic way.
To use a module in your Terraform templates, create a module resource and set its source field to the Git URL of
this repo. You should also set the ref parameter so you're fixed to a specific version of this repo, as the master
branch may have backwards incompatible changes (see module
sources).
For example, to use v1.0.8 of the mongodb module, you would add the following:
module"mongodb" {
source = "git::git@github.com:gruntwork-io/package-mongodb.git//modules/mongodb?ref=v1.0.8"// set the parameters for the MongoDB module
}
Note: the double slash (//) is intentional and required. It's part of Terraform's Git syntax (see module
sources).
See the module's documentation and vars.tf file for all the parameters you can set. Run terraform get -update to
pull the latest version of this module from this repo before runnin gthe standard terraform plan and
terraform apply commands.
Using scripts & binaries
You can install the scripts and binaries in the modules folder of any repo using the Gruntwork
Installer. For example, if the scripts you want to install are
in the modules/mongodb-scripts folder of the https://github.com/gruntwork-io/package-mongodb repo, you could install them
as follows:
See the docs for each script & binary for detailed instructions on how to use them.
Developing a module
Versioning
We are following the principles of Semantic Versioning. During initial development, the major
version is to 0 (e.g., 0.x.y), which indicates the code does not yet have a stable API. Once we hit 1.0.0, we will
follow these rules:
Increment the patch version for backwards-compatible bug fixes (e.g., v1.0.8 -> v1.0.9).
Increment the minor version for new features that are backwards-compatible (e.g., v1.0.8 -> v1.1.0).
Increment the major version for any backwards-incompatible changes (e.g. v1.0.8 -> v2.0.0).
The version is defined using Git tags. Use GitHub to create a release, which will have the effect of adding a git tag.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"6d4d3bdc7870375ecc99f4f0ba5ffc2bce11f23c"}]},{"name":".gitignore","path":".gitignore","sha":"32845458602b36a63610885e236aecaf5d0cfb98"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"4be01a6334d39aa5bf6abe6baae701f5e2a8c5ac"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.md","path":"README.md","sha":"7c75d82dc78347dc782c2de14fa7c0e2c45f0f56","toggled":true},{"name":"_docs","children":[{"name":"Backup and Restore.md","path":"_docs/Backup and Restore.md","sha":"22cda43eb88ac930a2f5f9aad38ec405ba864428"},{"name":"Best Practices.md","path":"_docs/Best Practices.md","sha":"bb4f29e5974e2c17ce9b2487e02abba7e6ff5d56"},{"name":"Cluster Architecture and Design.md","path":"_docs/Cluster Architecture and Design.md","sha":"687d97b994a419b1e37b3a468a98bf38c9f01697"},{"name":"Gotchas.md","path":"_docs/Gotchas.md","sha":"39f7a49b558326c95c2a14dfa1aa19323c65bbf6"},{"name":"Setup a Cluster.md","path":"_docs/Setup a Cluster.md","sha":"98b2f5258bbacfd1d606cd66f44d32766fbdeb7e"}]},{"name":"examples","children":[{"name":"empty-cluster-test","children":[{"name":"README.md","path":"examples/empty-cluster-test/README.md","sha":"3405f2b25f0d80d80e69ee3c94ab84e704a18d1d"},{"name":"main.tf","path":"examples/empty-cluster-test/main.tf","sha":"3039577ff72ea219c1c9b672067fba809e11fe16"},{"name":"vars.tf","path":"examples/empty-cluster-test/vars.tf","sha":"1fe45398b3a22cbb1e0c432b91b519ee03990bd9"}]},{"name":"mongodb-ami","children":[{"name":"README.md","path":"examples/mongodb-ami/README.md","sha":"fb155ad2ef28d8b59c30a0a56f08dafc5934aa4d"},{"name":"files","children":[{"name":"mongodb.gpg","path":"examples/mongodb-ami/files/mongodb.gpg","sha":"1d681f820678e1e035ccf9a540b87e72afece678"},{"name":"mongodb.repo","path":"examples/mongodb-ami/files/mongodb.repo","sha":"29c8fb6b615b32cbf6fc41815e89d9f421983dcc"},{"name":"tls","children":[{"name":"README.md","path":"examples/mongodb-ami/files/tls/README.md","sha":"fc34588224aec934e1c55f2092715a2afc00ebd8"},{"name":"sample.ca.cert.pem","path":"examples/mongodb-ami/files/tls/sample.ca.cert.pem","sha":"8648019774aaea8bc490cea7a5a4ebc01fe90630"},{"name":"sample.key.pem","path":"examples/mongodb-ami/files/tls/sample.key.pem","sha":"f8c5c5f3b4eb969d87e5497adbdb7e8234f7a40d"}]}]},{"name":"mongodb.json","path":"examples/mongodb-ami/mongodb.json","sha":"55c5edce1a73677878be98a55de5d8b201ade070"}]},{"name":"mongodb-replica-set-cluster-with-backup","children":[{"name":"README.md","path":"examples/mongodb-replica-set-cluster-with-backup/README.md","sha":"eb3df05ad870b167a0c13a2df0c2062818d962b8"},{"name":"main.tf","path":"examples/mongodb-replica-set-cluster-with-backup/main.tf","sha":"7b0bb3f4dfe89e22e96ec9d75f0c935549973025"},{"name":"outputs.tf","path":"examples/mongodb-replica-set-cluster-with-backup/outputs.tf","sha":"b806f530f37ff6d44e47035efeef49a3f51a07e4"},{"name":"user-data","children":[{"name":"user-data-mongod-backup-node.sh","path":"examples/mongodb-replica-set-cluster-with-backup/user-data/user-data-mongod-backup-node.sh","sha":"48a4be7cf137c2e40426552be8e399c38f2f31b2"},{"name":"user-data-mongod.sh","path":"examples/mongodb-replica-set-cluster-with-backup/user-data/user-data-mongod.sh","sha":"37bcc2313f27b26e69bcad4b13af7f286faa07bf"}]},{"name":"vars.tf","path":"examples/mongodb-replica-set-cluster-with-backup/vars.tf","sha":"6f533b540c1d28d8e31428c2d30e9221dc49bb43"}]},{"name":"mongodb-sharded-cluster","children":[{"name":"README.md","path":"examples/mongodb-sharded-cluster/README.md","sha":"d0d6328765ea1bce6e914426b8927ecdc4d58979"},{"name":"main.tf","path":"examples/mongodb-sharded-cluster/main.tf","sha":"4a9bf3697b5808369693513c16761a83e9cacf1c"},{"name":"outputs.tf","path":"examples/mongodb-sharded-cluster/outputs.tf","sha":"1724634b121aa5a970e2b86e195e1d72bb291d03"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/mongodb-sharded-cluster/user-data/user-data.sh","sha":"29c2c548baf4341c220c6b42ba5199305f435e25"}]},{"name":"vars.tf","path":"examples/mongodb-sharded-cluster/vars.tf","sha":"bb4859b505f40b9f7d32865a231f674315758c46"}]},{"name":"mongodb-single-instance","children":[{"name":"README.md","path":"examples/mongodb-single-instance/README.md","sha":"161586396ea73da2ebdd5429f299d21cd58f87c6"},{"name":"main.tf","path":"examples/mongodb-single-instance/main.tf","sha":"fe795bb5665c84354435cd471a3a86d8d284ecac"},{"name":"outputs.tf","path":"examples/mongodb-single-instance/outputs.tf","sha":"0c204ee0280ee5e266a59f1fe45b3106e10c5094"},{"name":"user-data","children":[{"name":"user-data.sh","path":"examples/mongodb-single-instance/user-data/user-data.sh","sha":"f51c5b0d3c5180e885b0fba70030ac1453bf8a34"}]},{"name":"vars.tf","path":"examples/mongodb-single-instance/vars.tf","sha":"8b8411c1f9eae13a196645affa55c1a534a3f2f0"}]}]},{"name":"modules","children":[{"name":"backup-mongodb","children":[{"name":"README.md","path":"modules/backup-mongodb/README.md","sha":"807822fff41ac3767cae75f0917e1065d155d455"},{"name":"bin","children":[{"name":"backup-mongodb","path":"modules/backup-mongodb/bin/backup-mongodb","sha":"c86aa92f158f11dcf09d7b7f059123c295214bd8"}]},{"name":"install.sh","path":"modules/backup-mongodb/install.sh","sha":"5b5d58d45a914f252975c637627fb697b8e1f946"}]},{"name":"init-mongodb","children":[{"name":"README.md","path":"modules/init-mongodb/README.md","sha":"a1f9550b7609ca79bab4e7557bbbbe4ca2c10ece"},{"name":"bin","children":[{"name":"add-hidden-node","path":"modules/init-mongodb/bin/add-hidden-node","sha":"7d65492eb998974a8e12290d4e44c0d0d440c141"},{"name":"assert-cluster-ready","path":"modules/init-mongodb/bin/assert-cluster-ready","sha":"0c33101dea86592b7d71b406b1f9170117f04d2a"},{"name":"create-user","path":"modules/init-mongodb/bin/create-user","sha":"b6867a6a1e97a287ed2a59bfde2681ade7ae174a"},{"name":"init-replica-set","path":"modules/init-mongodb/bin/init-replica-set","sha":"3acca9a2a5ddff97fa62ffbabae53bd0961d72f5"}]},{"name":"install.sh","path":"modules/init-mongodb/install.sh","sha":"539b5d9b6eccf942fff14849a25c0e9ac9718983"}]},{"name":"install-mongodb","children":[{"name":"README.md","path":"modules/install-mongodb/README.md","sha":"992358d6e8e49530ed0d350398ff2fc236207e00"},{"name":"bin","children":[{"name":"install-mongodb","path":"modules/install-mongodb/bin/install-mongodb","sha":"61a241368bf4145341704a14bab0f1cc89b1c26f"}]},{"name":"files","children":[{"name":"supervisor-initd-script.sh","path":"modules/install-mongodb/files/supervisor-initd-script.sh","sha":"171b91613e98ab2bd10282025caff1707918c95a"},{"name":"supervisord.conf","path":"modules/install-mongodb/files/supervisord.conf","sha":"156eecf98d3bc37d390de5035c873ca0aa40aced"}]},{"name":"install.sh","path":"modules/install-mongodb/install.sh","sha":"159444b40aa70c8de0134405039d4e03616e901c"}]},{"name":"mongodb-backup","children":[{"name":"README.md","path":"modules/mongodb-backup/README.md","sha":"e438df72516e29e8b45c0454fc5c7a9d4943e41e"},{"name":"main.tf","path":"modules/mongodb-backup/main.tf","sha":"045729151906b532103939eb6b3992c09864ae28"},{"name":"vars.tf","path":"modules/mongodb-backup/vars.tf","sha":"8b492c54c4a5819446835fe4f8d8fec38ce04440"}]},{"name":"mongodb-cluster","children":[{"name":"README.md","path":"modules/mongodb-cluster/README.md","sha":"a8dfd88cde9517d4d680075aaefc684906bfa58e"},{"name":"main.tf","path":"modules/mongodb-cluster/main.tf","sha":"d4974c8ecae4d8c177c45f9f7adc39497f007d02"},{"name":"outputs.tf","path":"modules/mongodb-cluster/outputs.tf","sha":"8fecb95b45a8e65e0024e31032dbc341a639f569"},{"name":"user-data","children":[{"name":"default-user-data.sh","path":"modules/mongodb-cluster/user-data/default-user-data.sh","sha":"9640839c6b8f8d7458f2cf159ec0450555dcc56a"}]},{"name":"vars.tf","path":"modules/mongodb-cluster/vars.tf","sha":"7c2463df5cf3781e91499e66d6c56ce858b3cb7b"}]},{"name":"run-mongodb","children":[{"name":"README.md","path":"modules/run-mongodb/README.md","sha":"2840a280a4fae0852c62e3d4bd1057c00c1cefed"},{"name":"bin","children":[{"name":"run-mongodb","path":"modules/run-mongodb/bin/run-mongodb","sha":"b8507ab91cc09d821c9de91d674a51750897d46b"}]},{"name":"install.sh","path":"modules/run-mongodb/install.sh","sha":"30319b01091300027f9e0892640704bff75063d2"}]},{"name":"setup-ec2-instance","children":[{"name":"README.md","path":"modules/setup-ec2-instance/README.md","sha":"d0fa2a03eac9f78fb674e30da8feaa2fcb413dda"},{"name":"bin","children":[{"name":"attach-ebs-volume","path":"modules/setup-ec2-instance/bin/attach-ebs-volume","sha":"08b9a5eb1a290437c304cda253dada75f9c7dba4"},{"name":"attach-eni","path":"modules/setup-ec2-instance/bin/attach-eni","sha":"39b9477a942425d94815895f66742549a4ab82b6"}]},{"name":"install.sh","path":"modules/setup-ec2-instance/install.sh","sha":"e9c4424f8c889e091c2be1136aab93e0d2c196bf"}]}]},{"name":"test","children":[{"name":"Gopkg.lock","path":"test/Gopkg.lock","sha":"c0a3e932f876c4d6fc932ac331743e3d721110dc"},{"name":"Gopkg.toml","path":"test/Gopkg.toml","sha":"043708efb2b6452474a0b7e453c194af93151cca"},{"name":"empty_cluster_example_test.go","path":"test/empty_cluster_example_test.go","sha":"a5de28a0543cef5a0aabb12d92742ed7c1e82e9c"},{"name":"helpers_aws.go","path":"test/helpers_aws.go","sha":"7d964cdaf0902f227e60255d2f25cf91d5ce3451"},{"name":"helpers_file.go","path":"test/helpers_file.go","sha":"139b02762a330ef5714823d7d89938039ac9d858"},{"name":"helpers_mongo.go","path":"test/helpers_mongo.go","sha":"447d5a6b1622b42eadc26c1201abefac3b730c46"},{"name":"helpers_tls.go","path":"test/helpers_tls.go","sha":"7ff58dd6b69f674b4f873a47a88a1a3c28e85a39"},{"name":"mongo_replica_set_with_backup_test.go","path":"test/mongo_replica_set_with_backup_test.go","sha":"8a5bbec42d2a2a8b29608c52060e78c6435f6803"},{"name":"mongo_sharded_cluster_test.go","path":"test/mongo_sharded_cluster_test.go","sha":"ac8986d1e71880f4b9016f9580193ba2449d52dd"},{"name":"mongodb_single_instance_test.go","path":"test/mongodb_single_instance_test.go","sha":"ef569feab3d2bc7c4492372e876307d5a2056e7c"},{"name":"packer_options.go","path":"test/packer_options.go","sha":"ad839abcac59b0cffd1f14d4c5708f200b5eb6d4"},{"name":"terratest_options.go","path":"test/terratest_options.go","sha":"bc7387b84ef2bb349b02d2b77abab271f0be89b3"}]}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"mongo-db-infrastrucutre-package\">MongoDB Infrastrucutre Package</h1><div class=\"preview__body--border\"></div><p>This repo contains several modules that together ared used to run a production-ready MongoDB cluster.</p>\n<p><strong>⚠️ IMPORTANT UPDATE: THIS REPO IS CURRENTLY ON HOLD.⚠️</strong></p>\n<p>As of November, 2019, we are putting this repo on hold and will not be investing in further improvements to it. This\nis because:</p>\n<ol>\n<li>Maintaining the code for a complicated, distributed, sharded, stateful system like MongoDB is very time consuming.</li>\n<li>We've had very little customer usage / interest in a self-managed MongoDB offering, so it does not make sense to\ncontinue to make a large investment in it.</li>\n</ol>\n<p>Therefore, for the time being, if you need to use MongoDB, we strongly recommend using one of the following\nalternatives:</p>\n<ol>\n<li><a href=\"https://www.mongodb.com/cloud/atlas\" class=\"preview__body--description--blue\" target=\"_blank\">MongoDB Atlas</a>: Deploy fully managed MongoDB across AWS, Azure, or GCP. This\nis the official service from the creators of MongoDB.</li>\n<li><a href=\"https://mlab.com/\" class=\"preview__body--description--blue\" target=\"_blank\">mLab</a>: Database-as-a-Service for MongoDB. Note that mLab has been acquired by MongoDB and may be\nintegrated into Atlas in the future.</li>\n<li><a href=\"https://aws.amazon.com/documentdb/\" class=\"preview__body--description--blue\" target=\"_blank\">Amazon DocumentDB</a>: A MongoDB-compatible managed database from AWS.</li>\n</ol>\n<p>If you have questions or concerns, please contact us at <a href=\"mailto:support@gruntwork.io\" class=\"preview__body--description--blue\" target=\"_blank\">support@gruntwork.io</a>.</p>\n<h3 class=\"preview__body--subtitle\" id=\"terraform-modules\">Terraform Modules</h3>\n<ul>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/mongodb-cluster\" class=\"preview__body--description--blue\">mongodb-cluster</a> - Terraform code to deploy a cluster of <code>mongod</code>, <code>mongos</code>, or Mongo Config\nservers in an Auto Scaling Group.</li>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/mongodb-backup\" class=\"preview__body--description--blue\">mongodb-backup</a> - Terraform code to create an S3 Bucket, IAM Policy, and CloudWatch alarm\nused to setup backup for a MongoDB cluster.</li>\n</ul>\n<h3 class=\"preview__body--subtitle\" id=\"bash-script-modules\">Bash Script Modules</h3>\n<ul>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/setup-ec2-instance\" class=\"preview__body--description--blue\">setup-ec2-instance</a> - Bash scripts that attach an EBS Volume and Elastic Network Interface\nso that a Mongo node can mount a data volume on a separate EBS Volume and have a static private IP address.</li>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/install-mongodb\" class=\"preview__body--description--blue\">install-mongodb</a> - Bash script that runs during a Packer build that installs MongoDB, Supervisord,\nand OS optimizations recommended for Mongo.</li>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/run-mongodb\" class=\"preview__body--description--blue\">run-mongodb</a> - Bash script that runs in <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html\" class=\"preview__body--description--blue\" target=\"_blank\">EC2 User Data</a>\nthat generates the configuration files for MongoDB and supervisord.</li>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/init-mongodb\" class=\"preview__body--description--blue\">init-mongodb</a> - A set of bash scripts that run in <a href=\"http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html\" class=\"preview__body--description--blue\" target=\"_blank\">EC2 User Data</a>\nthat initialize a MongoDB <a href=\"https://docs.mongodb.com/manual/replication/\" class=\"preview__body--description--blue\" target=\"_blank\">Replica Set</a>, create a MongoDB user, and add\na <a href=\"https://docs.mongodb.com/v3.4/core/replica-set-hidden-member/\" class=\"preview__body--description--blue\" target=\"_blank\">Hidden Node</a>.</li>\n<li><a href=\"/repos/v0.4.1/package-mongodb/modules/backup-mongodb\" class=\"preview__body--description--blue\">backup-mongodb</a> - This module runs <code>mongodump</code>, uploads the file to S3, and notifies a CloudWatch alarm it's working.</li>\n</ul>\n<h2 class=\"preview__body--subtitle\" id=\"what-is-a-module\">What is a module?</h2>\n<p>At <a href=\"http://www.gruntwork.io\" class=\"preview__body--description--blue\" target=\"_blank\">Gruntwork</a>, we've taken the thousands of hours we spent building infrastructure on AWS and\ncondensed all that experience and code into pre-built <strong>packages</strong> or <strong>modules</strong>. Each module is a battle-tested,\nbest-practices definition of a piece of infrastructure, such as a VPC, ECS cluster, or an Auto Scaling Group. Modules\nare versioned using <a href=\"http://semver.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Semantic Versioning</a> to allow Gruntwork clients to keep up to date with the\nlatest infrastructure best practices in a systematic way.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-use-a-module\">How do you use a module?</h2>\n<p>Most of our modules contain either:</p>\n<ol>\n<li><a href=\"https://www.terraform.io/\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform</a> code</li>\n<li>Scripts & binaries</li>\n</ol>\n<h4 id=\"using-a-terraform-module\">Using a Terraform Module</h4>\n<p>To use a module in your Terraform templates, create a <code>module</code> resource and set its <code>source</code> field to the Git URL of\nthis repo. You should also set the <code>ref</code> parameter so you're fixed to a specific version of this repo, as the <code>master</code>\nbranch may have backwards incompatible changes (see <a href=\"https://www.terraform.io/docs/modules/sources.html\" class=\"preview__body--description--blue\" target=\"_blank\">module\nsources</a>).</p>\n<p>For example, to use <code>v1.0.8</code> of the mongodb module, you would add the following:</p>\n<pre><span class=\"hljs-keyword\">module</span> <span class=\"hljs-string\">\"mongodb\"</span> {\n source = <span class=\"hljs-string\">\"git::git@github.com:gruntwork-io/package-mongodb.git//modules/mongodb?ref=v1.0.8\"</span>\n\n <span class=\"hljs-comment\">// set the parameters for the MongoDB module</span>\n}\n</pre>\n<p><em>Note: the double slash (<code>//</code>) is intentional and required. It's part of Terraform's Git syntax (see <a href=\"https://www.terraform.io/docs/modules/sources.html\" class=\"preview__body--description--blue\" target=\"_blank\">module\nsources</a>).</em></p>\n<p>See the module's documentation and <code>vars.tf</code> file for all the parameters you can set. Run <code>terraform get -update</code> to\npull the latest version of this module from this repo before runnin gthe standard <code>terraform plan</code> and\n<code>terraform apply</code> commands.</p>\n<h4 id=\"using-scripts-binaries\">Using scripts & binaries</h4>\n<p>You can install the scripts and binaries in the <code>modules</code> folder of any repo using the <a href=\"/repos/gruntwork-installer\" class=\"preview__body--description--blue\">Gruntwork\nInstaller</a>. For example, if the scripts you want to install are\nin the <code>modules/mongodb-scripts</code> folder of the https://github.com/gruntwork-io/package-mongodb repo, you could install them\nas follows:</p>\n<pre><span class=\"hljs-string\">gruntwork-install </span><span class=\"hljs-built_in\">--module-name</span> <span class=\"hljs-string\">\"mongodb-scripts\"</span> <span class=\"hljs-built_in\">--repo</span> <span class=\"hljs-string\">\"https://github.com/gruntwork-io/package-mongodb\"</span> <span class=\"hljs-built_in\">--tag</span> <span class=\"hljs-string\">\"0.0.1\"</span>\n</pre>\n<p>See the docs for each script & binary for detailed instructions on how to use them.</p>\n<h2 class=\"preview__body--subtitle\" id=\"developing-a-module\">Developing a module</h2>\n<h4 id=\"versioning\">Versioning</h4>\n<p>We are following the principles of <a href=\"http://semver.org/\" class=\"preview__body--description--blue\" target=\"_blank\">Semantic Versioning</a>. During initial development, the major\nversion is to 0 (e.g., <code>0.x.y</code>), which indicates the code does not yet have a stable API. Once we hit <code>1.0.0</code>, we will\nfollow these rules:</p>\n<ol>\n<li>Increment the patch version for backwards-compatible bug fixes (e.g., <code>v1.0.8 -> v1.0.9</code>).</li>\n<li>Increment the minor version for new features that are backwards-compatible (e.g., <code>v1.0.8 -> v1.1.0</code>).</li>\n<li>Increment the major version for any backwards-incompatible changes (e.g. <code>v1.0.8 -> v2.0.0</code>).</li>\n</ol>\n<p>The version is defined using Git tags. Use GitHub to create a release, which will have the effect of adding a git tag.</p>\n<h4 id=\"tests\">Tests</h4>\n<p>See the <a href=\"/repos/v0.4.1/package-mongodb/test\" class=\"preview__body--description--blue\">test</a> folder for details.</p>\n<h2 class=\"preview__body--subtitle\" id=\"reference-code\">Reference code</h2>\n<ol>\n<li>Terraform - https://github.com/kenichi-shibata/IaC-mongodb</li>\n<li>Terraform - https://github.com/uniiverse/terraform-modules/tree/master/mongodb</li>\n<li>CloudFormation (terribly complicated) - https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/MongoDB-NoVPC.template</li>\n<li><a href=\"https://s3.amazonaws.com/quickstart-reference/mongodb/latest/doc/MongoDB_on_the_AWS_Cloud.pdf\" class=\"preview__body--description--blue\" target=\"_blank\">MongoDB on AWS - Quick start reference deployment</a></li>\n</ol>\n<h2 class=\"preview__body--subtitle\" id=\"license\">License</h2>\n<p>Please see <a href=\"/repos/v0.4.1/package-mongodb/LICENSE.txt\" class=\"preview__body--description--blue\">LICENSE.txt</a> for details on how the code in this repo is licensed.</p>\n<h2 class=\"preview__body--subtitle\" id=\"to-do\">ToDo</h2>\n<ol>\n<li>Address MongoDB monitoring best practices</li>\n<li>Consider requiring Mongo client certs for authentication via mutual TLS per https://docs.mongodb.com/manual/tutorial/configure-ssl-clients/</li>\n<li>Contemplate in further depth the <a href=\"https://docs.mongodb.com/manual/reference/configuration-options/#security-options\" class=\"preview__body--description--blue\" target=\"_blank\">security</a> options in\n<code>mongod.conf</code></li>\n</ol>\n","repoName":"package-mongodb","repoRef":"v0.4.1","serviceDescriptor":{"serviceName":"MongoDB","serviceRepoName":"package-mongodb","serviceRepoOrg":"gruntwork-io","cloudProviders":["aws"],"description":"Deploy a MongoDB cluster. Supports replica sets, sharding, automated bootstrapping, backup, recovery, and OS optimizations.","imageUrl":"mongodb.png","licenseType":"subscriber","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"NoSQL","fileName":"README.md","filePath":"","title":"Repo Browser: MongoDB","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}