{"id":19165335,"url":"https://github.com/skyscrapers/terraform-logging","last_synced_at":"2025-05-07T12:23:18.343Z","repository":{"id":71000310,"uuid":"77231570","full_name":"skyscrapers/terraform-logging","owner":"skyscrapers","description":null,"archived":false,"fork":false,"pushed_at":"2019-08-19T14:29:34.000Z","size":24,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-19T22:02:28.872Z","etag":null,"topics":["aws","aws-cloudtrail","cloudtrail","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":null,"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/skyscrapers.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":"2016-12-23T14:48:17.000Z","updated_at":"2022-09-11T03:04:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"963ae634-f183-4019-aa48-ded7848039a0","html_url":"https://github.com/skyscrapers/terraform-logging","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-logging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-logging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-logging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skyscrapers%2Fterraform-logging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skyscrapers","download_url":"https://codeload.github.com/skyscrapers/terraform-logging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874616,"owners_count":21817864,"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","aws-cloudtrail","cloudtrail","terraform","terraform-modules"],"created_at":"2024-11-09T09:27:28.410Z","updated_at":"2025-05-07T12:23:18.318Z","avatar_url":"https://github.com/skyscrapers.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terraform-logging\n\nTerraform module to setup logging in AWS\n\n## cloudtrail\n\nThis modules allows to setup cloudtrail passing an existing s3 bucket\n\n### Variables\n\n* [`bucket_name`]: String(required): the name of the cloudtrail bucket\n* [`project`]: String(required): Project name to use\n* [`environment`]: String(required): Environment to deploy on\n* [`include_global_service_events`]: Boolean(optional): Specifies whether the trail is publishing events from global services such as IAM to the log files. (default: true)\n* [`is_multi_region_trail`]: Boolean(optional): Specifies whether the trail is created in the current region or in all regions. (default: true)\n\n### Outputs\n\n/\n\n### Example\n\n```hcl\nmodule \"cloudtrail\" {\n  source                   = \"github.com/skyscrapers/terraform-logging/cloudtrail\"\n  bucket_name              = \"test-cloudtrail-log\"\n  project                  = \"${var.project}\"\n  environment              = \"${var.environment}\"\n}\n\n```\n\n## cloudtrail-s3\n\nTerraform module to setup the cloudtrail s3 bucket and enable cloudtrail\n\n### Variables\n\n* [`project`]: String(required): Project name to use\n* [`environment`]: String(required): Environment to deploy on\n* [`lifecycle_expire_enabled`]: String(required)\n* [`versioning_enabled`]: String(required)\n* [`include_global_service_events`]: Boolean(optional): Specifies whether the trail is publishing events from global services such as IAM to the log files. (default: true)\n* [`expired_object_delete_marker`]: String(optional) On a versioned bucket (versioning-enabled or versioning-suspended bucket), you can add this element in the lifecycle configuration to direct Amazon S3 to delete expired object delete markers. (default: false)\n* [`is_multi_region_trail`]: Boolean(optional): Specifies whether the trail is created in the current region or in all regions. (default: true)\n\n### Outputs\n\n/\n\n### Example\n\n```hcl\nmodule \"cloudtrail-s3\" {\n  source                   = \"github.com/skyscrapers/terraform-logging/cloudtrail-s3\"\n  lifecycle_expire_enabled = true\n  lifecycle_expire_days    = \"365\"\n  project                  = \"${var.project}\"\n  environment              = \"${var.environment}\"\n}\n```\n\n## cwlogs-to-es\n\nModule to ship AWS Cloudwatch logs to AWS Elasticsearch. This assumes that your AWS Elasticsearch is running inside a VPC and your Lambda will be deployed inside that VPC. The needed IAM rights + securitygroups and rules are created. To make this work, you need to choose a subnet that has access to the AWS elasticsearch service.\n\n### Variables\n\n* [`elasticsearch_sg_id`]: String(required): Security group ID of the AWS elasticsearch service.\n* [`elasticsearch_dns`]: String(required): Elasticsearch DNS hostname\n* [`environment`]: String(required): the name of the environment these subnets belong to (prod,stag,dev)\n* [`subnet_ids`]: List(required): Subnet IDs you want to deploy the lambda in\n* [`log_group_name`]: String(required): Cloudwatch logs loggroup name to use\n* [`aws_account_id`]: String(optional): Your AWS account ID. Default to your current AWS account\n* [`aws_region`]: String(optional): AWS region where you have your AWS cloudwtach loggroup deployed in. Defaults to your current region\n* [`retention_in_days`]: Int(optional): How many days the lambda logs are kept. Defaults to 30 days\n\n### Example\n\n```hcl\nmodule \"cwlogs-to-es\" {\n  source               = \"github.com/skyscrapers/terraform-logging/cwlogs-to-es\"\n  elasticsearch_sg_id  =\"sg-224234c\"\n  elasticsearch_dns    = \"${module.logs.endpoint}\"\n  environment          = \"${terraform.workspace}\"\n  subnet_ids           = \"${data.terraform_remote_state.static.private_db_subnets}\"\n  log_group_name       = \"kubernetes\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-logging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskyscrapers%2Fterraform-logging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskyscrapers%2Fterraform-logging/lists"}