Skip to content

Commit 267b152

Browse files
test: examples and tests (#183)
1 parent 825bc44 commit 267b152

34 files changed

+270
-472
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: [main]
88
pull_request:
99
branches: [main]
10+
types: [opened, synchronize, reopened, ready_for_review]
1011

1112
# Allows you to run this workflow manually from the Actions tab
1213
workflow_dispatch:
@@ -16,6 +17,7 @@ jobs:
1617
uses: terraform-ibm-modules/common-pipeline-assets/.github/workflows/common-terraform-module-ci.yml@v1.9.1
1718
secrets: inherit
1819
with:
20+
craSCCv2: true
1921
craTarget: "examples/fscloud"
20-
craGoalIgnoreFile: "cra-tf-validate-ignore-goals.json"
21-
craEnvironmentVariables: "TF_VAR_existing_at_instance_crn=crn:v1:bluemix:public:logdnaat:eu-de:a/abac0df06b644a9cabc6e44f55b3880e:b1ef3365-dfbf-4d8f-8ac8-75f4f84d6f4a::,TF_VAR_existing_kms_instance_guid=${{ vars.HPCS_SOUTH_GUID }},TF_VAR_kms_key_crn=${{ vars.HPCS_SOUTH_KEY_CRN }}"
22+
craRuleIgnoreFile: "cra-tf-validate-ignore-rules.json"
23+
craEnvironmentVariables: "TF_VAR_existing_at_instance_crn=${{ vars.AT_INSTANCE_CRN }},TF_VAR_existing_kms_instance_guid=${{ vars.HPCS_SOUTH_GUID }},TF_VAR_kms_key_crn=${{ vars.HPCS_SOUTH_KEY_CRN }}"

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,11 @@ You need the following permissions to run this module.
5353
<!-- BEGIN EXAMPLES HOOK -->
5454
## Examples
5555

56-
- [ Autoscale example](examples/autoscale)
5756
- [ Restore from backup example](examples/backup)
58-
- [ Complete example with byok encryption, CBR rules and storing credentials in secrets manager](examples/complete)
59-
- [ Default example](examples/default)
57+
- [ Basic example](examples/basic)
58+
- [ Complete example with BYOK encryption, autoscaling, CBR rules, VPE creation and read-only replica provisioning](examples/complete)
6059
- [ Financial Services Cloud profile example](examples/fscloud)
6160
- [ Point in time recovery example (PITR)](examples/pitr)
62-
- [ Replica example](examples/replica)
6361
<!-- END EXAMPLES HOOK -->
6462
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6563
## Requirements

cra-tf-validate-ignore-goals.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

cra-tf-validate-ignore-rules.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"scc_rules": [
3+
{
4+
"scc_rule_id": "rule-9b2d8054-bc93-44fd-901b-91f677287e84",
5+
"description": "Check whether Databases for PostgreSQL network access is restricted to a specific IP range",
6+
"ignore_reason": "This module supports restricting network access using Context Based Restrictions (CBRs), however SCC does not yet support scanning for CBR rules, hence the rule currently fails. SCC CBR support is being tracked in AHA SCC-961",
7+
"is_valid": true
8+
},
9+
{
10+
"scc_rule_id": "rule-216e2449-27d7-4afc-929a-b66e196a9cf9",
11+
"description": "Check whether Flow Logs for VPC are enabled",
12+
"ignore_reason": "This rule is not relevant to the module itself, just the VPC resource is used in the example that is scanned",
13+
"is_valid": false
14+
}
15+
]
16+
}

examples/autoscale/README.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/autoscale/main.tf

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/autoscale/variables.tf

Lines changed: 0 additions & 89 deletions
This file was deleted.

examples/backup/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module "postgresql_db" {
1414
source = "../.."
1515
resource_group_id = module.resource_group.resource_group_id
1616
name = "${var.prefix}-postgres"
17+
pg_version = var.pg_version
1718
region = var.region
1819
resource_tags = var.resource_tags
1920
}
@@ -28,6 +29,7 @@ module "restored_postgresql_db" {
2829
source = "../.."
2930
resource_group_id = module.resource_group.resource_group_id
3031
name = "${var.prefix}-postgres-restored"
32+
pg_version = var.pg_version
3133
region = var.region
3234
resource_tags = var.resource_tags
3335
backup_crn = var.postgresql_db_backup_crn == null ? data.ibm_database_backups.backup_database[0].backups[0].backup_id : var.postgresql_db_backup_crn

examples/backup/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ variable "prefix" {
1616
default = "pg-res"
1717
}
1818

19+
variable "pg_version" {
20+
description = "Version of the postgresql instance"
21+
type = string
22+
default = null
23+
}
24+
1925
variable "resource_group" {
2026
type = string
2127
description = "An existing resource group name to use for this example, if unset a new resource group will be created"

0 commit comments

Comments
 (0)