@hiiretail/gcp-infra-cli 0.104.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -46
- package/bin/gcp-infra +5 -2
- package/package.json +7 -30
- package/src/gcp-infra.js +90 -0
- package/LICENSE +0 -21
- package/generators/clan-resources/clan-project/generator.json +0 -4
- package/generators/clan-resources/clan-project/index.js +0 -135
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat/terragrunt.hcl +0 -52
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat-static-ip/spec.hcl +0 -7
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-nat-static-ip/terragrunt.hcl +0 -25
- package/generators/clan-resources/clan-project/templates/clan-resources/cloud-router/terragrunt.hcl +0 -34
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/gke-resources/terragrunt.hcl +0 -40
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/spec.hcl +0 -18
- package/generators/clan-resources/clan-project/templates/clan-resources/gke/terragrunt.hcl +0 -52
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/config/main.tf +0 -41
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/config/vars.tf +0 -9
- package/generators/clan-resources/clan-project/templates/clan-resources/network/firewall-rules/terragrunt.hcl +0 -32
- package/generators/clan-resources/clan-project/templates/clan-resources/network/spec.hcl +0 -54
- package/generators/clan-resources/clan-project/templates/clan-resources/network/terragrunt.hcl +0 -29
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/config/main.tf +0 -18
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/config/vars.tf +0 -27
- package/generators/clan-resources/clan-project/templates/clan-resources/private-vpc-connection/terragrunt.hcl +0 -35
- package/generators/clan-resources/clan-project/templates/clan-resources/serverless-vpc-connector/terragrunt.hcl +0 -40
- package/generators/clan-resources/clan-project/templates/clan-resources/terragrunt.hcl +0 -3
- package/generators/clan-resources/command.json +0 -7
- package/generators/common-resources/bigquery/generator.json +0 -4
- package/generators/common-resources/bigquery/index.js +0 -284
- package/generators/common-resources/bigquery/templates/bigquery/spec.hcl +0 -8
- package/generators/common-resources/bigquery/templates/bigquery/terragrunt.hcl +0 -53
- package/generators/common-resources/bigquery/templates/scheduled-queries/terragrunt.hcl +0 -56
- package/generators/common-resources/bigquery/templates/schema/schema.json +0 -14
- package/generators/common-resources/budget/generator.json +0 -4
- package/generators/common-resources/budget/index.js +0 -89
- package/generators/common-resources/budget/templates/budget/terragrunt.hcl +0 -45
- package/generators/common-resources/cloud-armor/generator.json +0 -4
- package/generators/common-resources/cloud-armor/index.js +0 -45
- package/generators/common-resources/cloud-armor/templates/policies.yaml +0 -53
- package/generators/common-resources/cloud-armor/templates/terragrunt.hcl +0 -30
- package/generators/common-resources/cloud-storage/generator.json +0 -4
- package/generators/common-resources/cloud-storage/index.js +0 -156
- package/generators/common-resources/cloud-storage/templates/cloud-storage/storage.yaml +0 -26
- package/generators/common-resources/cloud-storage/templates/cloud-storage/terragrunt.hcl +0 -32
- package/generators/common-resources/cloudsql/generator.json +0 -4
- package/generators/common-resources/cloudsql/index.js +0 -106
- package/generators/common-resources/cloudsql/templates/mssql/instance/spec.hcl +0 -76
- package/generators/common-resources/cloudsql/templates/mssql/instance/terragrunt.hcl +0 -38
- package/generators/common-resources/cloudsql/templates/mssql/instance-secrets/terragrunt.hcl +0 -37
- package/generators/common-resources/cloudsql/templates/mysql/instance/spec.hcl +0 -73
- package/generators/common-resources/cloudsql/templates/mysql/instance/terragrunt.hcl +0 -40
- package/generators/common-resources/cloudsql/templates/mysql/instance-secrets/terragrunt.hcl +0 -38
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance/spec.hcl +0 -102
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance/terragrunt.hcl +0 -36
- package/generators/common-resources/cloudsql/templates/postgres-clan/instance-secrets/terragrunt.hcl +0 -44
- package/generators/common-resources/cloudsql-database/generator.json +0 -4
- package/generators/common-resources/cloudsql-database/index.js +0 -70
- package/generators/common-resources/cloudsql-database/templates/mysql/database/proxy_port.hcl +0 -4
- package/generators/common-resources/cloudsql-database/templates/mysql/database/terragrunt.hcl +0 -69
- package/generators/common-resources/cloudsql-database/templates/mysql/outputs.json +0 -5
- package/generators/common-resources/cloudsql-database/templates/mysql/secrets/terragrunt.hcl +0 -30
- package/generators/common-resources/cloudsql-database/templates/postgres/database/proxy_port.hcl +0 -4
- package/generators/common-resources/cloudsql-database/templates/postgres/database/spec.hcl +0 -17
- package/generators/common-resources/cloudsql-database/templates/postgres/database/terragrunt.hcl +0 -74
- package/generators/common-resources/cloudsql-database/templates/postgres/outputs.json +0 -5
- package/generators/common-resources/cloudsql-database/templates/postgres/secrets/terragrunt.hcl +0 -30
- package/generators/common-resources/command.json +0 -8
- package/generators/common-resources/confluent-cluster/generator.json +0 -4
- package/generators/common-resources/confluent-cluster/index.js +0 -52
- package/generators/common-resources/confluent-cluster/templates/confluent/spec.hcl +0 -5
- package/generators/common-resources/confluent-cluster/templates/confluent/terragrunt.hcl +0 -25
- package/generators/common-resources/datastore/generator.json +0 -4
- package/generators/common-resources/datastore/index.js +0 -91
- package/generators/common-resources/datastore/templates/datastore/indexes.yaml +0 -6
- package/generators/common-resources/datastore/templates/datastore/terragrunt.hcl +0 -23
- package/generators/common-resources/elastic-cloud/generator.json +0 -4
- package/generators/common-resources/elastic-cloud/index.js +0 -52
- package/generators/common-resources/elastic-cloud/templates/elastic/spec.hcl +0 -27
- package/generators/common-resources/elastic-cloud/templates/elastic/terragrunt.hcl +0 -27
- package/generators/common-resources/elastic-index-policy/generator.json +0 -4
- package/generators/common-resources/elastic-index-policy/handle-yaml.js +0 -76
- package/generators/common-resources/elastic-index-policy/index.js +0 -210
- package/generators/common-resources/elastic-index-policy/templates/policy/policy.yaml +0 -28
- package/generators/common-resources/elastic-index-policy/templates/policy/terragrunt.hcl +0 -25
- package/generators/common-resources/elastic-template/generator.json +0 -4
- package/generators/common-resources/elastic-template/index.js +0 -84
- package/generators/common-resources/elastic-template/templates/elastic-template/mappings.json +0 -1
- package/generators/common-resources/elastic-template/templates/elastic-template/terragrunt.hcl +0 -35
- package/generators/common-resources/firestore/generator.json +0 -4
- package/generators/common-resources/firestore/index.js +0 -141
- package/generators/common-resources/firestore/templates/firestore/indexes/indexes.yaml +0 -12
- package/generators/common-resources/firestore/templates/firestore/indexes/terragrunt.hcl +0 -27
- package/generators/common-resources/firestore/templates/firestore/spec.hcl +0 -31
- package/generators/common-resources/firestore/templates/firestore/terragrunt.hcl +0 -25
- package/generators/common-resources/iam/generator.json +0 -4
- package/generators/common-resources/iam/index.js +0 -62
- package/generators/common-resources/iam/templates/github/workflows/iam.yml +0 -18
- package/generators/common-resources/iam/templates/iam.yaml +0 -8
- package/generators/common-resources/iam/valid-prefix.js +0 -8
- package/generators/common-resources/kafka-connect/generator.json +0 -4
- package/generators/common-resources/kafka-connect/index.js +0 -75
- package/generators/common-resources/kafka-connect/templates/elastic/terragrunt.hcl +0 -92
- package/generators/common-resources/kafka-connect/templates/pubsub/terragrunt.hcl +0 -75
- package/generators/common-resources/kafka-topics/generator.json +0 -4
- package/generators/common-resources/kafka-topics/index.js +0 -54
- package/generators/common-resources/kafka-topics/templates/kafka/kafka.yaml +0 -20
- package/generators/common-resources/kafka-topics/templates/kafka/terragrunt.hcl +0 -21
- package/generators/common-resources/kms/generator.json +0 -4
- package/generators/common-resources/kms/index.js +0 -69
- package/generators/common-resources/kms/templates/kms/spec.hcl +0 -5
- package/generators/common-resources/kms/templates/kms/terragrunt.hcl +0 -33
- package/generators/common-resources/memorystore/generator.json +0 -4
- package/generators/common-resources/memorystore/index.js +0 -69
- package/generators/common-resources/memorystore/templates/outputs.json +0 -3
- package/generators/common-resources/memorystore/templates/redis-instance/spec.hcl +0 -16
- package/generators/common-resources/memorystore/templates/redis-instance/terragrunt.hcl +0 -35
- package/generators/common-resources/memorystore/templates/secrets/terragrunt.hcl +0 -31
- package/generators/common-resources/monitoring/generator.json +0 -4
- package/generators/common-resources/monitoring/handle-yaml.js +0 -48
- package/generators/common-resources/monitoring/index.js +0 -192
- package/generators/common-resources/monitoring/templates/alerts/generic-infra.yaml +0 -633
- package/generators/common-resources/monitoring/templates/alerts/terragrunt.hcl +0 -37
- package/generators/common-resources/monitoring/templates/service/service.yaml +0 -16
- package/generators/common-resources/monitoring/templates/service/terragrunt.hcl +0 -37
- package/generators/common-resources/monitoring/templates/uptime-checks/terragrunt.hcl +0 -36
- package/generators/common-resources/monitoring/templates/uptime-checks/uptime-checks.yaml +0 -3
- package/generators/common-resources/monitoring/validate.js +0 -58
- package/generators/common-resources/pubsub/append.js +0 -120
- package/generators/common-resources/pubsub/generator.json +0 -4
- package/generators/common-resources/pubsub/get-gcp-projects.js +0 -34
- package/generators/common-resources/pubsub/handle-subscribers.js +0 -63
- package/generators/common-resources/pubsub/index.js +0 -316
- package/generators/common-resources/pubsub/templates/pubsub/spec.hcl +0 -7
- package/generators/common-resources/pubsub/templates/pubsub/subscribers.yaml +0 -16
- package/generators/common-resources/pubsub/templates/pubsub/terragrunt.hcl +0 -34
- package/generators/common-resources/pubsub/templates/pubsub-dlq/terragrunt.hcl +0 -42
- package/generators/common-resources/pubsub/templates/pubsub-external/spec.hcl +0 -10
- package/generators/common-resources/pubsub/templates/pubsub-external/subscribers.yaml +0 -16
- package/generators/common-resources/pubsub/templates/pubsub-external/terragrunt.hcl +0 -31
- package/generators/common-resources/pubsub/validate.js +0 -44
- package/generators/common-resources/scheduler/append.js +0 -83
- package/generators/common-resources/scheduler/generator.json +0 -4
- package/generators/common-resources/scheduler/index.js +0 -103
- package/generators/common-resources/scheduler/templates/scheduler/terragrunt.hcl +0 -44
- package/generators/common-resources/spanner/append.js +0 -27
- package/generators/common-resources/spanner/generator.json +0 -4
- package/generators/common-resources/spanner/index.js +0 -169
- package/generators/common-resources/spanner/templates/spanner/databases.yaml +0 -5
- package/generators/common-resources/spanner/templates/spanner/spec.hcl +0 -22
- package/generators/common-resources/spanner/templates/spanner/terragrunt.hcl +0 -33
- package/generators/common-resources/spanner/validate.js +0 -38
- package/generators/docs/command.json +0 -7
- package/generators/docs/rca/generator.json +0 -4
- package/generators/docs/rca/index.js +0 -50
- package/generators/docs/rca/templates/docs/rca_external.md +0 -43
- package/generators/docs/rca/templates/docs/rca_internal.md +0 -88
- package/generators/docs/runbook/generator.json +0 -4
- package/generators/docs/runbook/index.js +0 -42
- package/generators/docs/runbook/templates/docs/runbook.md +0 -106
- package/generators/docs/srb/generator.json +0 -4
- package/generators/docs/srb/index.js +0 -62
- package/generators/docs/srb/templates/docs/README.md +0 -42
- package/generators/docs/srb/templates/docs/adr.cmd +0 -3
- package/generators/docs/srb/templates/docs/adr.sh +0 -4
- package/generators/docs/srb/templates/docs/architecture.md +0 -68
- package/generators/docs/srb/templates/docs/cost-estimates.md +0 -39
- package/generators/docs/srb/templates/docs/dsl2png.cmd +0 -3
- package/generators/docs/srb/templates/docs/dsl2png.sh +0 -4
- package/generators/docs/srb/templates/docs/sre.md +0 -43
- package/generators/docs/srb/templates/sample.dsl +0 -36
- package/generators/init/clan-infra/gcp-projects.js +0 -36
- package/generators/init/clan-infra/generator.json +0 -4
- package/generators/init/clan-infra/index.js +0 -170
- package/generators/init/clan-infra/templates/.yamllint +0 -17
- package/generators/init/clan-infra/templates/env/project.hcl +0 -15
- package/generators/init/clan-infra/templates/env/secrets/secrets.yaml +0 -4
- package/generators/init/clan-infra/templates/env/secrets/terragrunt.hcl +0 -31
- package/generators/init/clan-infra/templates/github/CODEOWNERS +0 -1
- package/generators/init/clan-infra/templates/github/workflows/infra-verify.yml +0 -16
- package/generators/init/clan-infra/templates/github/workflows/infra.yml +0 -17
- package/generators/init/clan-infra/templates/github/workflows/release-notes.yml +0 -33
- package/generators/init/clan-infra/templates/github/workflows/sync-docs.yml +0 -29
- package/generators/init/clan-infra/templates/infra/.terraform-version +0 -1
- package/generators/init/clan-infra/templates/infra/.terragrunt-version +0 -1
- package/generators/init/clan-infra/templates/infra/README.md +0 -5
- package/generators/init/clan-infra/templates/infra/common.hcl +0 -24
- package/generators/init/clan-infra/templates/infra/terragrunt_root.hcl +0 -44
- package/generators/init/clan-infra/templates/notification-channels/notification-channels.yaml +0 -7
- package/generators/init/clan-infra/templates/notification-channels/terragrunt.hcl +0 -29
- package/generators/init/clan-infra/templates/release-notes/example-service.yaml +0 -23
- package/generators/init/clan-infra/templates/release-notes-schema/release-notes.schema.json +0 -63
- package/generators/init/clan-infra/tribe-clan-repo.js +0 -38
- package/generators/init/clan-infra/validate.js +0 -8
- package/generators/init/command.json +0 -7
- package/generators/maintenance/command.json +0 -7
- package/generators/maintenance/manage-states/generator.json +0 -4
- package/generators/maintenance/manage-states/index.js +0 -188
- package/generators/maintenance/update-modules/generator.json +0 -4
- package/generators/maintenance/update-modules/index.js +0 -102
- package/generators/organization/clan-project/__tests__/__snapshots__/googlecloud.test.js.snap +0 -27
- package/generators/organization/clan-project/generator.json +0 -4
- package/generators/organization/clan-project/googlecloud.js +0 -119
- package/generators/organization/clan-project/index.js +0 -139
- package/generators/organization/clan-project/templates/clan/clan.yaml +0 -22
- package/generators/organization/clan-project/templates/clan/terragrunt.hcl +0 -39
- package/generators/organization/clan-project/templates/clan-project/project.yaml +0 -14
- package/generators/organization/clan-project/templates/clan-project/terragrunt.hcl +0 -51
- package/generators/organization/clan-project/templates/clans-folder/terragrunt.hcl +0 -3
- package/generators/organization/clan-project/templates/department/terragrunt.hcl +0 -32
- package/generators/organization/clan-project/templates/tribe/terragrunt.hcl +0 -67
- package/generators/organization/clan-project/templates/tribe/tribe.yaml +0 -19
- package/generators/organization/command.json +0 -8
- package/src/BaseGenerator.js +0 -73
- package/src/SecretsGenerator.js +0 -105
- package/src/cli.js +0 -73
- package/src/dependency-check.js +0 -48
- package/src/update-check.js +0 -30
- package/src/validators.js +0 -32
- package/src/yeoman.js +0 -71
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Terragrunt will copy the Terraform configurations specified by the source parameter, along with any files in the
|
|
2
|
-
# working directory, into a temporary folder, and execute your Terraform commands in that folder.
|
|
3
|
-
terraform {
|
|
4
|
-
source = "git::https://github.com/extenda/tf-module-gcp-spanner//?ref=v1.0.0"
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
# Include all settings from the root terragrunt.hcl file
|
|
8
|
-
include {
|
|
9
|
-
path = find_in_parent_folders("terragrunt_root.hcl")
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
locals {
|
|
13
|
-
spec_vars = read_terragrunt_config("${get_terragrunt_dir()}/spec.hcl")
|
|
14
|
-
project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
|
|
15
|
-
common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
|
|
16
|
-
labels = merge(local.common_vars.locals.default_user_labels, local.project_vars.locals.default_user_labels, {
|
|
17
|
-
component = local.common_vars.locals.component
|
|
18
|
-
created = "terraform"
|
|
19
|
-
product = local.common_vars.locals.product
|
|
20
|
-
tenant-alias = local.common_vars.locals.tenant_alias
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
# These are the variables we have to pass in to use the module specified in the terragrunt configuration above
|
|
25
|
-
inputs = merge(<% if (resourceType == 'instance') { %><% } else { %>
|
|
26
|
-
yamldecode(
|
|
27
|
-
file("${get_terragrunt_dir()}/databases.yaml")),<% } %>
|
|
28
|
-
local.spec_vars.locals,
|
|
29
|
-
local.project_vars.locals,
|
|
30
|
-
{
|
|
31
|
-
instance_labels = local.labels
|
|
32
|
-
}
|
|
33
|
-
)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const validName = (input) => {
|
|
2
|
-
if (input.replace(/\s/g, '').length >= 6 && input.length <= 30) {
|
|
3
|
-
return true;
|
|
4
|
-
}
|
|
5
|
-
return 'Name must be between 6 and 30 characters in length';
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const validRetentionPeriod = (input) => {
|
|
9
|
-
const validFormats = /^(84000s|1h|2d|7d)$/;
|
|
10
|
-
|
|
11
|
-
if (input === '') {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (validFormats.test(input)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return 'Invalid retention period format. Possible values are 84000s, 1h, 2d, or leave empty for default value 1h';
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const validBackupSchedule = (input) => {
|
|
22
|
-
const validFormats = /^(((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5}$/;
|
|
23
|
-
|
|
24
|
-
if (input === '') {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
if (validFormats.test(input)) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return 'Invalid backup schedule format. Possible values are cron expressions like "0 2 * * *"';
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
module.exports = {
|
|
35
|
-
validName,
|
|
36
|
-
validRetentionPeriod,
|
|
37
|
-
validBackupSchedule,
|
|
38
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
3
|
-
const { required } = require('../../../src/validators');
|
|
4
|
-
|
|
5
|
-
module.exports = class extends BaseGenerator {
|
|
6
|
-
prompting() {
|
|
7
|
-
const prompts = [
|
|
8
|
-
{
|
|
9
|
-
type: 'input',
|
|
10
|
-
name: 'description',
|
|
11
|
-
message: 'A very short description of the problem',
|
|
12
|
-
validate: required,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
type: 'input',
|
|
16
|
-
name: 'date',
|
|
17
|
-
message: 'Date of the incident',
|
|
18
|
-
validate: required,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
|
|
22
|
-
return this.prompt(prompts).then((props) => {
|
|
23
|
-
this.answers = props;
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
writing() {
|
|
28
|
-
const { date } = this.answers;
|
|
29
|
-
const filenameInternal = 'rca_internal';
|
|
30
|
-
const filenameExternal = 'rca_external';
|
|
31
|
-
|
|
32
|
-
this.fs.copyTpl(
|
|
33
|
-
this.templatePath('docs', 'rca_internal.md'),
|
|
34
|
-
this.destinationPath('docs', 'rca', date, `${filenameInternal}.md`),
|
|
35
|
-
this.answers,
|
|
36
|
-
);
|
|
37
|
-
this.fs.copyTpl(
|
|
38
|
-
this.templatePath('docs', 'rca_external.md'),
|
|
39
|
-
this.destinationPath('docs', 'rca', date, `${filenameExternal}.md`),
|
|
40
|
-
this.answers,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
end() {
|
|
45
|
-
this.log(`
|
|
46
|
-
${chalk.green('Your RCA template have now been created.')}
|
|
47
|
-
Next, push this change in a feature branch and open a pull request.
|
|
48
|
-
`);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# RCA External - <%-description%> - <%-date%>
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
|
|
5
|
-
<!--
|
|
6
|
-
Briefly summarize what happened, who was impacted (e.g., end-users, stores), and the business consequences (e.g., data loss, incorrect pricing, downtime).
|
|
7
|
-
* Incident Description: Brief overview of what happened (2-3 sentences)
|
|
8
|
-
* Root Cause: One-sentence explanation of the fundamental issue
|
|
9
|
-
* Resolution: Brief description of how the issue was resolved
|
|
10
|
-
* Resolution Time: When the issue was fully resolved
|
|
11
|
-
-->
|
|
12
|
-
|
|
13
|
-
## Technical Details
|
|
14
|
-
|
|
15
|
-
<!--
|
|
16
|
-
Provide a clear explanation of the technical root cause. Include:
|
|
17
|
-
* What change or event triggered the incident
|
|
18
|
-
* How the system behaved unexpectedly
|
|
19
|
-
* Details about any configuration changes, bugs, or missing logic
|
|
20
|
-
|
|
21
|
-
Any dependencies or services involved.
|
|
22
|
-
-->
|
|
23
|
-
|
|
24
|
-
## Impact
|
|
25
|
-
|
|
26
|
-
<!--
|
|
27
|
-
Describe the direct and indirect consequences of the incident.
|
|
28
|
-
* Customer Impact: How customers/end-users were affected
|
|
29
|
-
* Business Impact: Financial or operational consequences
|
|
30
|
-
* Duration: Total time the issue persisted
|
|
31
|
-
* Scope: Which systems/users were affected
|
|
32
|
-
-->
|
|
33
|
-
|
|
34
|
-
## Lessons Learned
|
|
35
|
-
|
|
36
|
-
<!--
|
|
37
|
-
Highlight what could have prevented the incident:
|
|
38
|
-
|
|
39
|
-
* Gaps in testing
|
|
40
|
-
* Gaps in monitoring
|
|
41
|
-
* Gaps in requirements
|
|
42
|
-
* etc.
|
|
43
|
-
-->
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# RCA Internal - <%-description%> - <%-date%>
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
**Incident start**: <!-- The date and time when the incident started, for example: 2022-06-14 14.36 CET -->
|
|
6
|
-
|
|
7
|
-
**Incident end**: <!-- The date and time when the incident was resolved, for example: 2022-06-14 14.53 CET -->
|
|
8
|
-
|
|
9
|
-
**Problem statement**: <!-- Describe what the problem was. It is important to keep this short, one or two sentances are enough. Example: An Out of Memory error was thrown -->
|
|
10
|
-
|
|
11
|
-
**Impacted customer(s)**: <!-- What customer(s) that were affected -->
|
|
12
|
-
|
|
13
|
-
**Impact to customer**: <!-- Describe how the customer, and end customers, was affected by the incident. Where they completely unable to use the system? Or was there some feature that wasn't working? -->
|
|
14
|
-
|
|
15
|
-
**Ticket information**:
|
|
16
|
-
|
|
17
|
-
<!-- Add link(s) to any Jira issues in the format of:
|
|
18
|
-
|
|
19
|
-
- [EXTINTERAL-1234](https://extendaretail.atlassian.net/browse/EXTINTERAL-1234)
|
|
20
|
-
|
|
21
|
-
-->
|
|
22
|
-
|
|
23
|
-
**Services involved**: <!-- List the Hii Retail-service(s) that were involved in the incident, for example checkout-poslog. If multiple services/systems are involved, just mention the systems such as: Checkout Engine, Store Data etc. -->
|
|
24
|
-
|
|
25
|
-
## Summary
|
|
26
|
-
|
|
27
|
-
<!--
|
|
28
|
-
This section should be written last, when all of the other bullets in the RCA has been written. The summary should include:
|
|
29
|
-
|
|
30
|
-
* What the problem statement was, what the root cause of it was and a short summary of the highest prioritized action points.
|
|
31
|
-
-->
|
|
32
|
-
|
|
33
|
-
## Sequence of Events
|
|
34
|
-
|
|
35
|
-
<!--
|
|
36
|
-
Describe the events that caused the incident, starting from when the issues started up until the incident was resolved. If no alert was triggered, the first event would be when the issues first started.
|
|
37
|
-
|
|
38
|
-
Example:
|
|
39
|
-
|
|
40
|
-
- 2024-03-27 14.36 CET - Alert X was triggered
|
|
41
|
-
- 2024-03-27 14.36 CET - Team started working on the incident
|
|
42
|
-
- 2024-03-27 14.49 CET - A fix was pushed and deployed
|
|
43
|
-
- 2024-03-27 14.53 CET - Incident was resolved
|
|
44
|
-
-->
|
|
45
|
-
|
|
46
|
-
## Five Whys
|
|
47
|
-
|
|
48
|
-
<!--
|
|
49
|
-
Five whys is a technique used to explore the cause and effect underlying a particular problem. The primary goal of the technique is to determine the root cause of a problem by repeating the question "Why?". Each answer forms the basis of the next question.
|
|
50
|
-
|
|
51
|
-
Note: It is not a requirement to add exactly 5 whys. If the root cause is found at the third why, it is not necessary to continue. The main point is to find the root cause within 5 steps.
|
|
52
|
-
|
|
53
|
-
Example:
|
|
54
|
-
|
|
55
|
-
**Problem**: The vehicle won't start
|
|
56
|
-
|
|
57
|
-
1. __Why?__ - The battery is dead (First why)
|
|
58
|
-
2. __Why?__ - The alternator is not functioning (Second why)
|
|
59
|
-
3. __Why?__ - The alternator belt is broken (Third why)
|
|
60
|
-
4. __Why?__ - The alternator belt was well beyond its useful service life and not replaced. (Fourth why)
|
|
61
|
-
5. __Why?__ - The vehicle was not maintained according to the recommended service schedule. (Fifth why, the root cause)
|
|
62
|
-
-->
|
|
63
|
-
|
|
64
|
-
**Problem**:
|
|
65
|
-
|
|
66
|
-
1. __Why?__
|
|
67
|
-
2. __Why?__
|
|
68
|
-
3. __Why?__
|
|
69
|
-
4. __Why?__
|
|
70
|
-
5. __Why?__
|
|
71
|
-
|
|
72
|
-
## Action items
|
|
73
|
-
|
|
74
|
-
<!--
|
|
75
|
-
A table that describes the different actions that was the outcome of the analysis and who is the owner of the task. The table should be in order of priority.
|
|
76
|
-
|
|
77
|
-
When creating Jira issues, add the label "RCA" to them.
|
|
78
|
-
|
|
79
|
-
Example:
|
|
80
|
-
| Description | Owner | Jira issue |
|
|
81
|
-
|-------------|-------|------|--------|
|
|
82
|
-
| Create alert for high CPU Usage | Bob the Builder | HII-1234 |
|
|
83
|
-
| | | |
|
|
84
|
-
-->
|
|
85
|
-
|
|
86
|
-
| Description | Owner | Jira issue |
|
|
87
|
-
|-------------|-------|------------|
|
|
88
|
-
| | | |
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
4
|
-
const { required } = require('../../../src/validators');
|
|
5
|
-
|
|
6
|
-
module.exports = class extends BaseGenerator {
|
|
7
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'input',
|
|
11
|
-
name: 'system',
|
|
12
|
-
message: 'Name of the software system',
|
|
13
|
-
validate: required,
|
|
14
|
-
},
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
return this.prompt(prompts).then((props) => {
|
|
18
|
-
this.answers = props;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
writing() {
|
|
23
|
-
const { system } = this.answers;
|
|
24
|
-
const filename = this.kebabCase(system.toLowerCase());
|
|
25
|
-
|
|
26
|
-
this.copyDir(
|
|
27
|
-
'docs',
|
|
28
|
-
this.destinationPath(path.join('docs', filename)),
|
|
29
|
-
{
|
|
30
|
-
...this.answers,
|
|
31
|
-
c4System: system.replace(/\s/g, ''),
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
end() {
|
|
37
|
-
this.log(`
|
|
38
|
-
${chalk.green('Your Runbook documentation template have now been created.')}
|
|
39
|
-
Next, push this change in a feature branch and open a pull request.
|
|
40
|
-
`);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# Runbook for <%-system%>
|
|
2
|
-
|
|
3
|
-
## General
|
|
4
|
-
|
|
5
|
-
### Terms and abbreviations
|
|
6
|
-
|
|
7
|
-
<!--
|
|
8
|
-
Write any terms and/or abbreviations that might occur in the text below. Remember that the reader of this Runbook might be new to Hii Retail and how this system interacts with others.
|
|
9
|
-
|
|
10
|
-
Example:
|
|
11
|
-
|
|
12
|
-
GCP - Google Cloud Platform. Extenda Retail's choice of Cloud Platform for Hii Retail.
|
|
13
|
-
CE - Checkout Engine. A system where the thin POS clients connects to and perform their daily sales operations.
|
|
14
|
-
|
|
15
|
-
-->
|
|
16
|
-
|
|
17
|
-
### Purpose
|
|
18
|
-
|
|
19
|
-
<!-- Describe, in short, what the system does and the interactions with external and/or third party systems.
|
|
20
|
-
|
|
21
|
-
Example:
|
|
22
|
-
|
|
23
|
-
Transaction Repository is a centralized product which receives transactions from many parts of Hii Retail. The intention is to store transactions long term and to expose a search API to be able to search for transactions.
|
|
24
|
-
-->
|
|
25
|
-
|
|
26
|
-
## Architecture
|
|
27
|
-
|
|
28
|
-
<!-- Include the C4 diagrams and a link to the Software Guidebook. -->
|
|
29
|
-
|
|
30
|
-
## Business Continuity and Disaster Recovery Plan
|
|
31
|
-
|
|
32
|
-
<!-- Add a link to the Business Continuity and Disaster Recovery Plan. -->
|
|
33
|
-
|
|
34
|
-
## Services
|
|
35
|
-
|
|
36
|
-
<!-- List all internal services that are a part of the system with a short explanation of their purpose and a link to the logs of the service.
|
|
37
|
-
-->
|
|
38
|
-
|
|
39
|
-
## Dashboard
|
|
40
|
-
|
|
41
|
-
<!-- Add link(s) to the dashboard(s) that are setup. Write a short explanation what the dashboard displays and the purpose of it.
|
|
42
|
-
-->
|
|
43
|
-
|
|
44
|
-
## Service Level Objectives
|
|
45
|
-
|
|
46
|
-
<!-- Add a link or include the SLOs for each service that are defined. -->
|
|
47
|
-
|
|
48
|
-
## Alerts
|
|
49
|
-
|
|
50
|
-
<!-- List the alerts according to the format:
|
|
51
|
-
|
|
52
|
-
Alert name
|
|
53
|
-
* Description
|
|
54
|
-
* Notification channels
|
|
55
|
-
* Remediation steps
|
|
56
|
-
|
|
57
|
-
Example:
|
|
58
|
-
|
|
59
|
-
[P1] che.checkout-engine-isrg-nl-checkout-api - Service is offline
|
|
60
|
-
|
|
61
|
-
Description: Triggers when the uptime check fails
|
|
62
|
-
|
|
63
|
-
Notification channels:
|
|
64
|
-
* Slack, #monitoring-channel
|
|
65
|
-
* SMS
|
|
66
|
-
* Jira
|
|
67
|
-
|
|
68
|
-
Remediation steps:
|
|
69
|
-
1. Check if the memory usage (Link to where to check that) is higher than usual (Is there a threshold?)
|
|
70
|
-
2. Check if the number of requests (Link to where to check that) are higher than usual
|
|
71
|
-
3. Follow the Contact & Escalation Matrix
|
|
72
|
-
-->
|
|
73
|
-
|
|
74
|
-
## Health Checks
|
|
75
|
-
|
|
76
|
-
<!-- Add links to the configured health checks in GCP -->
|
|
77
|
-
|
|
78
|
-
## Accessibility (GCP)
|
|
79
|
-
|
|
80
|
-
<!-- What permissions are required to access the GCP resources that are used by the system?
|
|
81
|
-
|
|
82
|
-
Example:
|
|
83
|
-
* Cloud SQL - roles/cloudsql.editor (txengine-prod-1c85)
|
|
84
|
-
* Secret Manager - roles/secretmanager.admin (cardpayment-prod-d5b4)
|
|
85
|
-
|
|
86
|
-
Add examples on how to use the Just-In-Time Access system (https://jit-access.retailsvc.com/)
|
|
87
|
-
-->
|
|
88
|
-
|
|
89
|
-
## How do I..?
|
|
90
|
-
|
|
91
|
-
<!-- Good to know things, such as "How do I connect to the database?", "How do I find a specific item?" -->
|
|
92
|
-
|
|
93
|
-
## Known Issues
|
|
94
|
-
|
|
95
|
-
<!-- Are there any known issues that requires manual intervention? Is there a workaround for the issue? There should be a short description of the issue and a link to the Jira where more details can be found.
|
|
96
|
-
-->
|
|
97
|
-
|
|
98
|
-
## Contact & Escalation
|
|
99
|
-
|
|
100
|
-
### Slack
|
|
101
|
-
|
|
102
|
-
<!-- What is the public channel to contact the team responsible for the system? For example: For general questions, reach us on Slack in #our-channel -->
|
|
103
|
-
|
|
104
|
-
### Escalation
|
|
105
|
-
|
|
106
|
-
For escalation of production issues, see the [Who is on-call](https://extenda.hiiretail.com/sre-admin/whoisoncall) on who to contact.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const chalk = require('chalk');
|
|
3
|
-
const BaseGenerator = require('../../../src/BaseGenerator');
|
|
4
|
-
const { required } = require('../../../src/validators');
|
|
5
|
-
|
|
6
|
-
module.exports = class extends BaseGenerator {
|
|
7
|
-
prompting() {
|
|
8
|
-
const prompts = [
|
|
9
|
-
{
|
|
10
|
-
type: 'input',
|
|
11
|
-
name: 'system',
|
|
12
|
-
message: 'Name of the software system',
|
|
13
|
-
validate: required,
|
|
14
|
-
},
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
return this.prompt(prompts).then((props) => {
|
|
18
|
-
this.answers = props;
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
writing() {
|
|
23
|
-
const { system } = this.answers;
|
|
24
|
-
const filename = this.kebabCase(system.toLowerCase());
|
|
25
|
-
|
|
26
|
-
this.copyDir(
|
|
27
|
-
'docs',
|
|
28
|
-
this.destinationPath(path.join('docs', filename)),
|
|
29
|
-
{
|
|
30
|
-
...this.answers,
|
|
31
|
-
c4System: system.replace(/\s/g, ''),
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
this.fs.copyTpl(
|
|
36
|
-
this.templatePath('sample.dsl'),
|
|
37
|
-
this.destinationPath('docs', filename, `${filename}.dsl`),
|
|
38
|
-
this.answers,
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
install() {
|
|
43
|
-
const { system } = this.answers;
|
|
44
|
-
const filename = this.kebabCase(system.toLowerCase());
|
|
45
|
-
const baseArgs = [
|
|
46
|
-
'run',
|
|
47
|
-
'--pull=always',
|
|
48
|
-
'--rm',
|
|
49
|
-
'-it',
|
|
50
|
-
'-v', `${this.destinationPath('docs', filename)}:/docs`,
|
|
51
|
-
];
|
|
52
|
-
this.spawnCommandSync('docker', [...baseArgs, 'extenda/adr-tools', 'init', 'adr'], { encoding: 'utf8' });
|
|
53
|
-
this.spawnCommandSync('docker', [...baseArgs, 'extenda/structurizr-to-png'], { encoding: 'utf8' });
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
end() {
|
|
57
|
-
this.log(`
|
|
58
|
-
${chalk.green('Your system documentation stubs have now been created.')}
|
|
59
|
-
Next, push this change in a feature branch and open a pull request.
|
|
60
|
-
`);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# <%-system%>
|
|
2
|
-
|
|
3
|
-
This is the architectural documentation for <%-system%>. It describes the architecture of <%-system%>.
|
|
4
|
-
and is the source of truth for the system architecture.
|
|
5
|
-
|
|
6
|
-
See the [Solution Review Board (SRB)](https://confluence.extendaretail.com/display/DEV/Solution+review+board) for more information on what documentation to provide for all software systems. This documentation must be updated as the system evolves to always describe the system in its current state.
|
|
7
|
-
|
|
8
|
-
## :book: Contents
|
|
9
|
-
|
|
10
|
-
* :cloud: [Architecture](./architecture.md)
|
|
11
|
-
* :dollar: [Cost estimates](./cost-estimates.md)
|
|
12
|
-
* :chart_with_upwards_trend: [Observability and SRE](./sre.md)
|
|
13
|
-
|
|
14
|
-
## :pencil2: How to update generated content
|
|
15
|
-
|
|
16
|
-
Parts of the documentation is generated using the following tooling.
|
|
17
|
-
|
|
18
|
-
### C4 diagrams
|
|
19
|
-
|
|
20
|
-
All C4 diagrams must be created with [Structurizr DSL](https://github.com/structurizr/dsl#readme). Use the provided
|
|
21
|
-
`dsl2png.sh` script to create PNG images from the DSL. Use the `--watch` flag while making changes.
|
|
22
|
-
This will give a live preview of the diagram(s) in your browser at http://localhost:3000.
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
./dsl2png.sh --watch
|
|
26
|
-
```
|
|
27
|
-
> :bulb: On Windows 10? Use `dsl2png.cmd` instead.
|
|
28
|
-
|
|
29
|
-
### Architecture decision records (ADRs)
|
|
30
|
-
|
|
31
|
-
Use [ADRs](https://adr.github.io) to track architectural decisions. All significant decisions should be tracked to
|
|
32
|
-
help future developers understand the reasons a technology is used. It will also help developers to replace technology
|
|
33
|
-
when they understand why it was used from the start.
|
|
34
|
-
|
|
35
|
-
Use the provided `adr.sh` script to create ADR entries and to update the ADR log in this document. The script combines
|
|
36
|
-
[adr-tools](https://github.com/npryce/adr-tools) and [adr-log](https://github.com/adr/adr-log).
|
|
37
|
-
See [adr-tools docs](https://github.com/npryce/adr-tools#readme) for available commands.
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
./adr.sh help
|
|
41
|
-
```
|
|
42
|
-
> :bulb: On Windows 10? Use `adr.cmd` instead.
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Architecture
|
|
2
|
-
|
|
3
|
-
## System context
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-
## Containers
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
## Architecture decision records
|
|
12
|
-
|
|
13
|
-
<!-- adrlog -->
|
|
14
|
-
<!-- adrlogstop -->
|
|
15
|
-
|
|
16
|
-
## APIs
|
|
17
|
-
|
|
18
|
-
<!--
|
|
19
|
-
List the APIs.
|
|
20
|
-
* On a live service in prod, this ideally points to the developer portal API.
|
|
21
|
-
* During the design phase, this can point to
|
|
22
|
-
|
|
23
|
-
1. a formal spec (OpenAPI, JSON Schema, Avro, gRPC etc) draft in a repo,
|
|
24
|
-
2. a google sheet,
|
|
25
|
-
3. or an image.
|
|
26
|
-
|
|
27
|
-
The important thing is that the system APIs should be available to explore
|
|
28
|
-
to make it easier to understand the solution design.
|
|
29
|
-
-->
|
|
30
|
-
|
|
31
|
-
The following APIs are part of <%-system%>:
|
|
32
|
-
|
|
33
|
-
* ...
|
|
34
|
-
|
|
35
|
-
## IDEALS
|
|
36
|
-
|
|
37
|
-
Hii Retail services adheres to [the IDEALS principles](https://www.infoq.com/articles/microservices-design-ideals/)
|
|
38
|
-
in microservice architecture. This section covers how the design choices in <%-system%> fulfills the IDEALS.
|
|
39
|
-
|
|
40
|
-
### Interface segregation
|
|
41
|
-
|
|
42
|
-
### Deployability
|
|
43
|
-
|
|
44
|
-
### Event-driven
|
|
45
|
-
|
|
46
|
-
### Availability over consistency
|
|
47
|
-
|
|
48
|
-
### Loose-coupling
|
|
49
|
-
|
|
50
|
-
### Single responsibility
|
|
51
|
-
|
|
52
|
-
## General considerations
|
|
53
|
-
|
|
54
|
-
General Hii Retail design considerations as applied to <%-system%>.
|
|
55
|
-
|
|
56
|
-
### Multi-tenancy
|
|
57
|
-
|
|
58
|
-
### Auditing
|
|
59
|
-
|
|
60
|
-
### Security
|
|
61
|
-
|
|
62
|
-
### Legal compliance
|
|
63
|
-
|
|
64
|
-
### Data mesh
|
|
65
|
-
|
|
66
|
-
### Global reach
|
|
67
|
-
|
|
68
|
-
### Internationalization
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Cost estimates
|
|
2
|
-
|
|
3
|
-
## Google cloud operations costs
|
|
4
|
-
|
|
5
|
-
### Assumptions
|
|
6
|
-
|
|
7
|
-
<!--
|
|
8
|
-
Explain what assumption you've made as part of your price estimates.
|
|
9
|
-
For example, number of messages per second, size of stored data,
|
|
10
|
-
number of connected clients etc.
|
|
11
|
-
-->
|
|
12
|
-
|
|
13
|
-
### Calculations
|
|
14
|
-
|
|
15
|
-
<!--
|
|
16
|
-
Share a link to the Google Price Calculator with your calculations.
|
|
17
|
-
|
|
18
|
-
* Include all components used in your C4 diagrams
|
|
19
|
-
* Present calculations with enough details to understand cost drivers.
|
|
20
|
-
* Presented a tiered table and show the cost for different volumes
|
|
21
|
-
* Include the cost for data in the data mesh
|
|
22
|
-
|
|
23
|
-
Google Price Calculator hints
|
|
24
|
-
|
|
25
|
-
* Use "GKE Node Pool" to calculate cost of Cloud Run for Anthos
|
|
26
|
-
* Always calculate with high availability for Cloud SQL
|
|
27
|
-
* Only include network egress if your system is egress-heavy. It should
|
|
28
|
-
for example be included in external events, but not for scan & go
|
|
29
|
-
-->
|
|
30
|
-
|
|
31
|
-
## High-level cost drivers
|
|
32
|
-
|
|
33
|
-
<!--
|
|
34
|
-
How would you sell this service to customers? What is the billable metrics of
|
|
35
|
-
this service? There's two types of metrics we want to capture
|
|
36
|
-
|
|
37
|
-
* Seat based - for example number of clients or users
|
|
38
|
-
* Usage based - for example number of price updates per month
|
|
39
|
-
-->
|