Difference between revisions of "Terraform resource: aws s3 bucket logging"
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
target_prefix = "log/" | target_prefix = "log/" | ||
} | } | ||
+ | |||
+ | |||
+ | === Required Arguments === | ||
+ | |||
+ | * <code>[[bucket]]</code>: Name of the S3 bucket you want to enable logging for. | ||
+ | * <code>[[target_bucket]]</code>: Name of the bucket where you want to store the log data. This bucket needs to have appropriate permissions set to allow logging. | ||
+ | * <code>[[target_prefix]]</code>: Prefix that will be added to the beginning of every log object key. | ||
+ | |||
+ | |||
+ | |||
+ | === Optional Arguments === | ||
+ | |||
+ | * <code>[[expected_bucket_owner]]</code>: Account ID of the expected owner of the source bucket (useful when the owner is different from the one configuring Terraform). | ||
+ | * <code>[[target_grant]]</code>: Allows you to configure permissions for the target bucket where logs are stored. | ||
+ | * <code>[[target_object_key_format]]</code>: Specifies the format for log object keys within the target bucket. | ||
== Related == | == Related == | ||
− | * [[aws_s3_bucket_server_side_encryption_configuration]] | + | * <code>[[aws_s3_bucket_server_side_encryption_configuration]]</code> |
* [[Logging options for Amazon S3]] | * [[Logging options for Amazon S3]] | ||
== See also == | == See also == | ||
+ | * {{aws s3 bucket logging}} | ||
+ | * {{s3 logs}} | ||
* {{tf s3}} | * {{tf s3}} | ||
[[Category:Terraform AWS]] | [[Category:Terraform AWS]] |
Latest revision as of 04:21, 17 June 2024
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]
aws s3 bucket logging
- Amazon S3 logging,
aws s3 bucket logging
- Terraform S3 resources:
aws_s3_bucket, aws_s3_object, aws_s3_bucket_policy, aws_s3_bucket_acl, aws_s3_bucket_website_configuration, aws_s3_bucket cors_configuration, aws_s3_account_public_access_block
, Terraform module: s3-bucket,aws_s3_bucket_versioning, aws_s3_bucket_server_side_encryption_configuration, aws_s3_bucket_logging
Advertising: