Skip to content

add access-logging #19

Merged
merged 2 commits into from
Jul 29, 2020
Merged

add access-logging #19

merged 2 commits into from
Jul 29, 2020

Conversation

ashle001
Copy link
Contributor

Added "logging" bloc to main.tf

Copy link
Contributor

@badra001 badra001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See changes to line 29 requested

main.tf Outdated
@@ -24,6 +24,11 @@ resource "aws_s3_bucket" "this" {
enabled = true
}

logging {
target_bucket = var.access_log_bucket
target_prefix = "s3/{var.bucket_name}/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this in to a variable, but with a default. Add to variables.tf

variable "access_log_bucket_prefix" {
  description = "Access log bucket prefix, to which the bucket name will be appended to make the target_prefix"
  type = string
  default = "s3"
}

and then change this line to

  target_prefix = format("%s/%s/",var.access_log_bucket_prefix,var.access_log_bucket)

@ashle001
Copy link
Contributor Author

Added access log bucket prefix variable to vsriables.tf and updated target_prefix in main.tf as requested.

Copy link
Contributor

@badra001 badra001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@badra001 badra001 merged commit 375e89b into master Jul 29, 2020
@badra001 badra001 deleted the access-logging branch July 29, 2020 18:13
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants