{"id":15877662,"url":"https://github.com/dumrauf/aws_log_bucket","last_synced_at":"2025-03-16T05:31:09.111Z","repository":{"id":133006446,"uuid":"138353099","full_name":"dumrauf/aws_log_bucket","owner":"dumrauf","description":"Creates an AWS Log Bucket that can be used to store CloudFront access logs","archived":false,"fork":false,"pushed_at":"2023-12-22T22:08:09.000Z","size":11,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T05:23:13.033Z","etag":null,"topics":["aws","logging","s3","s3-bucket"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dumrauf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-22T22:21:41.000Z","updated_at":"2023-12-22T21:23:38.000Z","dependencies_parsed_at":"2023-12-22T22:25:07.489Z","dependency_job_id":"198cc1d5-a71c-4105-b62a-40f88b5b1730","html_url":"https://github.com/dumrauf/aws_log_bucket","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Faws_log_bucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Faws_log_bucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Faws_log_bucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dumrauf%2Faws_log_bucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dumrauf","download_url":"https://codeload.github.com/dumrauf/aws_log_bucket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806032,"owners_count":20350773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","logging","s3","s3-bucket"],"created_at":"2024-10-06T02:02:47.697Z","updated_at":"2025-03-16T05:31:08.407Z","avatar_url":"https://github.com/dumrauf.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Log Bucket\n\nThis repository contains a Terraform module that creates a logging bucket. The logging bucket can then be used to store [CloudFront access logs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html), [S3 access logs](https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html#how-logs-delivered) or most other of AWS's logs.\n\n\u003e For further information, see the corresponding article on [https://www.how-hard-can-it.be/aws-logging-buckets/](https://www.how-hard-can-it.be/aws-logging-buckets/).\n\n\n## You Have\n\nBefore you can use the Terraform module in this repository out of the box, you need\n\n - an [AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html)\n - a [Terraform](https://www.terraform.io/intro/getting-started/install.html) CLI\n\n\n## You Want\n\nAfter running the Terraform module in this repository you get an S3 bucket which can be used to store AWS's logs.\n\n\n## Setup\n\nThe input variables for the module are defined in [settings/example.tfvars](settings/example.tfvars) to be\n```hcl\nregion = \"us-east-1\"\n\nshared_credentials_file = \"/path/to/.aws/credentials\"\n\nprofile = \"\u003cyour-profile\u003e\"\n\nlog_bucket_prefix = \"\u003cyour-prefix\u003e-\"\n```\nHere, you need to replace the example values with your settings. Note that you also need to update the `log_bucket_prefix` as the current value is _not a valid input_.\n\n\n## Execution\n\nInitialise Terraform by running\n```\nterraform init\n```\nAs a best practice, create a new workspace by running\n```\nterraform workspace new example\n```\nThe log bucket can be planned by running\n```\nterraform plan -var-file=settings/example.tfvars\n```\nand created by running\n```\nterraform apply -var-file=settings/example.tfvars\n```\n\n\n## Outputs\n\nThe module has two outputs, namely `log_bucket_id` and `bucket_domain_name` which are the corresponding Terraform attributes of the newly created log bucket.\n\n\n## Deletion\n\nThe logging bucket can be deleted by running\n```\nterraform destroy -var-file=settings/example.tfvars\n```\n\n\n## FAQs\n\n\n### Why's the Bucket Not Emptied Before It's Destroyed?\n\nThe `force_destroy` option is deliberately set to `false` in order to avoid accidental deletion of the contents when running `terraform destroy`. It's essentially a safety net. Feel free to change it and use it at your own risk.\n\n\n## AWS Logging Overview\n\nFor a detailed overview of AWS Logging, see the excellent article on [https://logmatic.io/blog/everything-you-need-to-know-about-aws-logging/](https://logmatic.io/blog/everything-you-need-to-know-about-aws-logging/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumrauf%2Faws_log_bucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdumrauf%2Faws_log_bucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdumrauf%2Faws_log_bucket/lists"}