Git Product home page Git Product logo

terraform-logging's Introduction

terraform-logging

Terraform module to setup logging in AWS

cloudtrail

This modules allows to setup cloudtrail passing an existing s3 bucket

Variables

  • [bucket_name]: String(required): the name of the cloudtrail bucket
  • [project]: String(required): Project name to use
  • [environment]: String(required): Environment to deploy on
  • [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)
  • [is_multi_region_trail]: Boolean(optional): Specifies whether the trail is created in the current region or in all regions. (default: true)

Outputs

/

Example

module "cloudtrail" {
  source                   = "github.com/skyscrapers/terraform-logging/cloudtrail"
  bucket_name              = "test-cloudtrail-log"
  project                  = "${var.project}"
  environment              = "${var.environment}"
}

cloudtrail-s3

Terraform module to setup the cloudtrail s3 bucket and enable cloudtrail

Variables

  • [project]: String(required): Project name to use
  • [environment]: String(required): Environment to deploy on
  • [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)
  • [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)
  • [is_multi_region_trail]: Boolean(optional): Specifies whether the trail is created in the current region or in all regions. (default: true)

Outputs

/

Example

module "cloudtrail-s3" {
  source                   = "github.com/skyscrapers/terraform-logging/cloudtrail-s3"
  lifecycle_expire_enabled = true
  lifecycle_expire_days    = "365"
  project                  = "${var.project}"
  environment              = "${var.environment}"
}

cwlogs-to-es

Module 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.

Variables

  • [elasticsearch_sg_id]: String(required): Security group ID of the AWS elasticsearch service.
  • [elasticsearch_dns]: String(required): Elasticsearch DNS hostname
  • [environment]: String(required): the name of the environment these subnets belong to (prod,stag,dev)
  • [subnet_ids]: List(required): Subnet IDs you want to deploy the lambda in
  • [log_group_name]: String(required): Cloudwatch logs loggroup name to use
  • [aws_account_id]: String(optional): Your AWS account ID. Default to your current AWS account
  • [aws_region]: String(optional): AWS region where you have your AWS cloudwtach loggroup deployed in. Defaults to your current region
  • [retention_in_days]: Int(optional): How many days the lambda logs are kept. Defaults to 30 days

Example

module "cwlogs-to-es" {
  source               = "github.com/skyscrapers/terraform-logging/cwlogs-to-es"
  elasticsearch_sg_id  ="sg-224234c"
  elasticsearch_dns    = "${module.logs.endpoint}"
  environment          = "${terraform.workspace}"
  subnet_ids           = "${data.terraform_remote_state.static.private_db_subnets}"
  log_group_name       = "kubernetes"
}

terraform-logging's People

Contributors

duboisph avatar iuriaranda avatar mattiasgees avatar minniux avatar samclinckspoor avatar venturel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.