Commit c6e1fe87 authored by Adrian Horrocks's avatar Adrian Horrocks

changes to invalid bucket name and adding logs to elb

parent c3fab279
......@@ -67,6 +67,14 @@ variable "health_check_interval" {
default = "30"
}
variable "logs_enabled" {
default = "true"
}
variable "logs_interval" {
default = "5"
}
#############################################################################################################
# Security Group
#############################################################################################################
......@@ -129,6 +137,12 @@ resource "aws_elb" "main" {
instance_protocol = "${var.service_protocol}"
}
access_logs {
enabled = "${var.logs_enabled}"
bucket = "${var.name}-elb-logs"
interval = "${var.logs_interval}"
}
health_check {
healthy_threshold = "${var.health_check_healthy_threshold}"
unhealthy_threshold = "${var.health_check_unhealthy_threshold}"
......@@ -146,7 +160,7 @@ resource "aws_elb" "main" {
data "aws_elb_service_account" "main" {}
resource "aws_s3_bucket" "elb_logs" {
bucket = "${var.name}-elb_logs"
bucket = "${var.name}-elb-logs"
acl = "private"
policy = <<POLICY
......@@ -159,7 +173,7 @@ resource "aws_s3_bucket" "elb_logs" {
"s3:PutObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.name}-elb_logs/AWSLogs/*",
"Resource": "arn:aws:s3:::${var.name}-elb-logs/AWSLogs/*",
"Principal": {
"AWS": [
"${data.aws_elb_service_account.main.arn}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment