Skip to content

Commit

Permalink
Merge pull request #4 from thulasirajkomminar/tk/github-actions
Browse files Browse the repository at this point in the history
added github actions for terraform
  • Loading branch information
thulasirajkomminar committed Oct 19, 2021
2 parents 0292d57 + e0e2ad4 commit 297eef1
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 44 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/terrraform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Terraform

on:
pull_request:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
terraform-fmt:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Terraform Format
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: latest
tf_actions_subcommand: fmt
tf_actions_comment: true

terraform-validate:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Terraform Init
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: latest
tf_actions_subcommand: init
tf_actions_comment: true
- name: Terraform Validate
uses: hashicorp/terraform-github-actions@master
env:
AWS_DEFAULT_REGION: eu-west-1
with:
tf_actions_version: latest
tf_actions_subcommand: validate
tf_actions_comment: true

terraform-docs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Update module usage docs and push any changes back to PR branch
uses: Dirrk/terraform-docs@v1.0.8
with:
tf_docs_args: '--sort-inputs-by-required'
tf_docs_git_commit_message: 'terraform-docs: Update module usage'
tf_docs_git_push: 'true'
tf_docs_output_file: README.md
tf_docs_output_method: inject
tf_docs_find_dir: .

tfsec:
name: tfsec
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Terraform security scan
uses: triat/terraform-security-scan@v3.0.0
73 changes: 29 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,48 @@
# terraform-aws-glue-job

<!--- BEGIN_TF_DOCS --->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.13.0 |
| aws | >= 3.10 |

## Usage

```
module "example_glue_job" {
source = "github.com/komminar/terraform-aws-glue-job?ref=v0.1.0"
name = "example-glue-job"
max_retries = 1
number_of_workers = 2
schedule = "cron(0 12 * * ? *)"
script_location = "S3://example-bucket/location/script.py"
trigger_type = "SCHEDULED"
worker_type = "Standard"
default_arguments = {
"--VAR1" = "some value"
}
tags = {
Environment = "development"
Stack = "glue"
}
}
```
## Providers

| Name | Version |
|------|---------|
| aws | >= 3.10 |

## Inputs

| Name | Description | Type | Default | Required |
|------|---------| ---------| ---------| ---------|
| name | The name of the Glue job | string| n/a | yes |
| command_name | The name of the job command | string | glueetl | no |
| connections | A list with connections for this job | list(string) | [] | no |
| default_arguments | A map with default arguments for the job | map(string) | {} | no |
| glue_version | The Glue version to use | string | 2.0 | no |
| max_capacity | The maximum number of data processing units that can be allocated | number | null | no |
| max_retries | The maximum number of times to retry the failing job | number | 0 | no |
| number_of_workers | The number of workers that are allocated when the job runs | string | null | no |
| python_version | The Python version (2 or 3) being used to execute a Python shell job | string | 3 | no |
| role_arn | An optional Glue execution role | string | null | no |
| role_policy | A valid Glue IAM policy JSON document | string | null | no |
| schedule | A cron expression used to specify the schedule for the glue trigger | string | null | no |
| schedule_active | Whether the glue trigger should be active | bool | true | no |
| script_location | The S3 path to the script that is executed by the job | string | n/a | yes |
| trigger_type | The type ('ON_DEMAND' or 'SCHEDULED') of the trigger | string | null | no |
| worker_type | The type ('Standard' or 'G.1X' or 'G.2X') of predefined worker that is allocated when the job runs | string | null | no |
| tags | A mapping of tags to assign to all resources | map(string) | n/a | yes |
|------|-------------|------|---------|:--------:|
| name | The name of the Glue job | `string` | n/a | yes |
| script\_location | The S3 path to the script that is executed by the job | `string` | n/a | yes |
| tags | A mapping of tags to assign to all resources | `map(string)` | n/a | yes |
| command\_name | The name of the job command. Defaults to glueetl | `string` | `"glueetl"` | no |
| connections | A list with connections for this job | `list(string)` | `[]` | no |
| default\_arguments | A map with default arguments for the job | `map(string)` | `{}` | no |
| glue\_version | The Glue version to use | `string` | `"2.0"` | no |
| max\_capacity | The maximum number of data processing units that can be allocated | `number` | `null` | no |
| max\_retries | The maximum number of times to retry the failing job | `number` | `0` | no |
| number\_of\_workers | The number of workers that are allocated when the job runs | `string` | `null` | no |
| python\_version | The Python version (2 or 3) being used to execute a Python shell job | `string` | `"3"` | no |
| role\_arn | An optional Glue execution role | `string` | `null` | no |
| role\_policy | A valid Glue IAM policy JSON document | `string` | `null` | no |
| schedule | A cron expression used to specify the schedule for the glue trigger | `string` | `null` | no |
| schedule\_active | Whether the glue trigger should be active | `bool` | `true` | no |
| trigger\_type | The type ('ON\_DEMAND' or 'SCHEDULED') of the trigger | `string` | `null` | no |
| worker\_type | The type ('Standard' or 'G.1X' or 'G.2X') of predefined worker that is allocated when the job runs | `string` | `null` | no |

## Outputs

| Name | Description |
|------|---------|
|------|-------------|
| arn | The Glue job ARN |
| id | The Glue job name |
| trigger_arn | The Glue trigger ARN |
| trigger_id | The Glue trigger name |
| trigger\_arn | The Glue trigger ARN |
| trigger\_id | The Glue trigger name |

<!--- END_TF_DOCS --->

0 comments on commit 297eef1

Please sign in to comment.