{"id":21639734,"url":"https://github.com/dasmeta/terraform-aws-mongodb-backup","last_synced_at":"2026-03-08T23:32:35.217Z","repository":{"id":45144372,"uuid":"407092166","full_name":"dasmeta/terraform-aws-mongodb-backup","owner":"dasmeta","description":"Terraform module to backup mongodb contents into S3 for AWS / EKS","archived":false,"fork":false,"pushed_at":"2024-12-04T08:59:23.000Z","size":117,"stargazers_count":4,"open_issues_count":7,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-11T17:01:09.851Z","etag":null,"topics":["aws","backup","kubernetes","module","mongodb","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"www.dasmeta.com","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dasmeta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-16T08:52:29.000Z","updated_at":"2024-09-05T12:45:25.000Z","dependencies_parsed_at":"2025-04-11T16:54:04.759Z","dependency_job_id":"fa19f4ac-6408-4b0b-804b-2e14f765ed13","html_url":"https://github.com/dasmeta/terraform-aws-mongodb-backup","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dasmeta/terraform-aws-mongodb-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fterraform-aws-mongodb-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fterraform-aws-mongodb-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fterraform-aws-mongodb-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fterraform-aws-mongodb-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dasmeta","download_url":"https://codeload.github.com/dasmeta/terraform-aws-mongodb-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dasmeta%2Fterraform-aws-mongodb-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271231019,"owners_count":24723030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","backup","kubernetes","module","mongodb","terraform","terraform-module"],"created_at":"2024-11-25T04:14:53.645Z","updated_at":"2026-03-08T23:32:30.188Z","avatar_url":"https://github.com/dasmeta.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nHelm chart install Terraform module to backup and restore a Mongo database.\n\n## Usage\n\n`mongodb_backup_minimal`:\n\n```hcl\n\nmodule mongodb_backup_minimal {\n    source  = \"dasmeta/mongodb-backup/aws\"\n\n    mongodb_host                    = \"localhost\"\n    mongodb_username                = \"root\"\n    mongodb_password                = \"password\"\n    cron_schedule                   = \"0 3 * * *\" # “every day at 03:00 am”\n    run_as_daemon                   = \"false\"\n    init_backup                     = \"false\"\n    backup_user_name                = \"aws-iam-user\"\n    s3_bucket                       = \"aws-s3-bucket-name\" # it suppose this bucket already creaated\n}\n\n```\n\n`mongodb_backup_connection_url`:\n\n```hcl\nmodule mongodb_backup_connection_url {\n    source  = \"dasmeta/mongodb-backup/aws\"\n\n    app_name   = \"test\"\n    mongodb_host                    = \"localhost\"\n    mongodb_uri                     = \"mongodb+srv://...\"\n    cron_schedule                   = \"*/5 * * * *\"\n    run_as_daemon                   = \"false\"\n    init_backup                     = \"false\"\n    backup_user_name                = \"backup_user\"\n    s3_bucket                       = \"mongoatlas-dev-backup\"\n}\n```\n\n`mongodb_backup_advanced`:\n\n\n```hcl\n\nmodule mongodb_backup_advanced {\n    source  = \"dasmeta/mongodb-backup/aws\"\n\n    # MongoDB config\n    mongodb_host                    = \"\"\n    mongodb_username                = \"\"\n    mongodb_password                = \"\"\n    mongodb_port                    = \"\"\n    mongodb_database                = \"\"\n    mongodb_exclude-collections     = \"\"\n\n    # Helm backup config\n    cron_schedule                   = \"\"\n    max_backups                     = \"\"\n    run_as_daemon                   = \"\"\n    init_backup                     = \"\"\n    init_restore                    = \"\"\n\n    # AWS S3 bucket config\n    backup_user_name                = \"\"\n    s3_bucket                       = \"\"\n    aws_default_region              = \"\"\n}\n\n```\n### Environment variables\n\n#### `Note: Some variables are required`\n| Environment Variables | Description                                                                                                                                                                                                                          |\n| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `mongodb_host`        | (required) This is gonna be Mongo database Host name                                                                                                                                                                                 |\n| `mongodb_port`        | (Optional) Mongo database host Port                                                                                                                                                                                                  |\n| `mongodb_uri`         | (Optional) Mongo connection uri                                                                                                                                                                                                      |\n| `mongodb_username`    | (required) Mongo database username                                                                                                                                                                                                   |\n| `mongodb_password`    | (required) Mongo database password                                                                                                                                                                                                   |\n| `aws_default_region`  | (required) Set aws default region. See [Amazon Web Services](https://console.aws.amazon.com/)                                                                                                                                        |\n| `backup_user_name`    | (required) this is the aws user name to create and provide accesses for pushing backup to S3                                                                                                                                         |\n| `s3_bucket`           | (Optional) If bucket variable is set the backups will be shipped/restored to/from Amazon S3 Bucket. `Otherwise It will be saved locally.`                                                                                            |\n| `max_backups`         | (Optional) Count of maximum backups on local machine. `Necessary if S3_BUCKET variable is not set. Default value is 30`                                                                                                              |\n| `cron_schedule`       | Please visit [CRON SCHEDULE](https://crontab.guru/) to choose your specific schedule time.                                                                                                                                           |\n| `run_as_daemon`       | in case this prop value is \"true\" the an \"Deployment\" kind (k8s  object type) will be created else wise the kind will be \"CronJob\".                                                                                                  |\n| `init_backup`         | (Optional) To make mongo backup on container startup mark value `true`. `Default is: 'false'`. If `S3_BUCKET` is set, the latest backup will be shipped to bucket. Otherwise, database will be saved on local volume.                |\n| `init_restore`        | (Optional) To make mongo restore on container startup mark value `true`. `Default is: 'false'`. If `S3_BUCKET` is set, the latest backup will be downloaded from bucket. Otherwise, database will be restored from the local volume. |\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Requirements\n\nNo requirements.\n\n## Providers\n\nNo providers.\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_mongodb_backup_s3_storage_user\"\u003e\u003c/a\u003e [mongodb\\_backup\\_s3\\_storage\\_user](#module\\_mongodb\\_backup\\_s3\\_storage\\_user) | dasmeta/modules/aws//modules/aws-iam-user | 0.36.8 |\n| \u003ca name=\"module_release\"\u003e\u003c/a\u003e [release](#module\\_release) | terraform-module/release/helm | 2.7.0 |\n\n## Resources\n\nNo resources.\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_app_name\"\u003e\u003c/a\u003e [app\\_name](#input\\_app\\_name) | Helm app/release name | `string` | `\"mongodb-backup-aws\"` | no |\n| \u003ca name=\"input_app_version\"\u003e\u003c/a\u003e [app\\_version](#input\\_app\\_version) | Helm app/release version | `string` | `\"0.1.0\"` | no |\n| \u003ca name=\"input_aws_default_region\"\u003e\u003c/a\u003e [aws\\_default\\_region](#input\\_aws\\_default\\_region) | aws-default-region. | `string` | `\"eu-central-1\"` | no |\n| \u003ca name=\"input_backup_user_name\"\u003e\u003c/a\u003e [backup\\_user\\_name](#input\\_backup\\_user\\_name) | Backup user name for s3 bucket | `string` | `\"mongodb-backup-s3-bucket\"` | no |\n| \u003ca name=\"input_create_user\"\u003e\u003c/a\u003e [create\\_user](#input\\_create\\_user) | Create User for S3 | `bool` | `true` | no |\n| \u003ca name=\"input_cron_schedule\"\u003e\u003c/a\u003e [cron\\_schedule](#input\\_cron\\_schedule) | Backup schedule, in crojob format. E.g. '3 0 * * *' | `string` | `\"3 0 * * *\"` | no |\n| \u003ca name=\"input_init_backup\"\u003e\u003c/a\u003e [init\\_backup](#input\\_init\\_backup) | If enabled scripts will do backup right on the start and then according to the schedule. | `string` | `false` | no |\n| \u003ca name=\"input_init_restore\"\u003e\u003c/a\u003e [init\\_restore](#input\\_init\\_restore) | If enabled scripts will do restore right on the start and then according to the schedule. | `string` | `false` | no |\n| \u003ca name=\"input_max_backups\"\u003e\u003c/a\u003e [max\\_backups](#input\\_max\\_backups) | Max backups' | `string` | `\"30\"` | no |\n| \u003ca name=\"input_mongodb_database\"\u003e\u003c/a\u003e [mongodb\\_database](#input\\_mongodb\\_database) | Mongodb database to be backed up. All databases will be backed up if not specified. | `string` | `\"\"` | no |\n| \u003ca name=\"input_mongodb_exclude_collections\"\u003e\u003c/a\u003e [mongodb\\_exclude\\_collections](#input\\_mongodb\\_exclude\\_collections) | Mongodb collections to be excluded from the backup. All collections will be backed up if not specified. | `string` | `\"\"` | no |\n| \u003ca name=\"input_mongodb_host\"\u003e\u003c/a\u003e [mongodb\\_host](#input\\_mongodb\\_host) | Mongodb host name backup script will be taking data from. | `string` | `\"localhost\"` | no |\n| \u003ca name=\"input_mongodb_password\"\u003e\u003c/a\u003e [mongodb\\_password](#input\\_mongodb\\_password) | Mongodb user password script will need to pull data from mongodb. | `string` | `\"\"` | no |\n| \u003ca name=\"input_mongodb_port\"\u003e\u003c/a\u003e [mongodb\\_port](#input\\_mongodb\\_port) | Mongodb user password script will need to pull data from mongodb. | `string` | `\"27017\"` | no |\n| \u003ca name=\"input_mongodb_uri\"\u003e\u003c/a\u003e [mongodb\\_uri](#input\\_mongodb\\_uri) | --uri param from mongodump docs | `string` | `\"\"` | no |\n| \u003ca name=\"input_mongodb_username\"\u003e\u003c/a\u003e [mongodb\\_username](#input\\_mongodb\\_username) | Mongodb user name script will need to pull data from mongodb. | `string` | `\"\"` | no |\n| \u003ca name=\"input_namespace\"\u003e\u003c/a\u003e [namespace](#input\\_namespace) | Helm app/release namespace | `string` | `\"default\"` | no |\n| \u003ca name=\"input_resources\"\u003e\u003c/a\u003e [resources](#input\\_resources) | Allows to set cpu/memory resources Limits/Requests for deployment/cronjob | \u003cpre\u003eobject({\u003cbr\u003e    limits = object({\u003cbr\u003e      cpu    = string\u003cbr\u003e      memory = string\u003cbr\u003e    })\u003cbr\u003e    requests = object({\u003cbr\u003e      cpu    = string\u003cbr\u003e      memory = string\u003cbr\u003e    })\u003cbr\u003e  })\u003c/pre\u003e | \u003cpre\u003e{\u003cbr\u003e  \"limits\": {\u003cbr\u003e    \"cpu\": \"300m\",\u003cbr\u003e    \"memory\": \"500Mi\"\u003cbr\u003e  },\u003cbr\u003e  \"requests\": {\u003cbr\u003e    \"cpu\": \"300m\",\u003cbr\u003e    \"memory\": \"500Mi\"\u003cbr\u003e  }\u003cbr\u003e}\u003c/pre\u003e | no |\n| \u003ca name=\"input_run_as_daemon\"\u003e\u003c/a\u003e [run\\_as\\_daemon](#input\\_run\\_as\\_daemon) | in case of true deployment will be created (as daemon) elwise kube cronJob will be created | `string` | `\"false\"` | no |\n| \u003ca name=\"input_s3_bucket\"\u003e\u003c/a\u003e [s3\\_bucket](#input\\_s3\\_bucket) | The bucket backups will be stored. | `string` | n/a | yes |\n| \u003ca name=\"input_volume_size\"\u003e\u003c/a\u003e [volume\\_size](#input\\_volume\\_size) | Size of the backup volume storage. Should be enough big to fit backup files. | `string` | `\"10Gi\"` | no |\n| \u003ca name=\"input_volume_storageClass\"\u003e\u003c/a\u003e [volume\\_storageClass](#input\\_volume\\_storageClass) | Volume strage class AWS will be claimed for. No need for fast storage as this will be used once during backup. | `string` | `\"gp2\"` | no |\n\n## Outputs\n\nNo outputs.\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmeta%2Fterraform-aws-mongodb-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdasmeta%2Fterraform-aws-mongodb-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdasmeta%2Fterraform-aws-mongodb-backup/lists"}