Skip to content

Commit a906f53

Browse files
committed
Enable Jira & Gitlab integrations
1 parent 0b4f692 commit a906f53

File tree

10 files changed

+54
-27
lines changed

10 files changed

+54
-27
lines changed

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Terraform configuration used to create the required AWS resources for integratin
2323
| `account_id` | AWS Account ID number of the account in which to manage resources. | `number` | N/A | Yes |
2424
| `aws_region` | The region in which to manage resources.| `string` | N/A | Yes |
2525
| `environment` | The target environment name for deployment | `string` | `prod` | No |
26-
| `integration_type` | Spectral integration type (A unique phrase describing the integration) - Available values: `terraform` | `string` | N/A | Yes |
26+
| `integration_type` | Spectral integration type (A unique phrase describing the integration) - Available values: `terraform`, `jira` and `gitlab` | `string` | N/A | Yes |
2727
| [`env_vars`](#env_vars) | Extendable object contains all required environment variables required for the integration. | `map(string)` | N/A | No |
2828
| [`global_tags`](#global_tags) | Tags to be applied on every newly created resource. | `map(string)` | ```{ BusinessUnit = "Spectral" }``` | No |
2929
| [`tags`](#tags) | Tags to be applied on concrete resources | `map(map(string))` | ```{ iam = { } lambda = { } api_gateway = { } }``` | No |
@@ -36,24 +36,14 @@ Terraform configuration used to create the required AWS resources for integratin
3636
### env_vars
3737

3838
In some integrations, Spectral requires some extra environment variables besides the default ones.
39-
Those extra variables should be added to the `env_vars` map in addition to `CHECK_POLICY` and `SPECTRAL_DSN` which are mandatory.
39+
Those extra variables should be added to the `env_vars` map in addition to `SPECTRAL_DSN` which is mandatory.
4040

41-
Please refer to our docs to view the extra environment variables needed for the integration.
41+
Please refer to our docs / source pages to view the extra environment variables needed for the integration.
4242

4343
##### SPECTRAL_DSN (mandatory)
4444

4545
Your SpectralOps identifier, retrieved from your SpectralOps account.
4646

47-
##### CHECK_POLICY (mandatory)
48-
49-
`CHECK_POLICY` responsible for setting the minimum issue severity that should fail the check.
50-
The valid values for this field are:
51-
52-
1. Fail on any issue
53-
2. Fail on warnings and above
54-
3. Fail on errors only
55-
4. Always pass
56-
5747
### global_tags
5848

5949
This variable holds a list of tags be applied on all newly created resources:
@@ -91,7 +81,7 @@ This variable holds a collection of tags grouped by key representing its target
9181

9282
```tcl
9383
module "spectral_lambda_integration" {
94-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
84+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.2"
9585
9686
account_id = 111111111111
9787
aws_region = "us-east-1"
@@ -105,10 +95,8 @@ module "spectral_lambda_integration" {
10595
10696
# Environment variables used by the integration
10797
env_vars = {
108-
# Mandatory - Your spectral DSN retreived from SpectralOps
98+
# Mandatory - Your spectral DSN retrieved from SpectralOps
10999
SPECTRAL_DSN = ""
110-
# Mandatory - Set which severity should fail the check
111-
CHECK_POLICY = ""
112100
# Additional env-vars should go here
113101
}
114102

examples/basic-gitlab-integration.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module "spectral_lambda_integration" {
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
3+
4+
account_id = 111111111111
5+
aws_region = "us-east-1"
6+
integration_type = "gitlab"
7+
8+
env_vars = {
9+
# Required environment variables
10+
SPECTRAL_DSN = "MySpectralDSN"
11+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
12+
GITLAB_TOKEN = "MyGitlabToken"
13+
GITLAB_WEBHOOK_SECRET = "MyGitlabWebhookSecret"
14+
# Optional environment variables
15+
# STRICT_MODE = false / true
16+
# SPECTRAL_TAGS = "iac,base,audit"
17+
}
18+
}

examples/basic-jira-integration.tf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module "spectral_lambda_integration" {
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
3+
4+
account_id = 111111111111
5+
aws_region = "us-east-1"
6+
integration_type = "jira"
7+
8+
env_vars = {
9+
# Required environment variables
10+
SPECTRAL_DSN = "MySpectralDSN"
11+
JIRA_WEBHOOK_TOKEN = "MyWebhookToken"
12+
# Optional environment variables
13+
# EMAIL = "[email protected]"
14+
# JIRA_API_TOKEN = "MyJiraApiToken"
15+
# JIRA_PROJECTS_BLACKLIST = ""
16+
# JIRA_PROJECTS_WHITELIST = ""
17+
# REMEDIATION_MODE = "Redact finding" (Not active / Redact finding)
18+
# REDACTED_MESSAGE = "MyRedactedMessage"
19+
# SPECTRAL_TAGS = "iac,base,audit"
20+
}
21+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module "spectral_lambda_integration" {
2-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
33

44
account_id = 111111111111
55
aws_region = "us-east-1"
66
integration_type = "terraform"
77

88
env_vars = {
99
SPECTRAL_DSN = "MySpectralDSN"
10-
CHECK_POLICY = "Always Pass"
10+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
1111
}
1212
}

examples/custom-lambda-settings.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "spectral_lambda_integration" {
2-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
33

44
account_id = 111111111111
55
aws_region = "us-east-1"
@@ -11,6 +11,6 @@ module "spectral_lambda_integration" {
1111

1212
env_vars = {
1313
SPECTRAL_DSN = "MySpectralDSN"
14-
CHECK_POLICY = "Always Pass"
14+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
1515
}
1616
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "spectral_lambda_integration" {
2-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
33

44
account_id = 111111111111
55
aws_region = "us-east-1"
@@ -9,6 +9,6 @@ module "spectral_lambda_integration" {
99

1010
env_vars = {
1111
SPECTRAL_DSN = "MySpectralDSN"
12-
CHECK_POLICY = "Always Pass"
12+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
1313
}
1414
}

examples/extended-tags.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module "spectral_lambda_integration" {
2-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
33

44
account_id = 111111111111
55
aws_region = "us-east-1"
@@ -24,6 +24,6 @@ module "spectral_lambda_integration" {
2424

2525
env_vars = {
2626
SPECTRAL_DSN = "MySpectralDSN"
27-
CHECK_POLICY = "Always Pass"
27+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
2828
}
2929
}

examples/extra-env-vars.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module "spectral_lambda_integration" {
2-
source = "github.com/SpectralOps/spectral-terraform-lambda-integration?ref=v1.0.1"
2+
source = "github.com/SpectralOps/spectral-terraform-lambda-integration"
33

44
account_id = 111111111111
55
aws_region = "us-east-1"
66
integration_type = "terraform"
77

88
env_vars = {
99
SPECTRAL_DSN = "MySpectralDSN"
10-
CHECK_POLICY = "Always Pass"
10+
CHECK_POLICY = "Fail on any issue" # (Fail on any issue / Fail on warnings and above / Fail on errors only / Always Pass)
1111
TERRAFORM_USER_KEY = "MY-KEY"
1212
GITHUB_TOKEN = "MY-TOKEN"
1313
# Extra environment variables goes here...
745 KB
Binary file not shown.
701 KB
Binary file not shown.

0 commit comments

Comments
 (0)