Skip to content

Commit

Permalink
Add terraform fmt check PR action
Browse files Browse the repository at this point in the history
  • Loading branch information
John Dewey committed May 8, 2024
1 parent aec52fd commit 8ae31d1
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
# terraform-aws-enrichment

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

## Getting Started

Corelight's AWS Cloud Enrichment requires the deployment of a lambda and its
supporting infrastructure to ensure the data in your Corelight cloud sensors are
always up-to-date with the latest state of your cloud resources.

### Preparation
Image based Lambdas must be deployed from a private Elastic Container Registry (ECR)
repository and therefore the data collection serverless container image provided by

Image based Lambdas must be deployed from a private Elastic Container Registry (ECR)
repository and therefore the data collection serverless container image provided by
Corelight must be copied from Dockerhub and pushed to your own ECR repository.

#### Copying the Corelight image

Corelight recommends install [skopeo](https://github.com/containers/skopeo/blob/main/install.md) to assist with copying this image.
```bash
AWS_ACCOUNT=<enter aws account id>
Expand Down Expand Up @@ -39,6 +43,7 @@ skopeo copy docker://$SRC_IMAGE docker://$DST_IMAGE --dest-tls-verify
```

### Deployment

The variables for this module all have default values that can be overwritten
to meet your naming and compliance standards. The only variables without defaults are
the Lambda's ECR image name and tag which you will set during preparation.
Expand All @@ -49,4 +54,4 @@ Deployment examples can be found [here](examples)

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 .

0 comments on commit 8ae31d1

Please sign in to comment.