Commit c3fab279 authored by Adrian Horrocks's avatar Adrian Horrocks

creating s3 bucket and policy

parent 3a4f81b5
......@@ -138,6 +138,39 @@ resource "aws_elb" "main" {
}
}
#############################################################################################################
# S3 Bucket for Log Exports
#############################################################################################################
data "aws_elb_service_account" "main" {}
resource "aws_s3_bucket" "elb_logs" {
bucket = "${var.name}-elb_logs"
acl = "private"
policy = <<POLICY
{
"Id": "Policy",
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.name}-elb_logs/AWSLogs/*",
"Principal": {
"AWS": [
"${data.aws_elb_service_account.main.arn}"
]
}
}
]
}
POLICY
}
#############################################################################################################
# Outputs
#############################################################################################################
......
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