Skip to content

Commit

Permalink
Add CloudWatch log support to AWS Iglu (closes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeemster authored and paulboocock committed Aug 13, 2021
1 parent af49f65 commit 5b9b701
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
9 changes: 6 additions & 3 deletions terraform/aws/iglu_server/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_key_pair" "pipeline" {
# 1. Deploy an Iglu Server stack
module "iglu_rds" {
source = "snowplow-devops/rds/aws"
version = "0.1.3"
version = "0.1.4"

name = "${var.prefix}-iglu-rds"
vpc_id = var.vpc_id
Expand All @@ -21,7 +21,7 @@ module "iglu_rds" {

module "iglu_lb" {
source = "snowplow-devops/alb/aws"
version = "0.1.1"
version = "0.1.2"

name = "${var.prefix}-iglu-lb"
vpc_id = var.vpc_id
Expand All @@ -36,7 +36,7 @@ module "iglu_lb" {

module "iglu_server" {
source = "snowplow-devops/iglu-server-ec2/aws"
version = "0.1.0"
version = "0.1.1"

name = "${var.prefix}-iglu-server"
vpc_id = var.vpc_id
Expand All @@ -61,4 +61,7 @@ module "iglu_server" {
user_provided_id = var.user_provided_id

tags = var.tags

cloudwatch_logs_enabled = var.cloudwatch_logs_enabled
cloudwatch_logs_retention_days = var.cloudwatch_logs_retention_days
}
4 changes: 4 additions & 0 deletions terraform/aws/iglu_server/default/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ ssl_information = {

# --- Extra Tags to append to created resources (optional)
tags = {}

# --- CloudWatch logging to ensure logs are saved outside of the server
cloudwatch_logs_enabled = true
cloudwatch_logs_retention_days = 7
12 changes: 12 additions & 0 deletions terraform/aws/iglu_server/default/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,15 @@ variable "tags" {
default = {}
type = map(string)
}

variable "cloudwatch_logs_enabled" {
description = "Whether application logs should be reported to CloudWatch; by default they are only on the server"
default = false
type = bool
}

variable "cloudwatch_logs_retention_days" {
description = "The length of time in days to retain logs for"
default = 7
type = number
}
9 changes: 6 additions & 3 deletions terraform/aws/iglu_server/secure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "aws_key_pair" "pipeline" {
# 1. Deploy an Iglu Server stack
module "iglu_rds" {
source = "snowplow-devops/rds/aws"
version = "0.1.3"
version = "0.1.4"

name = "${var.prefix}-iglu-rds"
vpc_id = var.vpc_id
Expand All @@ -21,7 +21,7 @@ module "iglu_rds" {

module "iglu_lb" {
source = "snowplow-devops/alb/aws"
version = "0.1.1"
version = "0.1.2"

name = "${var.prefix}-iglu-lb"
vpc_id = var.vpc_id
Expand All @@ -36,7 +36,7 @@ module "iglu_lb" {

module "iglu_server" {
source = "snowplow-devops/iglu-server-ec2/aws"
version = "0.1.0"
version = "0.1.1"

name = "${var.prefix}-iglu-server"
vpc_id = var.vpc_id
Expand All @@ -63,4 +63,7 @@ module "iglu_server" {
associate_public_ip_address = false

tags = var.tags

cloudwatch_logs_enabled = var.cloudwatch_logs_enabled
cloudwatch_logs_retention_days = var.cloudwatch_logs_retention_days
}
4 changes: 4 additions & 0 deletions terraform/aws/iglu_server/secure/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ ssl_information = {

# --- Extra Tags to append to created resources (optional)
tags = {}

# --- CloudWatch logging to ensure logs are saved outside of the server
cloudwatch_logs_enabled = true
cloudwatch_logs_retention_days = 7
12 changes: 12 additions & 0 deletions terraform/aws/iglu_server/secure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,15 @@ variable "tags" {
default = {}
type = map(string)
}

variable "cloudwatch_logs_enabled" {
description = "Whether application logs should be reported to CloudWatch; by default they are only on the server"
default = false
type = bool
}

variable "cloudwatch_logs_retention_days" {
description = "The length of time in days to retain logs for"
default = 7
type = number
}

0 comments on commit 5b9b701

Please sign in to comment.