{"id":48026261,"url":"https://github.com/binbashar/terraform-aws-rds-export-to-s3","last_synced_at":"2026-04-04T13:50:35.006Z","repository":{"id":42503109,"uuid":"397645782","full_name":"binbashar/terraform-aws-rds-export-to-s3","owner":"binbashar","description":"Terraform module that deploys Lambda functions to trigger exports of RDS snapshots to S3","archived":false,"fork":false,"pushed_at":"2024-02-07T19:51:13.000Z","size":1050,"stargazers_count":22,"open_issues_count":5,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-04-04T00:12:15.616Z","etag":null,"topics":["bb-le-mod-terraform","binbash-terraform","terraform"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/binbashar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":"binbashar"}},"created_at":"2021-08-18T15:15:43.000Z","updated_at":"2026-03-29T00:10:24.000Z","dependencies_parsed_at":"2024-02-07T20:42:43.531Z","dependency_job_id":"36dafb26-ee54-4fb0-87db-443453dce956","html_url":"https://github.com/binbashar/terraform-aws-rds-export-to-s3","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/binbashar/terraform-aws-rds-export-to-s3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbashar%2Fterraform-aws-rds-export-to-s3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbashar%2Fterraform-aws-rds-export-to-s3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbashar%2Fterraform-aws-rds-export-to-s3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbashar%2Fterraform-aws-rds-export-to-s3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binbashar","download_url":"https://codeload.github.com/binbashar/terraform-aws-rds-export-to-s3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binbashar%2Fterraform-aws-rds-export-to-s3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bb-le-mod-terraform","binbash-terraform","terraform"],"created_at":"2026-04-04T13:50:33.995Z","updated_at":"2026-04-04T13:50:34.917Z","avatar_url":"https://github.com/binbashar.png","language":"HCL","funding_links":["https://github.com/sponsors/binbashar"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/binbashar\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/binbashar/le-ref-architecture-doc/master/docs/assets/images/logos/binbash-leverage-banner.png\" width=\"1032\" align=\"left\" alt=\"Binbash\"/\u003e\n\u003c/a\u003e\n\u003cbr clear=\"left\"/\u003e\n\n# Terraform Module: RDS Snapshots Export To S3\n\n## Brief\nTerraform module that deploys Lambda functions that take care of triggering and monitoring exports of RDS snapshots to S3.\n\n## Design\nA Lambda function takes care of triggering the RDS Start Export Task for the given database name. The snapshots will be exported to the given S3 bucket.\n\nAnother Lambda function is only interested in RDS Export Task events that match a given database name. Whenever a match is detected, a message will be published in the given SNS topic which you can use to trigger other components. E.g. a Lambda function that sends notifications to Slack.\n\nA single CloudWatch Event Rule takes care of listening for RDS Snapshots Events in order to call the aforementioned Lambda functions.\n\n\u003cdiv align=\"left\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/binbashar/terraform-aws-rds-export-to-s3/master/assets/rds-export-to-s3.png\" alt=\"leverage\" width=\"400\"/\u003e\n\u003c/div\u003e\n\n## Important considerations\n* Please note, that only customer managed keys (CMK) are allowed.\n* Either `customer_kms_key_arn` provided key is used for exported snapshots encryption or new CMK created with `create_customer_kms_key` enabled\n* Since the module (optionally) creates its own KMS CMK, keep that in mind regarding KMS pricing; not only regarding the pricing of a single key, but also things like key rotations/versions and KMS API requests.\n* The module requires you to provide the S3 bucket that will be used for storing the exported snapshots. The good thing about this is that you are able to configure the bucket in any way you need. E.g. replication, lifecycle, locking, and so on.\n* The module can create an export monitor SNS notification topic, also existing SNS topics are supported via `notifications_topic_arn` variable.\n* Multi-region support via terraform providers.\n* If triggering from manual snapshots, the snapshot must be named as `rds-\u003cdatabase-name\u003e-\u003ctimestamp\u003e` with timestamp of format eg '2023-08-09-18-07'.\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_aws\"\u003e\u003c/a\u003e [aws](#requirement\\_aws) | \u003e= 3.19 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_aws\"\u003e\u003c/a\u003e [aws](#provider\\_aws) | \u003e= 3.19 |\n\n## Modules\n\n| Name | Source | Version |\n|------|--------|---------|\n| \u003ca name=\"module_monitor_export_task_lambda\"\u003e\u003c/a\u003e [monitor\\_export\\_task\\_lambda](#module\\_monitor\\_export\\_task\\_lambda) | github.com/terraform-aws-modules/terraform-aws-lambda | v2.23.0 |\n| \u003ca name=\"module_start_export_task_lambda\"\u003e\u003c/a\u003e [start\\_export\\_task\\_lambda](#module\\_start\\_export\\_task\\_lambda) | github.com/terraform-aws-modules/terraform-aws-lambda | v2.23.0 |\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [aws_cloudwatch_event_rule.rdsSnapshotCreation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource |\n| [aws_cloudwatch_event_target.rdsSnapshotCreationTopic](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource |\n| [aws_iam_policy.rdsMonitorExportTaskLambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |\n| [aws_iam_policy.rdsStartExportTaskLambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |\n| [aws_iam_role.rdsSnapshotExportTask](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |\n| [aws_iam_role_policy.rdsSnapshotExportToS3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource |\n| [aws_kms_alias.snapshotExportEncryptionKey](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource |\n| [aws_kms_key.snapshotExportEncryptionKey](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource |\n| [aws_lambda_permission.snsCanTriggerMonitorExportTask](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |\n| [aws_lambda_permission.snsCanTriggerStartExportTask](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource |\n| [aws_sns_topic.exportMonitorNotifications](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |\n| [aws_sns_topic.rdsSnapshotsEvents](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource |\n| [aws_sns_topic_policy.default](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_policy) | resource |\n| [aws_sns_topic_subscription.lambdaRdsSnapshotToS3Exporter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource |\n| [aws_sns_topic_subscription.lambdaRdsSnapshotToS3Monitor](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource |\n| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |\n| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_create_customer_kms_key\"\u003e\u003c/a\u003e [create\\_customer\\_kms\\_key](#input\\_create\\_customer\\_kms\\_key) | Create customer managed KMS key which is used for encrypting the exported snapshots on S3. If set to 'false', then 'customer\\_kms\\_key\\_arn' is used. | `bool` | `false` | no |\n| \u003ca name=\"input_create_notifications_topic\"\u003e\u003c/a\u003e [create\\_notifications\\_topic](#input\\_create\\_notifications\\_topic) | Create new SNS notifications topic which will be used for publishing notifications messages. | `bool` | `true` | no |\n| \u003ca name=\"input_customer_kms_key_arn\"\u003e\u003c/a\u003e [customer\\_kms\\_key\\_arn](#input\\_customer\\_kms\\_key\\_arn) | The ARN of customer managed key used for RDS export encryption. Mandatory if 'create\\_customer\\_kms\\_key' is set to false. arn:aws:kms:\u003cregion\u003e:\u003caccountID\u003e:key/\u003ckey-id\u003e | `string` | `null` | no |\n| \u003ca name=\"input_database_names\"\u003e\u003c/a\u003e [database\\_names](#input\\_database\\_names) | The names of the databases whose snapshots we want to export to S3. Comma-separated values), ex: 'db-cluster1, db-cluster2' | `string` | `null` | yes |\n| \u003ca name=\"input_log_level\"\u003e\u003c/a\u003e [log\\_level](#input\\_log\\_level) | The log level of the Lambda function. | `string` | `\"INFO\"` | no |\n| \u003ca name=\"input_notifications_topic_arn\"\u003e\u003c/a\u003e [notifications\\_topic\\_arn](#input\\_notifications\\_topic\\_arn) | The ARN of an SNS Topic which will be used for publishing notifications messages. Required if 'create\\_notifications\\_topic' is set to 'false'. | `string` | `null` | no |\n| \u003ca name=\"input_postfix\"\u003e\u003c/a\u003e [postfix](#input\\_postfix) | Postfix that will be used for naming resources. 'resouce-name-\u003cpostfix\u003e'. | `string` | `null` | no |\n| \u003ca name=\"input_prefix\"\u003e\u003c/a\u003e [prefix](#input\\_prefix) | Prefix that will be used for naming resources. '\u003cprefix\u003eresouce-name'. | `string` | `null` | no |\n| \u003ca name=\"input_rds_event_ids\"\u003e\u003c/a\u003e [rds\\_event\\_ids](#input\\_rds\\_event\\_ids) | RDS (CloudWatch) Event ID that will trigger the calling of RDS Start Export Task API:\u003cbr\u003e- Automated snapshots of Aurora RDS: RDS-EVENT-0169\u003cbr\u003e- Manual snapshots of Aurora RDS: RDS-EVENT-0075\u003cbr\u003e- Automated snapshots of non-Aurora RDS: RDS-EVENT-0091\u003cbr\u003e- Manual snapshots of non-Aurora RDS: RDS-EVENT-0042\u003cbr\u003eAutomated and/or manual backups of either RDS Aurora and RDS non-Aurora are supported.\u003cbr\u003eRef: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Messages.html#USER_Events.Messages.snapshot\u003cbr\u003eRef: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Events.Messages.html#USER_Events.Messages.cluster-snapshot | `string` | `\"RDS-EVENT-0091, RDS-EVENT-0169\"` | no |\n| \u003ca name=\"input_snapshots_bucket_name\"\u003e\u003c/a\u003e [snapshots\\_bucket\\_name](#input\\_snapshots\\_bucket\\_name) | The name of the bucket where the RDS snapshots will be exported to. | `string` | `null` | yes |\n| \u003ca name=\"input_snapshots_bucket_prefix\"\u003e\u003c/a\u003e [snapshots\\_bucket\\_prefix](#input\\_snapshots\\_bucket\\_prefix) | The Amazon S3 bucket prefix to use as the file name and path of the exported snapshot. For example, use the prefix exports/2019/ | `string` | `null` | yes |\n| \u003ca name=\"input_tags\"\u003e\u003c/a\u003e [tags](#input\\_tags) | (Optional) A mapping of tags to assign to the bucket. | `map(string)` | `{}` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_monitor_export_task_lambda_function_arn\"\u003e\u003c/a\u003e [monitor\\_export\\_task\\_lambda\\_function\\_arn](#output\\_monitor\\_export\\_task\\_lambda\\_function\\_arn) | Start Export Task Monitor Lambda Function ARN |\n| \u003ca name=\"output_monitor_export_task_lambda_role_arn\"\u003e\u003c/a\u003e [monitor\\_export\\_task\\_lambda\\_role\\_arn](#output\\_monitor\\_export\\_task\\_lambda\\_role\\_arn) | Start Export Task Monitor Lambda Role ARN |\n| \u003ca name=\"output_snapshots_events_export_monitor_sns_topics_arn\"\u003e\u003c/a\u003e [snapshots\\_events\\_export\\_monitor\\_sns\\_topics\\_arn](#output\\_snapshots\\_events\\_export\\_monitor\\_sns\\_topics\\_arn) | RDS Snapshots Export Monitor Events SNS Topics ARN |\n| \u003ca name=\"output_snapshots_events_sns_topics_arn\"\u003e\u003c/a\u003e [snapshots\\_events\\_sns\\_topics\\_arn](#output\\_snapshots\\_events\\_sns\\_topics\\_arn) | RDS Snapshots Events SNS Topics ARN |\n| \u003ca name=\"output_snapshots_export_encryption_key_arn\"\u003e\u003c/a\u003e [snapshots\\_export\\_encryption\\_key\\_arn](#output\\_snapshots\\_export\\_encryption\\_key\\_arn) | Snapshots Export Encryption Key ARN |\n| \u003ca name=\"output_start_export_task_lambda_function_arn\"\u003e\u003c/a\u003e [start\\_export\\_task\\_lambda\\_function\\_arn](#output\\_start\\_export\\_task\\_lambda\\_function\\_arn) | Start Export Task Lambda Function ARN |\n| \u003ca name=\"output_start_export_task_lambda_role_arn\"\u003e\u003c/a\u003e [start\\_export\\_task\\_lambda\\_role\\_arn](#output\\_start\\_export\\_task\\_lambda\\_role\\_arn) | Start Export Task Lambda Role ARN |\n\u003c!-- END_TF_DOCS --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinbashar%2Fterraform-aws-rds-export-to-s3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinbashar%2Fterraform-aws-rds-export-to-s3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinbashar%2Fterraform-aws-rds-export-to-s3/lists"}