A pattern for creating your Google Cloud Storage Insights reports 🤖
This module will create a destination reporting bucket for any number of source storage buckets you pass to it. It will also create a storage insights report config for each source bucket you pass to it. IAM permissions will also be configured for the source and destination buckets.
Call this module using the example (below) as a starting point. Pass any additional optional parameters you require.
All of the source storage buckets passed to this module MUST be in the same project. If you want to configure Storage Insights on buckets from different projects, you will need to call the module for each project. Typically this is not an issue as most organizations will use Google's landing zone which seperates TF code by project.
module "storage_insights" {
source = "github.com/withriley/storage-insights"
project = "my-project"
source_buckets = ["bucket1", "bucket2", "bucket3"]
start_date = {
day = 20
month = 10
year = 2023
}
end_date = {
day = 18
month = 10
year = 2024
}
}
Name | Type |
---|---|
google_storage_bucket.report_bucket | resource |
google_storage_bucket_iam_member.admin | resource |
google_storage_bucket_iam_member.insights | resource |
google_storage_insights_report_config.config | resource |
random_id.suffix | resource |
google_project.project | data source |
google_storage_bucket.buckets | data source |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
csv_options | The CSV options for the storage insights report. | object({ |
{ |
no |
end_date | The end date for the storage insights report. | object({ |
n/a | yes |
frequency | Frequency for the storage insights report. | string |
"WEEKLY" |
no |
metadata_fields | The metadata fields to include in the storage insights report. | list(string) |
[ |
no |
prefix | The prefix to add to the storage insights report config display name. | string |
"Storage Insights Report" |
no |
project | The project to deploy the storage insights reports to. | string |
n/a | yes |
source_buckets | A list of the storage buckets you want to configure reports on. | list(string) |
n/a | yes |
start_date | The start date for the storage insights report. | object({ |
n/a | yes |
No outputs.