在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):terraform-google-modules/terraform-google-log-export开源软件地址(OpenSource Url):https://github.com/terraform-google-modules/terraform-google-log-export开源编程语言(OpenSource Language):HCL 56.5%开源软件介绍(OpenSource Introduction):Terraform Log Export ModuleThis module allows you to create log exports at the project, folder, organization, or billing account level. Submodules are also available to configure the destination resource that will store all exported logs. The resources/services/activations/deletions that this module will create/trigger are:
CompatibilityThis module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue. If you haven't upgraded and need a Terraform 0.12.x-compatible version of this module, the last released version intended for Terraform 0.12.x is v5.1.0. UsageThe examples directory contains directories for each destination, and within each destination directory are directories for each parent resource level. Consider the following example that will configure a Cloud Storage destination and a log export at the project level: module "log_export" {
source = "terraform-google-modules/log-export/google"
destination_uri = "${module.destination.destination_uri}"
filter = "severity >= ERROR"
log_sink_name = "storage_example_logsink"
parent_resource_id = "sample-project"
parent_resource_type = "project"
unique_writer_identity = true
}
module "destination" {
source = "terraform-google-modules/log-export/google//modules/storage"
project_id = "sample-project"
storage_bucket_name = "storage_example_bucket"
log_sink_writer_identity = "${module.log_export.writer_identity}"
} At first glance that example seems like a circular dependency as each module declaration is using an output from the other, however Terraform is able to collect and order all the resources so that all dependencies are met. Inputs
Outputs
RequirementsTerraform plugins
Configure a Service AccountIn order to execute this module you must have a Service Account with the following: RolesThe service account should have the following roles:
Pub/Sub rolesTo use a Google Cloud Pub/Sub topic as the destination:
To integrate the logsink with Splunk, you'll need a topic subscriber (service account):
Storage roleTo use a Google Cloud Storage bucket as the destination:
BigQuery roleTo use a BigQuery dataset as the destination, one must grant:
BigQuery OptionsTo use BigQuery Usage in module:
Enabling this option will store logs into a single table that is internally partitioned by day which can improve query performance. Enable API'sIn order to operate with the Service Account you must activate the following API's on the base project where the Service Account was created:
InstallTerraformBe sure you have the correct Terraform version (0.12.x), you can choose the binary here: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论