Skip to content

Commit 010140c

Browse files
authored
Merge pull request #212 from SumoLogic/hpal_kr_support
SUMO-247510 - Updated terraform version and added kr
2 parents bf53766 + 9fcc95a commit 010140c

File tree

19 files changed

+218
-32
lines changed

19 files changed

+218
-32
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "App Components TF template tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'application-components/**'
6+
7+
jobs:
8+
9+
ValidateTF:
10+
runs-on: ubuntu-latest
11+
name: "Validatation (format & syntax)"
12+
defaults:
13+
run:
14+
working-directory: ./application-components
15+
steps:
16+
- uses: actions/checkout@v4
17+
name: Checkout source code
18+
19+
- uses: hashicorp/setup-terraform@v3
20+
name: Setup Terraform
21+
22+
- name: Terraform fmt
23+
id: fmt
24+
run: terraform fmt -check -recursive -diff
25+
continue-on-error: true
26+
27+
- name: Terraform Init
28+
id: init
29+
run: terraform init
30+
31+
- name: Terraform Validate
32+
id: validate
33+
run: terraform validate
34+
35+
TFSecurityChecks:
36+
name: "Security Checks (checkov)"
37+
runs-on: "ubuntu-latest"
38+
steps:
39+
- name: Checkout repo
40+
uses: actions/checkout@v3
41+
42+
- uses: bridgecrewio/checkov-action@master
43+
with:
44+
directory: 'application-components/'
45+
quiet: true
46+
framework: terraform
47+
output_format: cli
48+
output_bc_ids: false
49+
download_external_modules: true
50+
skip_check: CKV_TF_1,CKV_TF_2

.github/workflows/cf-test.yml renamed to .github/workflows/awso-cf-test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
name: "CF template tests"
2-
on: [workflow_dispatch, pull_request]
1+
name: "AWSO CF template tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'aws-observability/**'
36

47
jobs:
58
ValidateLinting:
@@ -14,7 +17,7 @@ jobs:
1417

1518
- name: Print the Cloud Formation Linter Version & run Linter.
1619
run: |
17-
cfn-lint aws-observability/**/*.yaml --ignore-templates aws-observability/**/*TestTemplate.yaml --ignore-checks W3011
20+
cfn-lint aws-observability/**/*.yaml --ignore-templates aws-observability/**/*TestTemplate.yaml --ignore-checks W3011,E8001
1821
1922
CFSecurityChecksCheckovt:
2023
name: "Security Checks (checkov)"
@@ -47,4 +50,4 @@ jobs:
4750
- name: Validate with cfn_nag
4851
run: |
4952
cfn_nag_scan -i aws-observability --ignore-fatal aws-observability/**/TestTemplate.yaml
50-
continue-on-error: true
53+
continue-on-error: true

.github/workflows/tf-test.yml renamed to .github/workflows/awso-tf-test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
name: "TF template tests"
2-
on: [workflow_dispatch, pull_request]
1+
name: "AWSO TF template tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'aws-observability-terraform/**'
36

47
jobs:
58

.github/workflows/sdo-tf-test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: "SDO TF template tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'software-development-optimization-terraform/**'
6+
7+
jobs:
8+
9+
ValidateTF:
10+
runs-on: ubuntu-latest
11+
name: "Validatation (format & syntax)"
12+
defaults:
13+
run:
14+
working-directory: ./software-development-optimization-terraform
15+
steps:
16+
- uses: actions/checkout@v4
17+
name: Checkout source code
18+
19+
- uses: hashicorp/setup-terraform@v3
20+
name: Setup Terraform
21+
with:
22+
terraform_version: "0.12.31"
23+
24+
- name: Download and extract the terraform-provider-jira plugin version 0.1.11
25+
run: |
26+
curl -LO https://github.com/fourplusone/terraform-provider-jira/releases/download/v0.1.11/terraform-provider-jira_linux_amd64.zip && mkdir -p ~/.terraform.d/plugins/linux_amd64 && unzip terraform-provider-jira_linux_amd64.zip -d ~/.terraform.d/plugins/linux_amd64/ && rm terraform-provider-jira_linux_amd64.zip
27+
28+
- name: Download and install the terraform-provider-restapi plugin version 1.12.0
29+
run: |
30+
curl -LO https://github.com/Mastercard/terraform-provider-restapi/releases/download/v1.12.0/terraform-provider-restapi_v1.12.0-linux-amd64 && chmod +x terraform-provider-restapi_v1.12.0-linux-amd64 && mv terraform-provider-restapi_v1.12.0-linux-amd64 ~/.terraform.d/plugins/linux_amd64/terraform-provider-restapi
31+
32+
- name: Terraform fmt
33+
id: fmt
34+
run: terraform fmt -check -recursive -diff
35+
continue-on-error: true
36+
37+
- name: Terraform Init
38+
id: init
39+
run: terraform init
40+
41+
- name: Terraform Validate
42+
id: validate
43+
run: terraform validate
44+
45+
TFSecurityChecks:
46+
name: "Security Checks (checkov)"
47+
runs-on: "ubuntu-latest"
48+
steps:
49+
- name: Checkout repo
50+
uses: actions/checkout@v3
51+
52+
- uses: bridgecrewio/checkov-action@master
53+
with:
54+
directory: 'software-development-optimization-terraform/'
55+
quiet: true
56+
framework: terraform
57+
output_format: cli
58+
output_bc_ids: false
59+
download_external_modules: true
60+
skip_check: CKV_TF_1,CKV_TF_2

