Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Logging module for s3 buckets #40

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

orenfromberg
Copy link

Related to https://github.com/adhocteam/infrastructure/issues/265

Proposed changes:

  • Adding module for logging

Acceptance criteria validation

  • Fulfilled Acceptance Criteria

  • Tests added to cover the change

Optional Details

Alternate Designs

Possible Drawbacks

Security implications

Requested feedback

@orenfromberg orenfromberg added the work in progress 🔧 Work that is not ready for review label Sep 24, 2019
Copy link
Contributor

@robertfairhead robertfairhead left a comment

Choose a reason for hiding this comment

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

Fine as is. I left some thoughts on possible improvements but none are really blockers if you want to merge as is

default = "s3/"
}

variable "bucket" {
Copy link
Contributor

Choose a reason for hiding this comment

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

since this needs to be unique, i'd suggest you set it inside here instead of relying on the caller do it.

In other situations we used domain name + environment name + some identifying suffix like adhoc.team-shared-logs or something. But the details are up to you

@@ -0,0 +1,18 @@
variable "cdn_logs_path" {
Copy link
Contributor

Choose a reason for hiding this comment

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

for these can you a type = string that helps with Terraform 0.12+ to allow type checking of input variables. You get better error messages

value = "${aws_s3_bucket.logs.bucket_domain_name}"
}

output "s3_logs_path" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest not passing out the vars as the same. Since the caller passed them in, it already has these values. the more important ones are the stuff you had above where we are passing out "internal' values

resources = ["arn:aws:s3:::${aws_s3_bucket.logs.bucket}/${var.alb_logs_path}*"]
principals {
type = "AWS"
identifiers = ["arn:aws:iam::156460612806:root"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Are intending to hard code these accounts? I didn't see them in our organization so I'm not sure what they are?


Usage:

```terraform
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you going to include in this PR updates to the different buckets, CloudFronts, and LBs to point to these?

@orenfromberg orenfromberg added the ready for review 👀 Ready for code review and approval from maintainers label Sep 24, 2019
@oldsj oldsj added specialty: infrastructure Infrastructure / ops work and removed work in progress 🔧 Work that is not ready for review labels Jan 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready for review 👀 Ready for code review and approval from maintainers specialty: infrastructure Infrastructure / ops work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants