1
0
Files
terraform.examples/modules/storage/S3LbAccessLog
2026-02-13 15:44:24 +08:00
..
2026-02-13 15:44:24 +08:00
2026-02-13 15:44:24 +08:00
2026-02-13 15:44:24 +08:00
2026-02-13 15:44:24 +08:00
2026-02-13 15:44:24 +08:00

S3LbAccessLog

Module to create s3 bucket for LB access logging. Bucket policy is automatically set

Requirements

Name Version
terraform >= 1.3.0
aws ~> 5.0

Providers

Name Version
aws ~> 5.0

Modules

No modules.

Resources

Name Type
aws_s3_bucket.this resource
aws_s3_bucket_lifecycle_configuration.lifecycle resource
aws_s3_bucket_policy.bucket_policy resource
aws_s3_bucket_public_access_block.block_public_access resource
aws_s3_bucket_server_side_encryption_configuration.encryption resource
aws_iam_policy_document.bucket_policy data source
aws_region.this data source

Inputs

Name Description Type Default Required
bucket_name Name of bucket string n/a yes
current_version_expiration_days Delete logs after days - default 30 number 30 no
enable_bucket_lifecycle Enable s3 bucket lifecycle bool true no
encryption_key_arn Leave blank to use AES256 string "" no
region_account_map AWS account id from which LB logs are produced map(string)
{
"af-south-1": "098369216593",
"ap-east-1": "754344448648",
"ap-northeast-1": "582318560864",
"ap-northeast-2": "600734575887",
"ap-northeast-3": "383597477331",
"ap-south-1": "718504428378",
"ap-southeast-1": "114774131450",
"ap-southeast-2": "783225319266",
"ap-southeast-3": "589379963580",
"ca-central-1": "985666609251",
"eu-central-1": "054676820928",
"eu-north-1": "897822967062",
"eu-south-1": "635631232127",
"eu-west-1": "156460612806",
"eu-west-2": "652711504416",
"eu-west-3": "009996457667",
"me-south-1": "076674570225",
"sa-east-1": "507241528517",
"us-east-1": "127311923021",
"us-east-2": "033677994240",
"us-west-1": "027434742980",
"us-west-2": "797873946194"
}
no

Outputs

Name Description
bucket_arn n/a
bucket_name n/a

Authorship

This module was developed by xpk.