make db version a variable

This commit is contained in:
Arsenii Petrovich 2019-02-27 00:57:07 +03:00
parent 9aeeb0757c
commit 57d48f0151
5 changed files with 6 additions and 2 deletions

View File

@ -34,13 +34,14 @@ dns_zone_name: "poa.internal"
## All resources will be prefixed with this one
prefix: "sokol"
## The following settings are related to the RDS instance which will be created during deployment
## The following settings are related to the Postgres RDS instance which will be created during deployment
db_id: "poa"
db_username: "username"
db_password: "qwerty12345"
db_instance_class: "db.m4.xlarge"
db_storage: "120"
db_storage_type: "gp2"
db_version: "10.5"
## The following settngs are related to SSL of Application Load Balancer that will be deployed to AWS. If use_ssl is set to false, alb_* variables can be omitted
use_ssl: "false"

View File

@ -21,6 +21,7 @@ db_password: "qwerty12345"
db_instance_class: "db.m4.xlarge"
db_storage: "120"
db_storage_type: "gp2"
db_version: "10.5"
alb_ssl_policy: "ELBSecurityPolicy-2016-08"
alb_certificate_arn: "arn:aws:acm:us-east-1:008312654217:certificate/ce6ec2cb-eba4-4b02-af1d-e77ce8813497"

View File

@ -1,7 +1,7 @@
resource "aws_db_instance" "default" {
identifier = "${var.prefix}-${var.db_id}"
engine = "postgres"
engine_version = "10.5"
engine_version = "${var.db_version}"
instance_class = "${var.db_instance_class}"
storage_type = "${var.db_storage_type}"
allocated_storage = "${var.db_storage}"

View File

@ -50,6 +50,7 @@ variable "db_password" {}
variable "db_storage" {}
variable "db_storage_type" {}
variable "db_instance_class" {}
variable "db_version" {}
variable "new_relic_app_name" {}
variable "new_relic_license_key" {}

View File

@ -16,6 +16,7 @@ db_password = "{{ db_password }}"
db_instance_class = "{{ db_instance_class }}"
db_storage = "{{ db_storage }}"
db_storage_type = "{{ db_storage_type }}"
db_version = "{{ db_version }}"
alb_ssl_policy = "{{ alb_ssl_policy }}"
alb_certificate_arn = "{{ alb_certificate_arn }}"