File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ data "aws_elb_service_account" "default" {}
2+
3+ # ------------------------------------------------------------------------------
4+ # IAM POLICY DOCUMENT - For access logs to the s3 bucket
5+ # ------------------------------------------------------------------------------
6+ data "aws_iam_policy_document" "lb_logs_access_policy_document" {
7+ statement {
8+ effect = " Allow"
9+
10+ principals {
11+ type = " AWS"
12+ identifiers = [data . aws_elb_service_account . default . arn ]
13+ }
14+
15+ actions = [
16+ " s3:PutObject" ,
17+ ]
18+
19+ resources = [
20+ " arn:aws:s3:::${ var . name_prefix } -lb-logs/*" ,
21+ ]
22+ }
23+ }
24+
25+ # ------------------------------------------------------------------------------
26+ # IAM POLICY - For access logs to the s3 bucket
27+ # ------------------------------------------------------------------------------
28+ resource "aws_s3_bucket_policy" "lb_logs_access_policy" {
29+ bucket = aws_s3_bucket. logs . id
30+ policy = data. aws_iam_policy_document . lb_logs_access_policy_document . json
31+ }
32+
133# ------------------------------------------------------------------------------
234# S3 BUCKET - For access logs
335# ------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments