Giter Club home page Giter Club logo

terraform-google-log-export's Introduction

Coalfire

Google Cloud Log Export Terraform Module

Description

This module allows you to create log exports at the project, folder, organization, or billing account level. Coalfire has tested this module with Terraform version 1.5.0 and the Hashicorp Google provider versions 4.70 - 5.0.

FedRAMP Compliance: High

Usage

module "log-export" {
    source = "github.com/Coalfire-CF/terraform-gcp-log-export"

    destination_uri = module.destination.destination_uri
    filter          = var.log_filter

    log_sink_name          = "org-log-sink"
    parent_resource_id     = "your-org-id"
    parent_resource_type   = "organization"
    include_children       = true
    unique_writer_identity = true
}

module "destination" {
    source = "github.com/Coalfire-CF/terraform-gcp-log-export/modules/pubsub"

    project_id               = google_project.management.project_id
    topic_name               = "org-logs"
    log_sink_writer_identity = module.log_export.writer_identity
    create_subscriber        = true
    kms_key_name             = "kms-key-name"
}

Requirements

No requirements.

Providers

Name Version
google n/a

Modules

No modules.

Resources

Name Type
google_logging_billing_account_sink.sink resource
google_logging_folder_sink.sink resource
google_logging_organization_sink.sink resource
google_logging_project_sink.sink resource

Inputs

Name Description Type Default Required
destination_uri The self_link URI of the destination resource (This is available as an output coming from one of the destination submodules) string n/a yes
exclusions (Optional) A list of sink exclusion filters.
list(object({
name = string,
description = string,
filter = string,
disabled = bool
}))
[] no
filter The filter to apply when exporting logs. Only log entries that match the filter are exported. Default is '' which exports all logs. string "" no
include_children Only valid if 'organization' or 'folder' is chosen as var.parent_resource.type. Determines whether or not to include children organizations/folders in the sink export. If true, logs associated with child projects are also exported; otherwise only logs relating to the provided organization/folder are included. bool false no
log_sink_name The name of the log sink to be created. string n/a yes
parent_resource_id The ID of the GCP resource in which you create the log sink. If var.parent_resource_type is set to 'project', then this is the Project ID (and etc). string n/a yes
parent_resource_type The GCP resource in which you create the log sink. The value must not be computed, and must be one of the following: 'project', 'folder', 'billing_account', or 'organization'. string "project" no
unique_writer_identity Whether or not to create a unique identity associated with this sink. If false (the default), then the writer_identity used is serviceAccount:[email protected]. If true, then a unique service account is created and used for the logging sink. bool false no

Outputs

Name Description
filter The filter to be applied when exporting logs.
log_sink_resource_id The resource ID of the log sink that was created.
log_sink_resource_name The resource name of the log sink that was created.
parent_resource_id The ID of the GCP resource in which you create the log sink.
writer_identity The service account that logging uses to write log entries to the destination.

terraform-google-log-export's People

Contributors

mscribellito avatar

Stargazers

 avatar

Watchers

 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.