Terraform resource: aws s3 bucket logging

From wikieduonline
Revision as of 04:21, 17 June 2024 by Welcome (talk | contribs) (→‎See also)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


resource "aws_s3_bucket_logging" "example" {
 bucket = aws_s3_bucket.example.id

 target_bucket = aws_s3_bucket.log_bucket.id
 target_prefix = "log/"
}


Required Arguments[edit]

  • bucket: Name of the S3 bucket you want to enable logging for.
  • target_bucket: Name of the bucket where you want to store the log data. This bucket needs to have appropriate permissions set to allow logging.
  • target_prefix: Prefix that will be added to the beginning of every log object key.


Optional Arguments[edit]

  • expected_bucket_owner: Account ID of the expected owner of the source bucket (useful when the owner is different from the one configuring Terraform).
  • target_grant: Allows you to configure permissions for the target bucket where logs are stored.
  • target_object_key_format: Specifies the format for log object keys within the target bucket.

Related[edit]

See also[edit]

Advertising: