Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added new S3 bucket policy statement for latest regions #218

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ provider "aws" {
region = local.region

# Make it faster by skipping something
skip_get_ec2_platforms = true
skip_metadata_api_check = true
skip_region_validation = true
skip_credentials_validation = true
Expand Down
21 changes: 21 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ data "aws_elb_service_account" "this" {
data "aws_iam_policy_document" "elb_log_delivery" {
count = local.create_bucket && var.attach_elb_log_delivery_policy ? 1 : 0

# Policy for AWS Regions created before August 2022 (e.g. US East (N. Virginia), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Europe (Ireland))
statement {
sid = ""

Expand All @@ -549,6 +550,26 @@ data "aws_iam_policy_document" "elb_log_delivery" {
"${aws_s3_bucket.this[0].arn}/*",
]
}

# Policy for AWS Regions created after August 2022 (e.g. Asia Pacific (Hyderabad), Asia Pacific (Melbourne), Europe (Spain), Europe (Zurich), Middle East (UAE))
statement {
sid = ""

principals {
type = "Service"
identifiers = ["logdelivery.elasticloadbalancing.amazonaws.com"]
}

effect = "Allow"

actions = [
"s3:PutObject",
]

resources = [
"${aws_s3_bucket.this[0].arn}/*",
]
}
}

# ALB/NLB
Expand Down