Browse Source

S3 update to have 3 buckets per customer and minor fixes

Roberto Barbosa 8 years ago
parent
commit
a1811f2503
4 changed files with 39 additions and 3 deletions
  1. 1 1
      alb/main.tf
  2. 7 0
      alb/outputs.tf
  3. 17 0
      alb/variables.tf
  4. 14 2
      s3/main.tf

+ 1 - 1
alb/main.tf

@@ -83,7 +83,7 @@ resource "aws_autoscaling_group" "asg_nuxeo" {
     max_size                  = 1
     min_size                  = 1
     name                      = "asg_nuxeo"
-    vpc_zone_identifier       = ["${var.vpc_id}"]
+    vpc_zone_identifier       = ["${var.alb_subnets}"]
     target_group_arns = ["${aws_alb_target_group.nuxeo.arn}"]
 
     tag {

+ 7 - 0
alb/outputs.tf

@@ -0,0 +1,7 @@
+output "nuxeo_url_alb" {
+  value = "${aws_alb.nuxeo.dns_name}"
+}
+
+output "nuxeo_url" {
+  value = "${aws_route53_record.nuxeo.fqdn}"
+}

+ 17 - 0
alb/variables.tf

@@ -0,0 +1,17 @@
+variable "stack_name" {
+    default = ""
+}
+
+variable "vpc_id" {
+    default = ""
+}
+
+variable "alb_subnets" {
+    default = []
+}
+
+variable "alb_secgroups" {
+    default = []
+}
+
+

+ 14 - 2
s3/main.tf

@@ -9,7 +9,7 @@ resource "aws_s3_bucket" "bucket" {
     Name              = "nuxeo-${var.cust_id}"
     billing-category    = "customers"
     billing-subcategory = "${var.stack_name}"
-    role                = "nuxeo.aws-s3"
+    role                = "nuxeo.bucket.binstore"
   }
 }
 
@@ -21,6 +21,18 @@ resource "aws_s3_bucket" "bucket_backup" {
     Name              = "nuxeo-backup-${var.cust_id}"
     billing-category    = "customers"
     billing-subcategory = "${var.stack_name}"
-    role                = "nuxeo.aws-s3"
+    role                = "nuxeo.bucket.backup"
+  }
+}
+
+resource "aws_s3_bucket" "bucket_logs" {
+    bucket = "nuxeo-logs-${var.cust_id}"
+    acl = "private"
+
+  tags {
+    Name              = "nuxeo-logs-${var.cust_id}"
+    billing-category    = "customers"
+    billing-subcategory = "${var.stack_name}"
+    role                = "nuxeo.bucket.logs"
   }
 }