Amazon Aurora is a fully managed relational database engine that's compatible with MySQL and PostgreSQL. The code, tools,
and applications you use today with your existing MySQL and PostgreSQL databases can be used with Aurora. With some
workloads, Aurora can deliver up to five times the throughput of MySQL and up to three times the throughput of PostgreSQL
without requiring changes to most of your existing applications.
Cluster endpoint: The endpoint for the whole cluster. You should always use this URL for writes, as it points to
the primary.
Instance endpoints: A comma-separated list of all DB instance URLs in the cluster, including the primary and all
read replicas. Use these URLs for reads (see "How do you scale this DB?" below).
Port: The port to use to connect to the endpoints above.
You can programmatically extract these variables in your Terraform templates and pass them to other resources (e.g.
pass them to User Data in your EC2 instances). You'll also see the variables at the end of each terraform apply call
or if you run terraform output.
How do you scale this database?
Storage: Aurora manages storage for you, automatically growing cluster volume in 10GB increments up to 64TB.
Vertical scaling: To scale vertically (i.e. bigger DB instances with more CPU and RAM), use the instance_type
input variable. For a list of AWS RDS server types, see Aurora Pricing.
Horizontal scaling: To scale horizontally, you can add more replicas using the instance_count input variable,
and Aurora will automatically deploy the new instances, sync them to the master, and make them available as read
replicas.
This module allows you to configure a number of parameters, such as backup windows, maintenance window, port number,
and encryption. For a list of all available variables and their descriptions, see vars.tf.
How do you create a cross-region read replica cluster?
After creating a primary cluster, create another cluster in the secondary region and pass the cluster ARN and region of
the primary cluster:
You must first promote it to a primary cluster, then destroy it.
You can promote it via the RDS Console (Actions → Promote), or with aws rds promote-read-replica-db-cluster --db-cluster-identifier <identifier>.
After that, run terraform destroy as you normally would.
Known Issues
Requires terraform provider version 1.32 or newer due to the serverless options
DBInstance not found
As of August 29, 2017, Terraform 0.10.x has an issue where when you apply an RDS Aurora Instance for the first time, you may sometimes receive the following error:
aws_rds_cluster.cluster_with_encryption: Error modifying DB Instance aurora-test: DBInstanceNotFound: DBInstance not found: aurora-test
status code: 404, request id: 040094aa-8c62-11e7-baa6-0d7ac77494f1
This error occurs because Terraform first creates the database cluster, then creates one or more database instances, and then queries the AWS API for the IDs of those database instances. But Terraform does not wait long enough for the AWS API to propagate these instances to all AWS API endpoints, so AWS initially replies that the given database instance name was not found.
Fortunately, this issue has a simple fix. After waiting a few seconds, the AWS API will not return the database instances that we expect, so simply re-run terraform apply and the operation should complete successfully.
Limitations with Aurora Serverless
The following limitations apply to Aurora Serverless :
The port number for connections must be:
3306 for Aurora MySQL
5432 for Aurora PostgreSQL
You can't give an Aurora Serverless DB cluster a public IP address. You can access an Aurora Serverless DB cluster only from within a virtual private cloud (VPC) based on the Amazon VPC service.
A connection to an Aurora Serverless DB cluster is closed automatically if it stays open for longer than one day.
{"treedata":{"name":"root","toggled":true,"children":[{"name":".circleci","children":[{"name":"config.yml","path":".circleci/config.yml","sha":"60b7ef2fe322bff7d2184724d43f507585160638"}]},{"name":".gitignore","path":".gitignore","sha":"b221764008a74751a75f9ba58821c7e7bd7422b2"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","sha":"40dde37cbe2716be382b51fccaabc08b113a5eba"},{"name":"CODEOWNERS","path":"CODEOWNERS","sha":"f6e0666fa0dee5df6743291167734a2bcfbb359b"},{"name":"LICENSE.txt","path":"LICENSE.txt","sha":"f4e3d9bd4717a044ed31ad847a300eee74371a78"},{"name":"README.adoc","path":"README.adoc","sha":"683afbce72ea0c7b626932bd314b9c2ae992c207"},{"name":"_docs","children":[{"name":"aurora-serverless.png","path":"_docs/aurora-serverless.png","sha":"5a53145be56705c76f7f7aa6a25aa0ddee78e4a3"},{"name":"aurora.png","path":"_docs/aurora.png","sha":"fc218831bfa34097a56f1b0e47fe05521bdb4a8a"},{"name":"data-backup-architecture.png","path":"_docs/data-backup-architecture.png","sha":"fcc7ce8753e28c19af87ea5cea96e6ded648d429"},{"name":"data-backup.png","path":"_docs/data-backup.png","sha":"116b10f231073f8c52255ca98e48cc228c48a2c3"},{"name":"mariadb.png","path":"_docs/mariadb.png","sha":"d540d3d3ff8797c4a4c3a62c65e7d3f63621568f"},{"name":"mysql.png","path":"_docs/mysql.png","sha":"73b55bd0d517dcba53c878712544abf96be3a66e"},{"name":"oracle.png","path":"_docs/oracle.png","sha":"b5f1ca801f5af4a30f1b812eea17cec516c1fe6c"},{"name":"postgresql.png","path":"_docs/postgresql.png","sha":"fd9c7ec282aef38a5813e8542d92227b96bd5be8"},{"name":"rds-architecture.png","path":"_docs/rds-architecture.png","sha":"8f2b1b5b4015a5777032c6aa64627ceee24330fc"},{"name":"redshift-architecture.png","path":"_docs/redshift-architecture.png","sha":"0ebffc1b1fbecdb0335a09c6bf7fe7c5f073d16e"},{"name":"redshift-icon.png","path":"_docs/redshift-icon.png","sha":"add0f05edb29726e62c784edf428eef60aed4d5f"},{"name":"sqlserver.png","path":"_docs/sqlserver.png","sha":"a800d188398262593f4f89f27c8f3ce2ce1e76a4"}]},{"name":"examples","children":[{"name":"aurora-global-cluster","children":[{"name":"README.md","path":"examples/aurora-global-cluster/README.md","sha":"d3a56dd88490d5cdb6d990041b2c37af89df7efd"},{"name":"main.tf","path":"examples/aurora-global-cluster/main.tf","sha":"0d76b53bb8f42a72d0f8e4b6ad20b7fcdf7f9c55"},{"name":"outputs.tf","path":"examples/aurora-global-cluster/outputs.tf","sha":"105d706d41684b4c7be092ebd43bf6ba8ebf6f80"},{"name":"vars.tf","path":"examples/aurora-global-cluster/vars.tf","sha":"dd29a4429c6d25438358d85f06b998f8911a51a7"}]},{"name":"aurora-serverless","children":[{"name":"README.md","path":"examples/aurora-serverless/README.md","sha":"073a25d4190dc28f64d2e1675c30e60eb255d306"},{"name":"main.tf","path":"examples/aurora-serverless/main.tf","sha":"880f6588093e5138ad3ac3ea02d125ad4a8ec679"},{"name":"outputs.tf","path":"examples/aurora-serverless/outputs.tf","sha":"7da44a91e9ac6e14a5c7c144c60c5ad0ceb5ce1b"},{"name":"vars.tf","path":"examples/aurora-serverless/vars.tf","sha":"be0acaabd7f525d00ded7bb8ace8a3e54b03e160"}]},{"name":"aurora-with-cross-region-replica","children":[{"name":"README.md","path":"examples/aurora-with-cross-region-replica/README.md","sha":"17c93f6fc01e4df4bc8014f33773dc5f05ab8017"},{"name":"main.tf","path":"examples/aurora-with-cross-region-replica/main.tf","sha":"52e14d2cbe054e4d15d2934ac19c9d7c17db6b60"},{"name":"outputs.tf","path":"examples/aurora-with-cross-region-replica/outputs.tf","sha":"58a3862180d107c3d0501ec9b289b08ed09af3a8"},{"name":"vars.tf","path":"examples/aurora-with-cross-region-replica/vars.tf","sha":"0890cddb1b6aac72b378632e9ed131a9bd177e04"}]},{"name":"aurora","children":[{"name":"README.md","path":"examples/aurora/README.md","sha":"8190444c83829a5b7a4e9acad31414e0dced277a"},{"name":"main.tf","path":"examples/aurora/main.tf","sha":"1331727f195b7b8625e0a2f0d8fe4c0dd27e6532"},{"name":"outputs.tf","path":"examples/aurora/outputs.tf","sha":"142569b7d9772c741ee28846de617f5a4b7f0d84"},{"name":"vars.tf","path":"examples/aurora/vars.tf","sha":"e046db594a501fcb4ff0252a2ac5e187dd382ccf"}]},{"name":"efs","children":[{"name":"README.md","path":"examples/efs/README.md","sha":"5b883e1deac79fb511a39fa062bd854f2a903579"},{"name":"main.tf","path":"examples/efs/main.tf","sha":"5716f2b2a68d9951b77314827129e7939eb16e3b"},{"name":"outputs.tf","path":"examples/efs/outputs.tf","sha":"b5a6400d4a67e1e6f6773c513acaa8784ceda46b"},{"name":"vars.tf","path":"examples/efs/vars.tf","sha":"db0919b5bbfca3fee37baf1d35272ed2108d5405"}]},{"name":"lambda-rds-snapshot-multiple-schedules","children":[{"name":"README.md","path":"examples/lambda-rds-snapshot-multiple-schedules/README.md","sha":"c76bcf6ba6865fe2a9e4a7d9b47d231ae7822e47"},{"name":"main.tf","path":"examples/lambda-rds-snapshot-multiple-schedules/main.tf","sha":"345865f7854987f766a9c5eb358a424ce92bada6"},{"name":"outputs.tf","path":"examples/lambda-rds-snapshot-multiple-schedules/outputs.tf","sha":"7a8f966782c659d1568f35684197f232939ea9ec"},{"name":"vars.tf","path":"examples/lambda-rds-snapshot-multiple-schedules/vars.tf","sha":"f6ae16692c02a1ae6ed95d58e16bd3e02b98f703"}]},{"name":"lambda-rds-snapshot","children":[{"name":"README.md","path":"examples/lambda-rds-snapshot/README.md","sha":"d7422ca3a039c7e1056c17fc73fbbddfddce6741"},{"name":"main.tf","path":"examples/lambda-rds-snapshot/main.tf","sha":"74bad02c84005eeb34e9129d32e072877c68fb3f"},{"name":"outputs.tf","path":"examples/lambda-rds-snapshot/outputs.tf","sha":"375c8bb979dd4133c3675d9e6263e1138c448973"},{"name":"vars.tf","path":"examples/lambda-rds-snapshot/vars.tf","sha":"b777711ea9860aa43f766a5e5edf8b817e994885"}]},{"name":"rds-mariadb","children":[{"name":"README.md","path":"examples/rds-mariadb/README.md","sha":"6540229dddcb38071d37b6697762d27a54e28cc8"},{"name":"main.tf","path":"examples/rds-mariadb/main.tf","sha":"8e328ba024136609a176099b925ad992a2e35166"},{"name":"outputs.tf","path":"examples/rds-mariadb/outputs.tf","sha":"bd45b0035943021763d0365da3fe0d1e9f9b16b9"},{"name":"vars.tf","path":"examples/rds-mariadb/vars.tf","sha":"6a8212a3c4e8d4bbd1fe6f000bb699b9f5ecf1e0"}]},{"name":"rds-mysql-with-cross-region-replica","children":[{"name":"README.md","path":"examples/rds-mysql-with-cross-region-replica/README.md","sha":"4671d1e9a47e6179c5dc809bf27cffc3468b3460"},{"name":"main.tf","path":"examples/rds-mysql-with-cross-region-replica/main.tf","sha":"9b8dcea6fb24c86da177a7a4a723b516023849f0"},{"name":"outputs.tf","path":"examples/rds-mysql-with-cross-region-replica/outputs.tf","sha":"2d79e34b6bc52c934a62e40e38e3cdcace5196a0"},{"name":"vars.tf","path":"examples/rds-mysql-with-cross-region-replica/vars.tf","sha":"e29f844891c30bb88097a66328081dde94b2e611"}]},{"name":"rds-mysql","children":[{"name":"README.md","path":"examples/rds-mysql/README.md","sha":"6a7fb5d5560cc42ec9a6ac830358aa7ab7ca502d"},{"name":"main.tf","path":"examples/rds-mysql/main.tf","sha":"e61adacca2857baec8036350053d6da66df57797"},{"name":"outputs.tf","path":"examples/rds-mysql/outputs.tf","sha":"e2ae2afdbcc0d27baa5d50be333f9d0a717e1a33"},{"name":"vars.tf","path":"examples/rds-mysql/vars.tf","sha":"0ee52281448e95f13fcaacf427bed62600a32c23"}]},{"name":"rds-postgres","children":[{"name":"README.md","path":"examples/rds-postgres/README.md","sha":"ab4e18c200fc749a54ee700223d27261c731e436"},{"name":"main.tf","path":"examples/rds-postgres/main.tf","sha":"420d05d0b985e092cb8a99c08fc9d1ce8f1a2571"},{"name":"outputs.tf","path":"examples/rds-postgres/outputs.tf","sha":"5371c2284c0ea3d4de5790077ba45d9d445c2965"},{"name":"vars.tf","path":"examples/rds-postgres/vars.tf","sha":"0f2541c42ceef4f29fcfdc4aa8141d18b854f7f5"}]},{"name":"rds-sqlserver","children":[{"name":"README.md","path":"examples/rds-sqlserver/README.md","sha":"26bf52d347c247e5f63bc113476e87d75375ba84"},{"name":"main.tf","path":"examples/rds-sqlserver/main.tf","sha":"483ef9341b3b61137afcfefcbecaca7831a4c012"},{"name":"outputs.tf","path":"examples/rds-sqlserver/outputs.tf","sha":"a1726fd73528af38b436c053128f24a17da740c3"},{"name":"vars.tf","path":"examples/rds-sqlserver/vars.tf","sha":"dabccb3da2548b8a9e302ed5e9be01b18c275ca9"}]},{"name":"rds-with-replicas","children":[{"name":"README.md","path":"examples/rds-with-replicas/README.md","sha":"327357a98e9b2bbf650d91a207bd96fc4a6f452f"},{"name":"main.tf","path":"examples/rds-with-replicas/main.tf","sha":"fae67353ee46c05c67bc1e26e62438ec495b8689"},{"name":"outputs.tf","path":"examples/rds-with-replicas/outputs.tf","sha":"991d5436a635194fec1ad1476eb7be6616032c7a"},{"name":"vars.tf","path":"examples/rds-with-replicas/vars.tf","sha":"a1ab0eaadeaee910d4b81265ba28524917926e6c"}]},{"name":"redshift","children":[{"name":"README.md","path":"examples/redshift/README.md","sha":"bc9fb9be40c61e319a2834a87a9768312a20709d"},{"name":"main.tf","path":"examples/redshift/main.tf","sha":"dc71f38b8cc8abde4ecdb44eb2617b6bcadced6d"},{"name":"outputs.tf","path":"examples/redshift/outputs.tf","sha":"779c37290dc1c986bfd8d629cc9b2ba1d98c68aa"},{"name":"variables.tf","path":"examples/redshift/variables.tf","sha":"e89ac7c94a3aa6fd900dc5a31a17923c84091fab"}]}]},{"name":"modules","children":[{"name":"aurora","children":[{"name":"README-Aurora-Serverless.adoc","path":"modules/aurora/README-Aurora-Serverless.adoc","sha":"9029de222f9bcf675ff37d7e97b9eae29664fb34"},{"name":"README-Aurora.adoc","path":"modules/aurora/README-Aurora.adoc","sha":"89ebb7a7c5aa8632a930c34993fc6c4cebe7efb4"},{"name":"README.adoc","path":"modules/aurora/README.adoc","sha":"d0e19665bb22ad2a62968f6ae047d1685f984d80"},{"name":"core-concepts.md","path":"modules/aurora/core-concepts.md","sha":"c359faf7ca9789e73296433b9c5fdb19956fa16a","toggled":true},{"name":"main.tf","path":"modules/aurora/main.tf","sha":"98b1005c7257e160482814cf20f797c53e2cc0fc"},{"name":"outputs.tf","path":"modules/aurora/outputs.tf","sha":"f27a9f761484528ef8d6cdfc687dbb936307bf48"},{"name":"vars.tf","path":"modules/aurora/vars.tf","sha":"ce84d19d251c02b403e5392138093b6e38494192"}],"toggled":true},{"name":"efs","children":[{"name":"README.adoc","path":"modules/efs/README.adoc","sha":"165387a5ef2015a3f3a930ea3d4f1703453254bd"},{"name":"main.tf","path":"modules/efs/main.tf","sha":"fd9ede87cdc99cd362eb56de737130a9a7decc0f"},{"name":"outputs.tf","path":"modules/efs/outputs.tf","sha":"b505b3d3c4ade32e06286ebea60be1a5f67ce77a"},{"name":"vars.tf","path":"modules/efs/vars.tf","sha":"ada809d408ec9a125e372dd4f04b1b1c30e28d82"}]},{"name":"lambda-cleanup-snapshots","children":[{"name":"README.md","path":"modules/lambda-cleanup-snapshots/README.md","sha":"2c491aeca99fac0536e6c86ef850e00146ac7259"},{"name":"cleanup-rds-snapshots","children":[{"name":"index.py","path":"modules/lambda-cleanup-snapshots/cleanup-rds-snapshots/index.py","sha":"9e651d2d57310054e21d891aec481d02c9d79489"}]},{"name":"main.tf","path":"modules/lambda-cleanup-snapshots/main.tf","sha":"46a9956755b3103e5bc2659be06c8b60be2afaec"},{"name":"outputs.tf","path":"modules/lambda-cleanup-snapshots/outputs.tf","sha":"a99c0265d859dd0c87a6eba62aaf2b013e224873"},{"name":"vars.tf","path":"modules/lambda-cleanup-snapshots/vars.tf","sha":"6a8d68f55cf51d75ec84caed75ebcb2ea25a5dab"}]},{"name":"lambda-copy-shared-snapshot","children":[{"name":"README.md","path":"modules/lambda-copy-shared-snapshot/README.md","sha":"9953dc7e2429ffa95751d868b725018fedc03a4e"},{"name":"copy-shared-rds-snapshot","children":[{"name":"index.py","path":"modules/lambda-copy-shared-snapshot/copy-shared-rds-snapshot/index.py","sha":"6b1a0331ee9ffc57c95e0923a4b1db46dec0b2c5"}]},{"name":"main.tf","path":"modules/lambda-copy-shared-snapshot/main.tf","sha":"9b7d2ef277ccc9f5b799c3ff42ab4f04e393aa15"},{"name":"outputs.tf","path":"modules/lambda-copy-shared-snapshot/outputs.tf","sha":"f4833d96fa6d47190b9d2c3af243142aefc59d59"},{"name":"vars.tf","path":"modules/lambda-copy-shared-snapshot/vars.tf","sha":"167544053dc243f447befed6b576c3b515bc6d58"}]},{"name":"lambda-create-snapshot","children":[{"name":"README.adoc","path":"modules/lambda-create-snapshot/README.adoc","sha":"4c6a9c7fa49b66aeeeae492b895bb98d97ab3062"},{"name":"core-concepts.md","path":"modules/lambda-create-snapshot/core-concepts.md","sha":"3b0830d9d0af865d78d5014d4bd2d57c25eb4bf0"},{"name":"create-rds-snapshot","children":[{"name":"index.py","path":"modules/lambda-create-snapshot/create-rds-snapshot/index.py","sha":"16bc7d1b67dcee20577808cdbf39b1938972c5cb"}]},{"name":"main.tf","path":"modules/lambda-create-snapshot/main.tf","sha":"cc5fefe171ff3aff242b78b2dbb4915ba99d72c5"},{"name":"outputs.tf","path":"modules/lambda-create-snapshot/outputs.tf","sha":"a0f5ffafa8ef11d00b72f1858b81e182ab2471dd"},{"name":"vars.tf","path":"modules/lambda-create-snapshot/vars.tf","sha":"f18942d85d2e7c5dc4c629b1503a1c32a52e4b56"}]},{"name":"lambda-share-snapshot","children":[{"name":"README.md","path":"modules/lambda-share-snapshot/README.md","sha":"f00a0ab9745632e85d5f4c8e7a9389e1a8608b6b"},{"name":"main.tf","path":"modules/lambda-share-snapshot/main.tf","sha":"ad106900590efee14247858b5ca6402d7907a03c"},{"name":"outputs.tf","path":"modules/lambda-share-snapshot/outputs.tf","sha":"c0d2854f967a6c963662c660d6ae96d8cabe471a"},{"name":"share-rds-snapshot","children":[{"name":"index.py","path":"modules/lambda-share-snapshot/share-rds-snapshot/index.py","sha":"b4e784ff72172d1f3e84f0f97a48fdf60405ed27"}]},{"name":"vars.tf","path":"modules/lambda-share-snapshot/vars.tf","sha":"683571dbf98c2fb4f8077e7adadcb4df4241b9b4"}]},{"name":"rds","children":[{"name":"README-MariaDb.adoc","path":"modules/rds/README-MariaDb.adoc","sha":"52c88eedb3410b14c6ccc4db8ea3eaa484b7c13a"},{"name":"README-MySQL.adoc","path":"modules/rds/README-MySQL.adoc","sha":"75a2e92b04368988ffe7fb405a99155881f2c4f7"},{"name":"README-Oracle.adoc","path":"modules/rds/README-Oracle.adoc","sha":"a9f084cfbd084413bbcc818fd9f438a4faee367b"},{"name":"README-PostgreSQL.adoc","path":"modules/rds/README-PostgreSQL.adoc","sha":"2486401acaa724eba2f0a8814ef9dfa19c510ae0"},{"name":"README-SqlServer.adoc","path":"modules/rds/README-SqlServer.adoc","sha":"76d7220a727d84567e819102617bd01a3bda0cb2"},{"name":"README.adoc","path":"modules/rds/README.adoc","sha":"fa2c8270106116804fa8ee61a7b5885ab8a4833f"},{"name":"core-concepts.md","path":"modules/rds/core-concepts.md","sha":"29463161611168b652ba94e011604f23395cde9a"},{"name":"main.tf","path":"modules/rds/main.tf","sha":"bc6fd5f68c96bc000e8a23cfc3fad5beed2f74bf"},{"name":"outputs.tf","path":"modules/rds/outputs.tf","sha":"ffd8da9da933ee678f56befbf8ee7edcc19cd6cf"},{"name":"vars.tf","path":"modules/rds/vars.tf","sha":"0dfdf3f8002a85262536be016e4d7f8747a876af"}]},{"name":"redshift","children":[{"name":"README.adoc","path":"modules/redshift/README.adoc","sha":"529e5bdbf83cf2e696a246e13bd5b970843b2bed"},{"name":"main.tf","path":"modules/redshift/main.tf","sha":"a97c8a0cb3c0a77ace18290d83cc1b18546d9235"},{"name":"outputs.tf","path":"modules/redshift/outputs.tf","sha":"a58d5730738046153b5f73edee78cee1a0e76fd9"},{"name":"variables.tf","path":"modules/redshift/variables.tf","sha":"c781418101ea337060c5c327163d7dbcbaadcc1e"}]}],"toggled":true},{"name":"test","children":[{"name":"README.md","path":"test/README.md","sha":"ebcf2313b7664113168ca7e73d01acbd232d8f39"},{"name":"example_aurora_global_test.go","path":"test/example_aurora_global_test.go","sha":"c99915a7aeaa3f094d79223a48d8671a7013c440"},{"name":"example_aurora_test.go","path":"test/example_aurora_test.go","sha":"14485405d1f5899ca61bea11ba4b7f41d6234d6e"},{"name":"example_aurora_with_cross_region_replica_test.go","path":"test/example_aurora_with_cross_region_replica_test.go","sha":"2fe4b909abbeebfc4cddff2237d6b2470982cd8a"},{"name":"example_efs_test.go","path":"test/example_efs_test.go","sha":"c84d706017cb7ca512c4a4070b470ecc586ffc89"},{"name":"example_lambda_rds_snapshot_create_resources_test.go","path":"test/example_lambda_rds_snapshot_create_resources_test.go","sha":"542c9e0154660daeba8990a16cfa66d5359927ef"},{"name":"example_lambda_rds_snapshot_multiple_schedules_test.go","path":"test/example_lambda_rds_snapshot_multiple_schedules_test.go","sha":"094a8a691f259f79943e7fbf672d2ff8b40b65e4"},{"name":"example_lambda_rds_snapshot_test.go","path":"test/example_lambda_rds_snapshot_test.go","sha":"092e678c8f1297d2767141295933ea4e5795aae1"},{"name":"example_rds_mariadb_test.go","path":"test/example_rds_mariadb_test.go","sha":"bdfeed4be219420de6fe37471d9f3231cdd5a829"},{"name":"example_rds_mysql_test.go","path":"test/example_rds_mysql_test.go","sha":"cfc6ef03fb0a9ae01f889f6a5db83ed49b008ed2"},{"name":"example_rds_mysql_with_cross_region_replica_test.go","path":"test/example_rds_mysql_with_cross_region_replica_test.go","sha":"4840c90ab6662b80481bbf68606e254ca4915391"},{"name":"example_rds_postgres_test.go","path":"test/example_rds_postgres_test.go","sha":"d301ebc1542294b294eb299038abff9d305da804"},{"name":"example_rds_sqlserver_test.go","path":"test/example_rds_sqlserver_test.go","sha":"96ae522976ae664c9e74cbd29293f49d7ed2fa26"},{"name":"example_rds_with_replicas_test.go","path":"test/example_rds_with_replicas_test.go","sha":"ed3c82e66d48c8388a04363cab2e1b3458f4a7fb"},{"name":"example_redshift_test.go","path":"test/example_redshift_test.go","sha":"6e7d5773c6e66b98a0279b839ccd33dbb3899b07"},{"name":"go.mod","path":"test/go.mod","sha":"3245f043b6d05e295fb010ff8886971e4bf1a26a"},{"name":"go.sum","path":"test/go.sum","sha":"de745a2994481da56e437d25c745cea5c7d7fd9f"},{"name":"util.go","path":"test/util.go","sha":"36dc5c6edd93d346240a4504737f8fda77161e56"}]}]},"detailsContent":"<h1 class=\"preview__body--title\" id=\"core-aurora-concepts\">Core Aurora Concepts</h1><div class=\"preview__body--border\"></div><h2 class=\"preview__body--subtitle\" id=\"what-is-amazon-aurora\">What Is Amazon Aurora?</h2>\n<p>Amazon Aurora is a fully managed relational database engine that's compatible with MySQL and PostgreSQL. The code, tools,\nand applications you use today with your existing MySQL and PostgreSQL databases can be used with Aurora. With some\nworkloads, Aurora can deliver up to five times the throughput of MySQL and up to three times the throughput of PostgreSQL\nwithout requiring changes to most of your existing applications.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-connect-to-the-database\">How do you connect to the database?</h2>\n<p>This module provides the connection details as <a href=\"https://www.terraform.io/intro/getting-started/outputs.html\" class=\"preview__body--description--blue\" target=\"_blank\">Terraform output\nvariables</a>:</p>\n<ol>\n<li><strong>Cluster endpoint</strong>: The endpoint for the whole cluster. You should always use this URL for writes, as it points to\nthe primary.</li>\n<li><strong>Instance endpoints</strong>: A comma-separated list of all DB instance URLs in the cluster, including the primary and all\nread replicas. Use these URLs for reads (see "How do you scale this DB?" below).</li>\n<li><strong>Port</strong>: The port to use to connect to the endpoints above.</li>\n</ol>\n<p>For more info, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Aurora.html#Aurora.Overview.Endpoints\" class=\"preview__body--description--blue\" target=\"_blank\">Aurora\nendpoints</a>.</p>\n<p>You can programmatically extract these variables in your Terraform templates and pass them to other resources (e.g.\npass them to User Data in your EC2 instances). You'll also see the variables at the end of each <code>terraform apply</code> call\nor if you run <code>terraform output</code>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-scale-this-database\">How do you scale this database?</h2>\n<ul>\n<li><strong>Storage</strong>: Aurora manages storage for you, automatically growing cluster volume in 10GB increments up to 64TB.</li>\n<li><strong>Vertical scaling</strong>: To scale vertically (i.e. bigger DB instances with more CPU and RAM), use the <code>instance_type</code>\ninput variable. For a list of AWS RDS server types, see <a href=\"http://aws.amazon.com/rds/aurora/pricing/\" class=\"preview__body--description--blue\" target=\"_blank\">Aurora Pricing</a>.</li>\n<li><strong>Horizontal scaling</strong>: To scale horizontally, you can add more replicas using the <code>instance_count</code> input variable,\nand Aurora will automatically deploy the new instances, sync them to the master, and make them available as read\nreplicas.</li>\n</ul>\n<p>For more info, see <a href=\"http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Aurora.Managing.html\" class=\"preview__body--description--blue\" target=\"_blank\">Managing an Amazon Aurora DB\nCluster</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-configure-this-module\">How do you configure this module?</h2>\n<p>This module allows you to configure a number of parameters, such as backup windows, maintenance window, port number,\nand encryption. For a list of all available variables and their descriptions, see <a href=\"/repos/v0.16.3/module-data-storage/modules/aurora/vars.tf\" class=\"preview__body--description--blue\">vars.tf</a>.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-create-a-cross-region-read-replica-cluster\">How do you create a cross-region read replica cluster?</h2>\n<p>After creating a primary cluster, create another cluster in the secondary region and pass the cluster ARN and region of\nthe primary cluster:</p>\n<pre><span class=\"hljs-keyword\">module</span> <span class=\"hljs-string\">\"replica\"</span> {\n source = <span class=\"hljs-string\">\"git::git@github.com:gruntwork-io/module-data-storage.git//modules/aurora?ref=v1.0.8\"</span>\n \n <span class=\"hljs-comment\"># ... other parameters omitted ...</span>\n \n replication_source_identifier = <span class=\"hljs-string\">\"arn:aws:rds:us-east-2:123456789012:cluster:example\"</span>\n source_region = <span class=\"hljs-string\">\"us-east-2\"</span>\n}\n</pre>\n<p>See the example <a href=\"/repos/v0.16.3/module-data-storage/examples/aurora-with-cross-region-replica\" class=\"preview__body--description--blue\">here</a> for more details.</p>\n<h2 class=\"preview__body--subtitle\" id=\"how-do-you-destroy-a-cross-region-read-replica\">How do you destroy a cross-region read replica?</h2>\n<p>You must first promote it to a primary cluster, then destroy it.\nYou can promote it via the RDS Console (Actions → Promote), or with <code>aws rds promote-read-replica-db-cluster --db-cluster-identifier <identifier></code>.\nAfter that, run <code>terraform destroy</code> as you normally would.</p>\n<h2 class=\"preview__body--subtitle\" id=\"known-issues\">Known Issues</h2>\n<p>Requires terraform provider version 1.32 or newer due to the serverless options</p>\n<h3 class=\"preview__body--subtitle\" id=\"db-instance-not-found\">DBInstance not found</h3>\n<p>As of August 29, 2017, Terraform 0.10.x has an issue where when you apply an RDS Aurora Instance for the first time, you may sometimes receive the following error:</p>\n<pre>aws_rds_cluster.cluster_with_encryption: <span class=\"hljs-builtin-name\">Error</span> modifying DB<span class=\"hljs-built_in\"> Instance </span>aurora-test: DBInstanceNotFound: DBInstance <span class=\"hljs-keyword\">not</span> found: aurora-test\nstatus code: 404, request id: 040094aa-8c62-11e7-baa6-0d7ac77494f1\n</pre>\n<p>This error occurs because Terraform first creates the database cluster, then creates one or more database instances, and then queries the AWS API for the IDs of those database instances. But Terraform does not wait long enough for the AWS API to propagate these instances to all AWS API endpoints, so AWS initially replies that the given database instance name was not found.</p>\n<p>Fortunately, this issue has a simple fix. After waiting a few seconds, the AWS API will not return the database instances that we expect, so simply re-run <code>terraform apply</code> and the operation should complete successfully.</p>\n<h2 class=\"preview__body--subtitle\" id=\"limitations-with-aurora-serverless\">Limitations with Aurora Serverless</h2>\n<p>The following limitations apply to Aurora Serverless :</p>\n<ul>\n<li>The port number for connections must be:\n<ul>\n<li><code>3306</code> for Aurora MySQL</li>\n<li><code>5432</code> for Aurora PostgreSQL</li>\n</ul>\n</li>\n<li>You can't give an Aurora Serverless DB cluster a public IP address. You can access an Aurora Serverless DB cluster only from within a virtual private cloud (VPC) based on the Amazon VPC service.</li>\n<li>A connection to an Aurora Serverless DB cluster is closed automatically if it stays open for longer than one day.</li>\n<li>Aurora Replicas</li>\n<li>Amazon RDS Performance Insights</li>\n</ul>\n<p>For more info on limitations, see <a href=\"https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations\" class=\"preview__body--description--blue\" target=\"_blank\">Limitations of Aurora Serverless</a>.</p>\n","repoName":"module-data-storage","repoRef":"v0.16.3","serviceDescriptor":{"serviceName":"Aurora","serviceRepoName":"module-data-storage","serviceRepoOrg":"gruntwork-io","serviceMainReadmePath":"/modules/aurora/README-Aurora.adoc","cloudProviders":["aws"],"description":"Run Aurora, Amazon’s MySQL and PostgreSQL compatible cloud DB. Supports read replicas, multi-zone automatic failover, and automatic backup.","imageUrl":"aurora.png","licenseType":"subscriber","technologies":["Terraform","Bash"],"compliance":[],"tags":[""]},"serviceCategoryName":"Database","fileName":"core-concepts.md","filePath":"/modules/aurora/core-concepts.md","title":"Repo Browser: Aurora","description":"Browse the repos in the Gruntwork Infrastructure as Code Library."}