Skip to content

Commit

Permalink
RDS now Creates an Initial DB (#53)
Browse files Browse the repository at this point in the history
* RDS now creates initial DB

* do not recreate RDS instances with existing DB

* Apply suggestions from code review

Co-authored-by: Marc Qualie <[email protected]>

Co-authored-by: Marc Qualie <[email protected]>
  • Loading branch information
swiknaba and marcqualie authored Dec 16, 2021
1 parent 48edfd2 commit 13a4e8d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ This project does not follow SemVer, since modules are independent of each other

## Unreleased

### RDS

- an initial database is now created with the name `{project}_{environment}` [#52](https://github.com/dbl-works/terraform/pull/52)

### Added

- new module `s3-private`, a basic S3 bucket for private, encrypted files [#51](https://github.com/dbl-works/terraform/pull/51)



### CDN

- removes CloudFront set up, refere to use CloudFront Workers instead. Is now a very simple public S3 container with standardzed settings and tags [#52](https://github.com/dbl-works/terraform/pull/52)
Expand Down
2 changes: 2 additions & 0 deletions rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Used for creating and configuring databases and their networking.

Will create an initial database named `{project}_{environment}`.


## Usage

Expand Down
3 changes: 3 additions & 0 deletions rds/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ resource "aws_db_instance" "main" {
engine_version = var.engine_version
instance_class = var.instance_class
identifier = "${var.project}-${var.environment}"
name = "${var.project}_${var.environment}" # name of the initial database
skip_final_snapshot = true
username = var.username
password = var.password
Expand All @@ -29,6 +30,7 @@ resource "aws_db_instance" "main" {
"postgresql",
"upgrade",
]

tags = {
Name = "${var.project}-${var.environment}"
Project = var.project
Expand All @@ -40,6 +42,7 @@ resource "aws_db_instance" "main" {
ignore_changes = [
engine_version, # AWS will auto-update minor version changes
latest_restorable_time,
name, # if you didn't use this before it would re-create your RDS instance
]
}
}

0 comments on commit 13a4e8d

Please sign in to comment.