@pagopa/opex-dashboard 0.0.1 → 0.1.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.
- package/README.md +78 -1
- package/bin/index.js +1476 -0
- package/config.schema.json +174 -118
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -60,12 +60,76 @@ npx @pagopa/opex-dashboard generate -t azure-dashboard -c config.yaml --package
|
|
|
60
60
|
|
|
61
61
|
### 3. Deploy with Terraform
|
|
62
62
|
|
|
63
|
+
The deployment process depends on the configuration mode you chose:
|
|
64
|
+
|
|
65
|
+
#### Multi-Environment Mode
|
|
66
|
+
|
|
67
|
+
When using the multi-environment configuration (with `environments` section),
|
|
68
|
+
the generated package includes separate subdirectories for each environment:
|
|
69
|
+
|
|
63
70
|
```bash
|
|
64
71
|
cd output/azure-dashboard
|
|
72
|
+
# Deploy to dev
|
|
65
73
|
terraform init -backend-config=env/dev/backend.tfvars
|
|
66
74
|
terraform apply -var-file=env/dev/terraform.tfvars
|
|
75
|
+
|
|
76
|
+
# Deploy to prod
|
|
77
|
+
terraform init -backend-config=env/prod/backend.tfvars
|
|
78
|
+
terraform apply -var-file=env/prod/terraform.tfvars
|
|
67
79
|
```
|
|
68
80
|
|
|
81
|
+
**Generated structure:**
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
output/azure-dashboard/
|
|
85
|
+
├── main.tf
|
|
86
|
+
├── variables.tf
|
|
87
|
+
├── dashboard.tf
|
|
88
|
+
└── env/
|
|
89
|
+
├── dev/
|
|
90
|
+
│ ├── backend.tfvars
|
|
91
|
+
│ └── terraform.tfvars
|
|
92
|
+
├── uat/
|
|
93
|
+
│ ├── backend.tfvars
|
|
94
|
+
│ └── terraform.tfvars
|
|
95
|
+
└── prod/
|
|
96
|
+
├── backend.tfvars
|
|
97
|
+
└── terraform.tfvars
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Flat Mode
|
|
101
|
+
|
|
102
|
+
When using flat configuration (with `prefix` and `env_short` directly under
|
|
103
|
+
`terraform`), all files are generated in the root directory:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
cd output/azure-dashboard
|
|
107
|
+
terraform init -backend-config=backend.tfvars
|
|
108
|
+
terraform apply -var-file=terraform.tfvars
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Generated structure:**
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
output/azure-dashboard/
|
|
115
|
+
├── main.tf
|
|
116
|
+
├── variables.tf
|
|
117
|
+
├── dashboard.tf
|
|
118
|
+
├── backend.tfvars
|
|
119
|
+
└── terraform.tfvars
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Use flat mode when:**
|
|
123
|
+
|
|
124
|
+
- Deploying to a single environment
|
|
125
|
+
- Managing infrastructure for a specific environment in a separate repository
|
|
126
|
+
- You don't need environment-specific subdirectories
|
|
127
|
+
|
|
128
|
+
**Use multi-environment mode when:**
|
|
129
|
+
|
|
130
|
+
- Managing multiple environments (dev/uat/prod) in the same repository
|
|
131
|
+
- You want organized environment-specific configurations in subdirectories
|
|
132
|
+
|
|
69
133
|
## Dashboard Components
|
|
70
134
|
|
|
71
135
|
For each endpoint in the OpenAPI spec, the dashboard includes:
|
|
@@ -137,7 +201,10 @@ availability_threshold`: float # Default: 0.99 (99%)
|
|
|
137
201
|
response_time_threshold: float # Default: 1.0 second
|
|
138
202
|
|
|
139
203
|
# When generating Terraform packages (using `--package` option),
|
|
140
|
-
# you can optionally configure environment-specific settings
|
|
204
|
+
# you can optionally configure environment-specific settings.
|
|
205
|
+
# Two configuration modes are supported:
|
|
206
|
+
|
|
207
|
+
# 1. Multi-environment mode (with subdirectories):
|
|
141
208
|
terraform:
|
|
142
209
|
environments:
|
|
143
210
|
dev:
|
|
@@ -150,6 +217,16 @@ terraform:
|
|
|
150
217
|
key: string
|
|
151
218
|
uat: # Similar to dev
|
|
152
219
|
prod: # Similar to dev
|
|
220
|
+
|
|
221
|
+
# 2. Flat mode (single environment, no subdirectories):
|
|
222
|
+
terraform:
|
|
223
|
+
prefix: string # Max 6 chars (required)
|
|
224
|
+
env_short: string # Max 1 char: 'd', 'u', 'p' (required)
|
|
225
|
+
backend: # Optional backend state configuration
|
|
226
|
+
resource_group_name: string
|
|
227
|
+
storage_account_name: string
|
|
228
|
+
container_name: string
|
|
229
|
+
key: string
|
|
153
230
|
```
|
|
154
231
|
|
|
155
232
|
See [`examples/`](./examples) directory for complete configuration samples.
|