Skip to content

Commit

Permalink
Reorganizing module so enrichment resources aren't in a submodule. Up…
Browse files Browse the repository at this point in the history
…dated docs. (#4)
  • Loading branch information
thathaneydude authored May 28, 2024
1 parent 6b4735b commit a2c39d8
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 10 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,30 @@

<img src="docs/overview.png" alt="overview">

## Getting Started

Corelight's GCP Cloud Enrichment requires the deployment of a supporting
Cloud Run service and its supporting infrastructure which will ensure the data
enriching your logs are always up-to-date with the latest state of your cloud
resources.

### Deployment
## Usage

```terraform
module "enrichment_org_iam" {
source = "github.com/corelight/terraform-gcp-enrichment//modules/org_iam"
organization_id = "987654321"
custom_org_role_id = "corelight_enrichment_role"
}
module "enrichment" {
source = "github.com/corelight/terraform-gcp-enrichment"
location = "us-central1"
zone = "us-central1-a"
project_id = "project-12345"
enrichment_bucket_name = "enrichment-data-54321"
folder_id = "123456789" # The root folder to enumerate
service_account_id = "enrichment-service-account"
organization_role_id = module.enrichment_org_iam.custom_org_role_id
}
```

## Deployment

The variables for this module all have default values that can be overwritten
to meet your naming and compliance standards.
Expand Down
2 changes: 1 addition & 1 deletion modules/enrichment/cloud_run.tf → cloud_run.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "google_cloud_run_v2_service" "enrichment_service" {
resources {
limits = {
cpu = 1
memory = "128Mi"
memory = "512Mi"
}
}
ports {
Expand Down
File renamed without changes.
11 changes: 10 additions & 1 deletion examples/deployment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ locals {
}
}

provider "google" {
project = local.project_id
region = local.location

# Uncomment this if needed
# user_project_override = true
}

####################################################################################################
# Set up the GCS bucket for enrichment data
####################################################################################################
Expand Down Expand Up @@ -41,9 +49,10 @@ module "custom_org_role" {

####################################################################################################
# Deploy Cloud Run service and create service account with proper permissions
# Replace relative source with "source = github.com/corelight/terraform-gcp-enrichment"
####################################################################################################
module "enrichment" {
source = "../../modules/enrichment"
source = "../.."

enrichment_bucket_name = google_storage_bucket.enrichment_bucket.name
folder_id = local.folder_to_observe
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions modules/enrichment/variables.tf → variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ variable "service_account_display_name" {
default = "Corelight Enrichment"
}

# Variables with Defaults
variable "project_role_id" {
description = "The ID of the role granting access to GCS"
type = string
Expand Down
File renamed without changes.

0 comments on commit a2c39d8

Please sign in to comment.