Skip to content

Alb access logs#5

Open
rkalamaro wants to merge 5 commits intomasterfrom
alb-access-logs
Open

Alb access logs#5
rkalamaro wants to merge 5 commits intomasterfrom
alb-access-logs

Conversation

@rkalamaro
Copy link

No description provided.

Copy link
Contributor

@iloveicedgreentea iloveicedgreentea left a comment

Choose a reason for hiding this comment

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

thanks Roy I made some comments. Can you please take a look

@@ -1,12 +1,41 @@
data "aws_region" "current" {}
data "aws_caller_identity" "current" {}
Copy link
Contributor

Choose a reason for hiding this comment

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

these are/should be in data.tf

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in b68be75

}

data "template_file" "log-bucket-policy" {
template = "${file("${path.module}/log-bucket-policy.json.tpl")}"
Copy link
Contributor

Choose a reason for hiding this comment

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

These vars look like it was made/linted with tf11

Copy link
Author

Choose a reason for hiding this comment

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

If looking to add in-line policy yo the resource, it should resolve the TF linting issue.
But yeah, my env is set on 11 =
Nonetheless, feel free to pull & commit proper TF 12 linting and move the bucket policy to the same alb.tf resource.


resource "aws_s3_bucket_policy" "attach-policy-to-log-bucket" {
bucket = "${aws_s3_bucket.log-bucket.id}"
policy = "${data.template_file.log-bucket-policy.rendered}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

You want to add it as in-line bucket policy rather than templatizing as a separated document?


# alb
resource "aws_lb" "backend" {
depends_on = [
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed since you declare the resource in the block below

Copy link
Author

Choose a reason for hiding this comment

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

Truth, the dependency declared for logical reasons, but removing it should not create any impact.
I'll follow your request

Copy link
Author

Choose a reason for hiding this comment

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

Addressed in da8ac92

security_groups = [aws_security_group.lb_sg.id]
enable_deletion_protection = false
enable_cross_zone_load_balancing = false
access_logs {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make this optional with a var like enable_s3_access_logs and add it to the configs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants