Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terraform fmt check PR action #3

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/fmt:check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Terraform Validation

on:
pull_request:
branches:
- main

jobs:
terraform:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.8.2"
- name: Terraform fmt
run: task fmt:check
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
<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

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

The variables for this module all have default values that can be overwritten
to meet your naming and compliance standards.
to meet your naming and compliance standards.

Deployment examples can be found [here](examples)
Deployment examples can be found [here](examples).

## License

The project is licensed under the [MIT][] license.

[MIT]: LICENSE
[MIT]: LICENSE
13 changes: 13 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: "3"

tasks:
fmt:
desc: Reformat your configuration in the standard style
cmds:
- terraform fmt -recursive .

fmt:check:
desc: Check if the input is formatted
cmds:
- terraform fmt -recursive -check -diff .
2 changes: 1 addition & 1 deletion modules/enrichment/services.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ locals {
}

resource "google_project_service" "services" {
for_each = toset(local.required_services)
for_each = toset(local.required_services)
project = var.project_id
service = each.value
disable_on_destroy = false
Expand Down
4 changes: 2 additions & 2 deletions modules/enrichment/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ variable "cloud_run_bucket_object_prefix" {
variable "cloud_run_locations" {
description = "The list of locations the Cloud Run service will look for applicable cloud resources"
type = list(string)
default = [
default = [
"asia-east1",
"asia-east2",
"asia-northeast1",
Expand Down Expand Up @@ -181,5 +181,5 @@ variable "message_retention_duration" {
variable "labels" {
description = "[Optional] Any Labels you wish to add to all resources deployed by this module"
type = object({})
default = {}
default = {}
}
2 changes: 1 addition & 1 deletion modules/org_iam/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "google_organization_iam_custom_role" "enrichment_folder_enum_role" {
org_id = var.organization_id
org_id = var.organization_id
permissions = [
"resourcemanager.folders.list",
"resourcemanager.folders.get",
Expand Down