Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tf_mod_aws_elb
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
steamhaus
tf_mod_aws_elb
Commits
c6e1fe87
Commit
c6e1fe87
authored
Aug 13, 2018
by
Adrian Horrocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to invalid bucket name and adding logs to elb
parent
c3fab279
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
README.md
README.md
+1
-1
main.tf
main.tf
+16
-2
No files found.
README.md
View file @
c6e1fe87
...
@@ -5,4 +5,4 @@ module "elb" {
...
@@ -5,4 +5,4 @@ module "elb" {
security_groups =
[
"${aws_security_group.elb.id}"
]
security_groups =
[
"${aws_security_group.elb.id}"
]
health_check_target = "HTTP:80/healthcheck.php"
health_check_target = "HTTP:80/healthcheck.php"
ssl_certificate_id = "arn:aws:acm:eu-west-1:745249840871:certificate/b6ad625c-d0b8-4359-bcb6-326b309e90e8"
ssl_certificate_id = "arn:aws:acm:eu-west-1:745249840871:certificate/b6ad625c-d0b8-4359-bcb6-326b309e90e8"
}
}
\ No newline at end of file
main.tf
View file @
c6e1fe87
...
@@ -67,6 +67,14 @@ variable "health_check_interval" {
...
@@ -67,6 +67,14 @@ variable "health_check_interval" {
default
=
"30"
default
=
"30"
}
}
variable
"logs_enabled"
{
default
=
"true"
}
variable
"logs_interval"
{
default
=
"5"
}
#############################################################################################################
#############################################################################################################
# Security Group
# Security Group
#############################################################################################################
#############################################################################################################
...
@@ -129,6 +137,12 @@ resource "aws_elb" "main" {
...
@@ -129,6 +137,12 @@ resource "aws_elb" "main" {
instance_protocol
=
"
${
var
.
service_protocol
}
"
instance_protocol
=
"
${
var
.
service_protocol
}
"
}
}
access_logs
{
enabled
=
"
${
var
.
logs_enabled
}
"
bucket
=
"
${
var
.
name
}
-elb-logs"
interval
=
"
${
var
.
logs_interval
}
"
}
health_check
{
health_check
{
healthy_threshold
=
"
${
var
.
health_check_healthy_threshold
}
"
healthy_threshold
=
"
${
var
.
health_check_healthy_threshold
}
"
unhealthy_threshold
=
"
${
var
.
health_check_unhealthy_threshold
}
"
unhealthy_threshold
=
"
${
var
.
health_check_unhealthy_threshold
}
"
...
@@ -146,7 +160,7 @@ resource "aws_elb" "main" {
...
@@ -146,7 +160,7 @@ resource "aws_elb" "main" {
data
"aws_elb_service_account"
"main"
{}
data
"aws_elb_service_account"
"main"
{}
resource
"aws_s3_bucket"
"elb_logs"
{
resource
"aws_s3_bucket"
"elb_logs"
{
bucket
=
"
${
var
.
name
}
-elb
_
logs"
bucket
=
"
${
var
.
name
}
-elb
-
logs"
acl
=
"private"
acl
=
"private"
policy
=
<<
POLICY
policy
=
<<
POLICY
...
@@ -159,7 +173,7 @@ resource "aws_s3_bucket" "elb_logs" {
...
@@ -159,7 +173,7 @@ resource "aws_s3_bucket" "elb_logs" {
"s3:PutObject"
"s3:PutObject"
],
],
"Effect": "Allow",
"Effect": "Allow",
"Resource": "arn:aws:s3:::${var.name}-elb
_
logs/AWSLogs/*",
"Resource": "arn:aws:s3:::${var.name}-elb
-
logs/AWSLogs/*",
"Principal": {
"Principal": {
"AWS": [
"AWS": [
"${data.aws_elb_service_account.main.arn}"
"${data.aws_elb_service_account.main.arn}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment