@hiiretail/gcp-infra-cli 0.93.0 → 0.94.0

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.
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "GCP Budget",
3
+ "description": "Create a budget and alert notifications"
4
+ }
@@ -0,0 +1,42 @@
1
+ const path = require('path');
2
+ const chalk = require('chalk');
3
+ const BaseGenerator = require('../../../src/BaseGenerator');
4
+
5
+ module.exports = class extends BaseGenerator {
6
+ prompting() {
7
+ const prompts = [
8
+ {
9
+ type: 'input',
10
+ name: 'monitoringNotificationChannels',
11
+ message: 'Enter a comma-separated list of monitoring notification channels (format: projects/{project_id}/notificationChannels/{channel_id}). At least one email address must be included. Up to 5 channels are permitted.',
12
+ },
13
+ ];
14
+ return this.prompt(prompts).then((props) => {
15
+ this.answers = props;
16
+ });
17
+ }
18
+
19
+ writing() {
20
+ const channelsArray = this.answers.monitoringNotificationChannels ? this.answers.monitoringNotificationChannels.split(',').map((channel) => channel.trim()) : [];
21
+
22
+ ['prod', 'staging'].forEach((env) => {
23
+ this.copyDir(
24
+ 'budget',
25
+ path.join('infra', env, 'budget'),
26
+ {
27
+ ...this.answers,
28
+ env,
29
+ monitoringNotificationChannels: channelsArray,
30
+ },
31
+ );
32
+ });
33
+ }
34
+
35
+ end() {
36
+ this.log(`
37
+ ${chalk.green('Your budget has been created.')}
38
+ ${chalk.green('1.')} To finalize your configuration, please continue with manual editing of the generated files.
39
+ ${chalk.green('2.')} Push the changes in a feature branch and open a pull request.
40
+ `);
41
+ }
42
+ };
@@ -0,0 +1,28 @@
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/terraform-google-project-factory//modules/budget?ref=feat/CNP-25"
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
+ project_vars = read_terragrunt_config(find_in_parent_folders("project.hcl"))
14
+ common_vars = read_terragrunt_config(find_in_parent_folders("common.hcl"))
15
+ }
16
+
17
+ # These are the variables we have to pass in to use the module specified in the terragrunt configuration above
18
+ inputs = merge(
19
+ {
20
+ projects = [local.project_vars.locals.project_id]
21
+ display_name = "${local.project_vars.locals.project_name}-budget"
22
+ billing_account = "01580F-3DD16A-C066A5"
23
+ amount = local.project_vars.locals.amount
24
+ monitoring_notification_channels = <%-JSON.stringify(monitoringNotificationChannels)%>
25
+ disable_default_iam_recipients = true
26
+ alert_spent_percents = [0.8, 1.0, 1.2]
27
+ }
28
+ )
@@ -11,9 +11,11 @@ shared with external customers as well as internal stakeholders. Some guidelines
11
11
  * Include what the problem was and how the customer(s) was affected
12
12
  * Do NOT include any customer names
13
13
  * Do NOT include any Hii Retail service names or underlying technologies that we are using
14
- * Include some general action points, such as if additional alerts needs to be added. Skip the details
14
+ * Include some general action points, such as if additional alerts needs to be added. Do not add details
15
15
  * Don't make promises, if there are any actions that we will look at, just mention them. Don't include target dates
16
16
 
17
17
  Example:
18
18
  On January 25 2023 from 14:31 CET to 15:59 CET some customers may have experienced delays with card payments. The issue was traced back to a misconfiguration of a recent deployment. At 15:31 CET a fix was deployed and monitored. At 15:59 CET the issue was resolved for all affected customers.
19
+
20
+ We will look into the process of how we update our configuration in production to mitigate these issues going forward.
19
21
  -->
@@ -12,9 +12,15 @@
12
12
 
13
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
14
 
15
- **Ticket information**: <!-- Add link(s) to any Jira issues -->
15
+ **Ticket information**:
16
16
 
17
- **Services involved**: <!-- List the Hii Retail-service(s) that were involved in the incident, for example checkout-poslog -->
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. -->
18
24
 
19
25
  ## Summary
20
26
 
@@ -31,10 +37,10 @@ Describe the events that caused the incident, starting from when the issues star
31
37
 
32
38
  Example:
33
39
 
34
- - 2022-06-14 14.36 - Alert X was triggered
35
- - 2022-06-14 14.36 - Team started working on the incident
36
- - 2022-06-14 14.49 - A fix was pushed and deployed
37
- - 2022-06-14 14.53 - Incident was resolved
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
38
44
  -->
39
45
 
40
46
  ## Five Whys
@@ -42,9 +48,11 @@ Example:
42
48
  <!--
43
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.
44
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
+
45
53
  Example:
46
54
 
47
- Problem: The vehicle won't start
55
+ **Problem**: The vehicle won't start
48
56
 
49
57
  1. __Why?__ - The battery is dead (First why)
50
58
  2. __Why?__ - The alternator is not functioning (Second why)
@@ -53,6 +61,8 @@ Problem: The vehicle won't start
53
61
  5. __Why?__ - The vehicle was not maintained according to the recommended service schedule. (Fifth why, the root cause)
54
62
  -->
55
63
 
64
+ **Problem**:
65
+
56
66
  1. __Why?__
57
67
  2. __Why?__
58
68
  3. __Why?__
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiiretail/gcp-infra-cli",
3
- "version": "0.93.0",
3
+ "version": "0.94.0",
4
4
  "description": "Infrastructure as code generator for GCP.",
5
5
  "main": "src/cli.js",
6
6
  "bin": {