{"id":26959323,"url":"https://github.com/tmknom/terraform-aws-s3-cloudtrail","last_synced_at":"2025-04-03T04:37:30.747Z","repository":{"id":54414025,"uuid":"154692650","full_name":"tmknom/terraform-aws-s3-cloudtrail","owner":"tmknom","description":"Terraform module which creates S3 Bucket resources for CloudTrail on AWS.","archived":false,"fork":false,"pushed_at":"2021-02-19T12:09:32.000Z","size":34,"stargazers_count":3,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-08-15T19:38:06.691Z","etag":null,"topics":["aws","s3","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmknom.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}},"created_at":"2018-10-25T15:14:53.000Z","updated_at":"2023-08-15T19:38:06.693Z","dependencies_parsed_at":"2022-08-13T15:00:21.987Z","dependency_job_id":null,"html_url":"https://github.com/tmknom/terraform-aws-s3-cloudtrail","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-s3-cloudtrail","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-s3-cloudtrail/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-s3-cloudtrail/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmknom%2Fterraform-aws-s3-cloudtrail/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmknom","download_url":"https://codeload.github.com/tmknom/terraform-aws-s3-cloudtrail/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939173,"owners_count":20857916,"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","s3","terraform","terraform-module"],"created_at":"2025-04-03T04:37:30.255Z","updated_at":"2025-04-03T04:37:30.741Z","avatar_url":"https://github.com/tmknom.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-aws-s3-cloudtrail\n\n[![CircleCI](https://circleci.com/gh/tmknom/terraform-aws-s3-cloudtrail.svg?style=svg)](https://circleci.com/gh/tmknom/terraform-aws-s3-cloudtrail)\n[![GitHub tag](https://img.shields.io/github/tag/tmknom/terraform-aws-s3-cloudtrail.svg)](https://registry.terraform.io/modules/tmknom/s3-cloudtrail/aws)\n[![License](https://img.shields.io/github/license/tmknom/terraform-aws-s3-cloudtrail.svg)](https://opensource.org/licenses/Apache-2.0)\n\nTerraform module which creates S3 Bucket resources for CloudTrail on AWS.\n\n## Description\n\nProvision [S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html) bucket\ndesigned for [CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html).\nThis module provides recommended settings.\n\n- Enable Access Logging\n- Enable Default Encryption\n- Enable Versioning\n- Enable Lifecycle Configuration\n- Protected from deletion\n\n## Usage\n\n### Minimal\n\n```hcl\nmodule \"s3_cloudtrail\" {\n  source                = \"git::https://github.com/tmknom/terraform-aws-s3-cloudtrail.git?ref=tags/1.0.0\"\n  name                  = \"s3-cloudtrail\"\n  logging_target_bucket = \"s3-access-log\"\n}\n```\n\n### Complete\n\n```hcl\nmodule \"s3_cloudtrail\" {\n  source                = \"git::https://github.com/tmknom/terraform-aws-s3-cloudtrail.git?ref=tags/1.0.0\"\n  name                  = \"s3-cloudtrail\"\n  logging_target_bucket = \"s3-access-log\"\n\n  versioning_enabled = false\n  force_destroy      = true\n\n  lifecycle_rule_enabled                     = true\n  lifecycle_rule_prefix                      = \"\"\n  standard_ia_transition_days                = \"60\"\n  glacier_transition_days                    = \"90\"\n  expiration_days                            = \"180\"\n  glacier_noncurrent_version_transition_days = \"60\"\n  noncurrent_version_expiration_days         = \"90\"\n\n  tags = {\n    Environment = \"prod\"\n    Name        = \"s3-access-log\"\n  }\n}\n```\n\n## Examples\n\n- [Minimal](https://github.com/tmknom/terraform-aws-s3-cloudtrail/tree/master/examples/minimal)\n- [Complete](https://github.com/tmknom/terraform-aws-s3-cloudtrail/tree/master/examples/complete)\n\n## Inputs\n\n| Name                                       | Description                                                                                                               |  Type  | Default | Required |\n| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- | :----: | :-----: | :------: |\n| logging_target_bucket                      | The name of the bucket that will receive the log objects.                                                                 | string |    -    |   yes    |\n| name                                       | The name of the bucket, which must comply with DNS naming conventions.                                                    | string |    -    |   yes    |\n| expiration_days                            | Specifies a period in the object's expire.                                                                                | string |  `90`   |    no    |\n| force_destroy                              | A boolean that indicates all objects should be deleted from the bucket so that the bucket can be destroyed without error. | string | `false` |    no    |\n| glacier_noncurrent_version_transition_days | Specifies when noncurrent object versions transitions.                                                                    | string |  `30`   |    no    |\n| glacier_transition_days                    | Specifies a period in the object's Glacier transitions.                                                                   | string |  `60`   |    no    |\n| lifecycle_rule_enabled                     | Specifies lifecycle rule status.                                                                                          | string | `true`  |    no    |\n| lifecycle_rule_prefix                      | Object key prefix identifying one or more objects to which the rule applies.                                              | string | `` | no |\n| noncurrent_version_expiration_days         | Specifies when noncurrent object versions expire.                                                                         | string |  `60`   |    no    |\n| standard_ia_transition_days                | Specifies a period in the object's STANDARD_IA transitions.                                                               | string |  `30`   |    no    |\n| tags                                       | A mapping of tags to assign to the bucket.                                                                                |  map   |  `{}`   |    no    |\n| versioning_enabled                         | Enable versioning. Versioning is a means of keeping multiple variants of an object in the same bucket.                    | string | `true`  |    no    |\n\n## Outputs\n\n| Name                     | Description                                                            |\n| ------------------------ | ---------------------------------------------------------------------- |\n| s3_bucket_arn            | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname.      |\n| s3_bucket_domain_name    | The bucket domain name. Will be of format bucketname.s3.amazonaws.com. |\n| s3_bucket_hosted_zone_id | The Route 53 Hosted Zone ID for this bucket's region.                  |\n| s3_bucket_id             | The name of the bucket.                                                |\n| s3_bucket_region         | The AWS region this bucket resides in.                                 |\n\n## Development\n\n### Requirements\n\n- [Docker](https://www.docker.com/)\n\n### Configure environment variables\n\n```shell\nexport AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE\nexport AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\nexport AWS_DEFAULT_REGION=ap-northeast-1\n```\n\n### Installation\n\n```shell\ngit clone git@github.com:tmknom/terraform-aws-s3-cloudtrail.git\ncd terraform-aws-s3-cloudtrail\nmake install\n```\n\n### Makefile targets\n\n```text\ncheck-format                   Check format code\ncibuild                        Execute CI build\nclean                          Clean .terraform\ndocs                           Generate docs\nformat                         Format code\nhelp                           Show help\ninstall                        Install requirements\nlint                           Lint code\nrelease                        Release GitHub and Terraform Module Registry\nterraform-apply-complete       Run terraform apply examples/complete\nterraform-apply-minimal        Run terraform apply examples/minimal\nterraform-destroy-complete     Run terraform destroy examples/complete\nterraform-destroy-minimal      Run terraform destroy examples/minimal\nterraform-plan-complete        Run terraform plan examples/complete\nterraform-plan-minimal         Run terraform plan examples/minimal\nupgrade                        Upgrade makefile\n```\n\n### Releasing new versions\n\nBump VERSION file, and run `make release`.\n\n### Terraform Module Registry\n\n- \u003chttps://registry.terraform.io/modules/tmknom/s3-cloudtrail/aws\u003e\n\n## License\n\nApache 2 Licensed. See LICENSE for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-s3-cloudtrail","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmknom%2Fterraform-aws-s3-cloudtrail","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmknom%2Fterraform-aws-s3-cloudtrail/lists"}