.github/workflows/slo-tf-test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "SLO Packages TF template tests"
2+
on:
3+
pull_request:
4+
paths:
5+
- 'slo_packages/**'
6+
7+
jobs:
8+
9+
ValidateTF:
10+
runs-on: ubuntu-latest
11+
name: "Validatation (format & syntax)"
12+
defaults:
13+
run:
14+
working-directory: ./slo_packages
15+
steps:
16+
- uses: actions/checkout@v4
17+
name: Checkout source code
18+
19+
- uses: hashicorp/setup-terraform@v3
20+
name: Setup Terraform
21+
22+
- name: Terraform fmt
23+
id: fmt
24+
run: terraform fmt -check -recursive -diff
25+
continue-on-error: true
26+
27+
- name: Terraform Init
28+
id: init
29+
run: terraform init
30+
31+
- name: Terraform Validate
32+
id: validate
33+
run: terraform validate
34+
35+
TFSecurityChecks:
36+
name: "Security Checks (checkov)"
37+
runs-on: "ubuntu-latest"
38+
steps:
39+
- name: Checkout repo
40+
uses: actions/checkout@v3
41+
42+
- uses: bridgecrewio/checkov-action@master
43+
with:
44+
directory: 'slo_packages/'
45+
quiet: true
46+
framework: terraform
47+
output_format: cli
48+
output_bc_ids: false
49+
download_external_modules: true
50+
skip_check: CKV_TF_1,CKV_TF_2

