Skip to content

Commit

Permalink
Add storage_encrypted argument (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
drmikecrowe authored and const-bon committed Nov 8, 2017
1 parent ede7165 commit f021d90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The module will create:
- `storage_type` - One of `standard` (magnetic), `gp2` (general purpose SSD), or `io1` (provisioned IOPS SSD). Default `standard` (magnetic)
- `iops` - The amount of provisioned IOPS. Setting this implies a storage_type of `io1`. Default is `0` if rds storage type is not `io1`
- `allocated_storage` - The number of GBs to allocate for DB storage. Must be an integer, _e.g._ `10`
- `storage_encrypted` - (Optional) Specifies whether the DB instance is encrypted. The default is false if not specified.
- `engine` - Engine type, such as `mysql` or `postgres`
- `engine_version` - DB Engine version, _e.g._ `9.5.4` for `Postgres`
- `instance_class` - Instance class, _e.g._ `db.t2.micro`
Expand Down Expand Up @@ -79,6 +80,7 @@ module "rds_instance" {
multi_az = true
storage_type = "gp2"
allocated_storage = "100"
storage_encrypted = true
engine = "mysql"
engine_version = "5.7.17"
instance_class = "db.t2.medium"
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ resource "aws_db_instance" "default" {
engine_version = "${var.engine_version}"
instance_class = "${var.instance_class}"
allocated_storage = "${var.allocated_storage}"
storage_encrypted = "${var.storage_encrypted}"
vpc_security_group_ids = ["${aws_security_group.default.id}"]
db_subnet_group_name = "${aws_db_subnet_group.default.name}"
parameter_group_name = "${aws_db_parameter_group.default.name}"
Expand Down
1 change: 1 addition & 0 deletions tests/rds_instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module "rds_instance" {
multi_az = true
storage_type = "gp2"
allocated_storage = "100"
storage_encrypted = false
engine = "mysql"
engine_version = "5.7.17"
instance_class = "db.t2.medium"
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ variable "storage_type" {
default = "standard"
}

variable "storage_encrypted" {
description = "(Optional) Specifies whether the DB instance is encrypted. The default is false if not specified."
default = false
}

variable "iops" {
description = "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1'. Default is 0 if rds storage type is not 'io1'"
default = "0"
Expand Down

0 comments on commit f021d90

Please sign in to comment.