|
@@ -1,36 +1,26 @@
|
|
|
-variable "region" {}
|
|
|
-variable "aws-profile" {}
|
|
|
-variable "stack_name" {}
|
|
|
+module "db_subnets" {
|
|
|
+ source = "../../../cloud-aws-stack/subnets"
|
|
|
|
|
|
-provider "aws" {
|
|
|
- region = "${var.region}"
|
|
|
- profile = "${var.aws-profile}"
|
|
|
+ vpc_id = "${data.terraform_remote_state.base.vpc_id}"
|
|
|
+ stack_name = "${var.stack_name}"
|
|
|
+ prefix = "db"
|
|
|
+ subnet_cidrs = ["10.0.60.0/24","10.0.61.0/24","10.0.62.0/24"]
|
|
|
+ public_route_table = "${data.terraform_remote_state.base.public_route_table[0]}"
|
|
|
}
|
|
|
|
|
|
-############################################################
|
|
|
-# This data provider is used if you deployed the vpc example
|
|
|
-############################################################
|
|
|
-data "terraform_remote_state" "base" {
|
|
|
- backend = "local"
|
|
|
- config {
|
|
|
- path = "${path.module}/../vpc/terraform.tfstate"
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-# Automatically get the Availability Zones
|
|
|
-data "aws_availability_zones" "available" {}
|
|
|
-
|
|
|
module "rds" {
|
|
|
- source = "git::https://github.com/nuxeo/cloud-aws-stack.git//rds"
|
|
|
+ #source = "git::https://github.com/nuxeo/cloud-aws-stack.git//rds"
|
|
|
+ source = "../../../cloud-aws-stack/rds"
|
|
|
|
|
|
- # Specify VPC id if you did not deploy one with terraform
|
|
|
vpc_id = "${data.terraform_remote_state.base.vpc_id}"
|
|
|
-
|
|
|
region = "${var.region}"
|
|
|
stack_name = "${var.stack_name}"
|
|
|
+
|
|
|
database_name = "nuxeo-${var.stack_name}"
|
|
|
- db_subnet_ids = ["10.0.111.0/24","10.0.112.0/24","10.0.113.0/24"]
|
|
|
+ db_subnets = ["${split(",", module.db_subnets.subnets)}"]
|
|
|
security_group_ids = [""]
|
|
|
azs = ["${data.aws_availability_zones.available.names[0]}","${data.aws_availability_zones.available.names[1]}","${data.aws_availability_zones.available.names[2]}"]
|
|
|
-}
|
|
|
|
|
|
+ create_dns_domain = true
|
|
|
+ create_dns_record = true
|
|
|
+}
|