application-components/RESOURCES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@
243243
| <a name="input_sqlserver_monitor_folder"></a> [sqlserver\_monitor\_folder](#input\_sqlserver\_monitor\_folder) | Folder where sqlserver monitors will be created. | `string` | `"SQL Server"` | no |
244244
| <a name="input_sumologic_access_id"></a> [sumologic\_access\_id](#input\_sumologic\_access\_id) | Sumo Logic Access ID. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key | `string` | n/a | yes |
245245
| <a name="input_sumologic_access_key"></a> [sumologic\_access\_key](#input\_sumologic\_access\_key) | Sumo Logic Access Key. Visit https://help.sumologic.com/Manage/Security/Access-Keys#Create_an_access_key | `string` | n/a | yes |
246-
| <a name="input_sumologic_environment"></a> [sumologic\_environment](#input\_sumologic\_environment) | Enter au, ca, de, eu, jp, us2, in, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security | `string` | n/a | yes |
246+
| <a name="input_sumologic_environment"></a> [sumologic\_environment](#input\_sumologic\_environment) | Enter au, ca, de, eu, jp, us2, in, fed, kr or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security | `string` | n/a | yes |
247247
| <a name="input_sumologic_organization_id"></a> [sumologic\_organization\_id](#input\_sumologic\_organization\_id) | You can find your org on the Preferences page in the Sumo Logic UI. For more information, see the Preferences Page topic. Your org ID will be used to configure the IAM Role for Sumo Logic AWS Sources."<br> For more details, visit https://help.sumologic.com/01Start-Here/05Customize-Your-Sumo-Logic-Experience/Preferences-Page | `string` | n/a | yes |
248248

249249
## Outputs

application-components/common_component.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ resource "sumologic_field" "environment" {
1212
}
1313

1414

15+
resource "sumologic_field" "pod_labels_environment" {
16+
count = length(local.all_components_values) > 0 && local.has_any_kubernetes_deployments ? 1 : 0
17+
data_type = "String"
18+
field_name = "pod_labels_environment"
19+
state = "Enabled"
20+
}
21+
22+
23+
resource "sumologic_field" "pod_labels_component" {
24+
count = length(local.all_components_values) > 0 && local.has_any_kubernetes_deployments ? 1 : 0
25+
data_type = "String"
26+
field_name = "pod_labels_component"
27+
state = "Enabled"
28+
}
29+
1530
# ********************** Application Components App ********************** #
1631
locals {
1732
application_component_app_id = "22aa033e-5a36-4a20-b07d-810096e18050"

application-components/db_component.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ resource "sumologic_field" "pod_labels_db_cluster_port" {
6262
# ********************** Database component FERs ********************** #
6363

6464
resource "sumologic_field_extraction_rule" "SumoLogicFieldExtractionRulesForDatabase" {
65-
depends_on = [sumologic_field.db_cluster, sumologic_field.db_system, sumologic_field.db_cluster_address, sumologic_field.db_cluster_port, sumologic_field.pod_labels_db_cluster, sumologic_field.pod_labels_db_system, sumologic_field.pod_labels_db_cluster_address, sumologic_field.pod_labels_db_cluster_port]
65+
depends_on = [sumologic_field.db_cluster, sumologic_field.db_system, sumologic_field.db_cluster_address, sumologic_field.db_cluster_port, sumologic_field.pod_labels_db_cluster, sumologic_field.pod_labels_db_system, sumologic_field.pod_labels_db_cluster_address, sumologic_field.pod_labels_db_cluster_port,sumologic_field.component,sumologic_field.environment, sumologic_field.pod_labels_environment, sumologic_field.pod_labels_component]
6666
count = length(local.all_components_values) > 0 && local.has_any_kubernetes_deployments ? 1 : 0
6767
enabled = true
6868
name = local.database_fer_name

application-components/fields.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# ----------------------------------------------------------------------------------------------------------------------------------------------------------
44
# This script imports the existing fields and FERs (required by aws observability solution) if field(s) and FER(s) are already present in the user's Sumo Logic account.
5-
# For SUMOLOGIC_ENV, provide one from the list : au, ca, de, eu, jp, us2, in, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security"
5+
# For SUMOLOGIC_ENV, provide one from the list : au, ca, de, eu, jp, us2, in, kr, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security"
66
# Before using this script, set following environment variables using below commands:
77
# export SUMOLOGIC_ENV=""
88
# export SUMOLOGIC_ACCESSID=""
@@ -16,8 +16,8 @@ if ! foobar_loc="$(type -p "jq")" || [[ -z $foobar_loc ]]; then
1616
fi
1717

1818
# Validate Sumo Logic environment/deployment.
19-
if ! [[ "$SUMOLOGIC_ENV" =~ ^(au|ca|de|eu|jp|us2|in|fed|us1)$ ]]; then
20-
echo "$SUMOLOGIC_ENV is invalid Sumo Logic deployment. For SUMOLOGIC_ENV, provide one from list : au, ca, de, eu, jp, us2, in, fed or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security"
19+
if ! [[ "$SUMOLOGIC_ENV" =~ ^(au|ca|de|eu|jp|us2|in|fed|kr|us1)$ ]]; then
20+
echo "$SUMOLOGIC_ENV is invalid Sumo Logic deployment. For SUMOLOGIC_ENV, provide one from list : au, ca, de, eu, jp, us2, in, fed, kr or us1. For more information on Sumo Logic deployments visit https://help.sumologic.com/APIs/General-API-Information/Sumo-Logic-Endpoints-and-Firewall-Security"
2121
exit 1
2222
fi
2323

application-components/main.auto.tfvars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
####### SUMOLOGIC CONFIGURATION #######
55

6-
sumologic_environment = "" # Please replace <YOUR SUMO DEPLOYMENT> (including brackets) with au, ca, de, eu, jp, us2, in, fed or us1.
6+
sumologic_environment = "" # Please replace <YOUR SUMO DEPLOYMENT> (including brackets) with au, ca, de, eu, jp, us2, in, fed, kr or us1.
77
sumologic_access_id = "" # Please replace <YOUR SUMO ACCESS ID> (including brackets) with your Sumo Logic Access ID.
88
sumologic_access_key = "" # Please replace <YOUR SUMO ACCESS KEY> (including brackets) with your Sumo Logic Access KEY.
99
sumologic_organization_id = "" # Please replace <YOUR SUMO ORG ID> (including brackets) with your Sumo Logic Organization ID.

0 commit comments

Comments
 (0)