Skip to content

Commit

Permalink
Merge pull request #8 from opzkit/various-fixes
Browse files Browse the repository at this point in the history
Various fixes
  • Loading branch information
argoyle authored Dec 23, 2021
2 parents f8be8a6 + 8c691ce commit 5ce3e23
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ resource "aws_security_group" "allow_mysql" {

resource "aws_db_instance" "default" {
instance_class = var.instance_type
engine = "mysql"
engine_version = var.mysql_version
allocated_storage = var.allocated_storage
max_allocated_storage = 60
skip_final_snapshot = var.skip_final_snapshot
identifier = var.identifier
Expand All @@ -49,4 +51,5 @@ resource "aws_db_instance" "default" {
apply_immediately = var.apply_immediately
db_subnet_group_name = aws_db_subnet_group.default.name
storage_encrypted = var.storage_encrypted
vpc_security_group_ids = [aws_security_group.allow_mysql.id]
}
2 changes: 1 addition & 1 deletion secret.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ locals {
secret_value = {
DB_USERNAME = var.master_username
DB_PASSWORD = local.password
DB_NAME = aws_db_instance.default.identifier
DB_NAME = var.db_name
DB_PORT = aws_db_instance.default.port
DB_HOST = aws_db_instance.default.address
}
Expand Down
6 changes: 6 additions & 0 deletions vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ variable "instance_type" {
default = "db.t3.small"
}

variable "allocated_storage" {
type = number
description = "Allocated storage for instance"
default = 20
}

variable "mysql_version" {
type = string
description = "The mysql version to use"
Expand Down

0 comments on commit 5ce3e23

Please sign in to comment.