@cubocicloide/stack-react-fastapi 13.4.2 → 13.5.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/dist/index.js +2654 -329
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/azure-aca/backend/Dockerfile.prod.hbs +29 -0
- package/templates/azure-aca/docs/docs/deploy.md.hbs +127 -0
- package/templates/azure-aca/frontend/Dockerfile.prod +36 -0
- package/templates/azure-aca/frontend/nginx.conf.template +47 -0
- package/templates/azure-aca/iac/README.md.hbs +286 -0
- package/templates/azure-aca/iac/_gitignore +19 -0
- package/templates/azure-aca/iac/runner/Dockerfile +51 -0
- package/templates/azure-aca/iac/terraform/bootstrap/main.tf.hbs +123 -0
- package/templates/azure-aca/iac/terraform/bootstrap/outputs.tf +24 -0
- package/templates/azure-aca/iac/terraform/bootstrap/variables.tf.hbs +23 -0
- package/templates/azure-aca/iac/terraform/environments/dev/backend.hcl.hbs +25 -0
- package/templates/azure-aca/iac/terraform/environments/dev/terraform.tfvars.hbs +69 -0
- package/templates/azure-aca/iac/terraform/main.tf.hbs +593 -0
- package/templates/azure-aca/iac/terraform/outputs.tf.hbs +72 -0
- package/templates/azure-aca/iac/terraform/providers.tf +16 -0
- package/templates/azure-aca/iac/terraform/variables.tf.hbs +200 -0
- package/templates/azure-aca/iac/terraform/versions.tf +21 -0
- package/templates/azure-aks/backend/Dockerfile.prod.hbs +29 -0
- package/templates/azure-aks/docs/docs/deploy.md.hbs +273 -0
- package/templates/azure-aks/frontend/Dockerfile.prod +32 -0
- package/templates/azure-aks/frontend/nginx.conf +20 -0
- package/templates/azure-aks/iac/README.md.hbs +472 -0
- package/templates/azure-aks/iac/_gitignore +29 -0
- package/templates/azure-aks/iac/helm/app/.helmignore +7 -0
- package/templates/azure-aks/iac/helm/app/Chart.yaml.hbs +6 -0
- package/templates/azure-aks/iac/helm/app/templates/NOTES.txt +32 -0
- package/templates/azure-aks/iac/helm/app/templates/backend-deployment.yaml +44 -0
- package/templates/azure-aks/iac/helm/app/templates/backend-service.yaml +16 -0
- package/templates/azure-aks/iac/helm/app/templates/celery-beat-deployment.yaml +34 -0
- package/templates/azure-aks/iac/helm/app/templates/celery-worker-deployment.yaml +31 -0
- package/templates/azure-aks/iac/helm/app/templates/configmap.yaml +15 -0
- package/templates/azure-aks/iac/helm/app/templates/flower-deployment.yaml +28 -0
- package/templates/azure-aks/iac/helm/app/templates/flower-service.yaml +19 -0
- package/templates/azure-aks/iac/helm/app/templates/frontend-deployment.yaml +34 -0
- package/templates/azure-aks/iac/helm/app/templates/frontend-service.yaml +16 -0
- package/templates/azure-aks/iac/helm/app/templates/helpers.tpl +90 -0
- package/templates/azure-aks/iac/helm/app/templates/hpa.yaml +23 -0
- package/templates/azure-aks/iac/helm/app/templates/ingress.yaml +35 -0
- package/templates/azure-aks/iac/helm/app/templates/migration-job.yaml +38 -0
- package/templates/azure-aks/iac/helm/app/templates/redis-deployment.yaml +33 -0
- package/templates/azure-aks/iac/helm/app/templates/redis-service.yaml +18 -0
- package/templates/azure-aks/iac/helm/app/templates/secret.yaml +17 -0
- package/templates/azure-aks/iac/helm/app/templates/serviceaccount.yaml +12 -0
- package/templates/azure-aks/iac/helm/app/values-dev.yaml.hbs +36 -0
- package/templates/azure-aks/iac/helm/app/values.yaml.hbs +147 -0
- package/templates/azure-aks/iac/runner/Dockerfile +61 -0
- package/templates/azure-aks/iac/terraform/bootstrap/main.tf.hbs +123 -0
- package/templates/azure-aks/iac/terraform/bootstrap/outputs.tf +24 -0
- package/templates/azure-aks/iac/terraform/bootstrap/variables.tf.hbs +23 -0
- package/templates/azure-aks/iac/terraform/environments/dev/backend.hcl.hbs +25 -0
- package/templates/azure-aks/iac/terraform/environments/dev/terraform.tfvars.hbs +65 -0
- package/templates/azure-aks/iac/terraform/main.tf.hbs +307 -0
- package/templates/azure-aks/iac/terraform/outputs.tf.hbs +57 -0
- package/templates/azure-aks/iac/terraform/providers.tf +35 -0
- package/templates/azure-aks/iac/terraform/variables.tf.hbs +157 -0
- package/templates/azure-aks/iac/terraform/versions.tf +29 -0
- package/templates/base/CLAUDE.md.hbs +7 -7
- package/templates/base/backend/pyproject.toml.hbs +1 -1
- package/templates/base/docs/docs/dude.md.hbs +1 -1
- package/templates/base/docs/docs/index.md.hbs +1 -1
- package/templates/base/docs/mkdocs.yml.hbs +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# ── Identity ──────────────────────────────────────────────────────────────────
|
|
2
|
+
variable "project_name" {
|
|
3
|
+
description = "Project slug, used to name and tag every resource."
|
|
4
|
+
type = string
|
|
5
|
+
default = "{{projectName}}"
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
variable "environment" {
|
|
9
|
+
description = "Environment name (dev, staging, prod, …). Drives naming + state key."
|
|
10
|
+
type = string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
variable "location" {
|
|
14
|
+
description = "Azure region to deploy into. North Europe is the default because several popular regions — West Europe among them — are capacity-closed to new subscriptions and reject storage/registry/cluster creation with RequestDisallowedByAzure. Check a region before switching."
|
|
15
|
+
type = string
|
|
16
|
+
default = "northeurope"
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
variable "subscription_id" {
|
|
20
|
+
description = "Azure subscription this environment lives in. Empty = whatever ARM_SUBSCRIPTION_ID / your az default resolves to."
|
|
21
|
+
type = string
|
|
22
|
+
default = ""
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# ── Shared registry (created by the bootstrap; written here by `dude iac bootstrap`) ──
|
|
26
|
+
variable "acr_name" {
|
|
27
|
+
description = "Name of the shared container registry created by the bootstrap."
|
|
28
|
+
type = string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
variable "acr_resource_group" {
|
|
32
|
+
description = "Resource group holding the shared container registry (the bootstrap's group)."
|
|
33
|
+
type = string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
# ── Network ───────────────────────────────────────────────────────────────────
|
|
37
|
+
variable "vnet_cidr" {
|
|
38
|
+
description = "Address space for the virtual network."
|
|
39
|
+
type = string
|
|
40
|
+
default = "10.0.0.0/16"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
variable "aks_subnet_cidr" {
|
|
44
|
+
description = "Subnet hosting the AKS node pool."
|
|
45
|
+
type = string
|
|
46
|
+
default = "10.0.0.0/20"
|
|
47
|
+
}
|
|
48
|
+
{{#if withPostgres}}
|
|
49
|
+
|
|
50
|
+
variable "db_subnet_cidr" {
|
|
51
|
+
description = "Subnet delegated to the PostgreSQL Flexible Server (must not overlap the AKS subnet)."
|
|
52
|
+
type = string
|
|
53
|
+
default = "10.0.16.0/24"
|
|
54
|
+
}
|
|
55
|
+
{{/if}}
|
|
56
|
+
|
|
57
|
+
# ── AKS ───────────────────────────────────────────────────────────────────────
|
|
58
|
+
variable "kubernetes_version" {
|
|
59
|
+
description = "Kubernetes version for the AKS control plane. Empty = whatever Azure defaults to in this region (always a supported version)."
|
|
60
|
+
type = string
|
|
61
|
+
default = ""
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
variable "node_vm_size" {
|
|
65
|
+
description = "VM size for the default node pool. Dsv3 is the default because its quota is granted by default on a new subscription; newer/cheaper families (DASv5, Dpsv5) often start at a limit of 0 and have to be requested. Check with: az vm list-usage --location <region> -o table"
|
|
66
|
+
type = string
|
|
67
|
+
default = "Standard_D2s_v3"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
variable "node_min_count" {
|
|
71
|
+
description = "Minimum number of worker nodes (autoscaler lower bound)."
|
|
72
|
+
type = number
|
|
73
|
+
default = 2
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
variable "node_max_count" {
|
|
77
|
+
description = "Maximum number of worker nodes (autoscaler upper bound)."
|
|
78
|
+
type = number
|
|
79
|
+
default = 4
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
variable "node_count" {
|
|
83
|
+
description = "Initial number of worker nodes."
|
|
84
|
+
type = number
|
|
85
|
+
default = 2
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# ── Public hostname ───────────────────────────────────────────────────────────
|
|
89
|
+
variable "dns_label" {
|
|
90
|
+
description = "DNS label for the ingress public IP. Azure serves the app at <dns_label>.<location>.cloudapp.azure.com. Must be unique within the region. Empty = <project>-<environment>."
|
|
91
|
+
type = string
|
|
92
|
+
default = ""
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
variable "ingress_nginx_chart_version" {
|
|
96
|
+
description = "Chart version for ingress-nginx (the in-cluster ingress controller)."
|
|
97
|
+
type = string
|
|
98
|
+
default = "4.11.3"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
# ── TLS (optional — needs a domain you own) ───────────────────────────────────
|
|
102
|
+
variable "letsencrypt_email" {
|
|
103
|
+
description = "Contact address for Let's Encrypt. Set this ONLY once a domain you own points at the ingress: Azure's own *.cloudapp.azure.com name cannot get a trusted certificate (see iac/README.md). Empty = no cert-manager, plain HTTP."
|
|
104
|
+
type = string
|
|
105
|
+
default = ""
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
variable "cert_manager_chart_version" {
|
|
109
|
+
description = "Chart version for cert-manager."
|
|
110
|
+
type = string
|
|
111
|
+
default = "v1.16.2"
|
|
112
|
+
}
|
|
113
|
+
{{#if withPostgres}}
|
|
114
|
+
|
|
115
|
+
# ── Azure Database for PostgreSQL (Flexible Server) ───────────────────────────
|
|
116
|
+
variable "db_version" {
|
|
117
|
+
description = "PostgreSQL major version."
|
|
118
|
+
type = string
|
|
119
|
+
default = "16"
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
variable "db_sku_name" {
|
|
123
|
+
description = "Flexible Server SKU (e.g. B_Standard_B1ms for dev, GP_Standard_D2ds_v4 for prod)."
|
|
124
|
+
type = string
|
|
125
|
+
default = "B_Standard_B1ms"
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
variable "db_storage_mb" {
|
|
129
|
+
description = "Allocated storage in MB (minimum 32768)."
|
|
130
|
+
type = number
|
|
131
|
+
default = 32768
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
variable "db_name" {
|
|
135
|
+
description = "Initial database name."
|
|
136
|
+
type = string
|
|
137
|
+
default = "app"
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
variable "db_username" {
|
|
141
|
+
description = "Administrator username. The password is generated by Terraform and surfaced through the sensitive `database_url` output."
|
|
142
|
+
type = string
|
|
143
|
+
default = "appadmin"
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
variable "db_backup_retention_days" {
|
|
147
|
+
description = "Days of automated backups to retain (7–35)."
|
|
148
|
+
type = number
|
|
149
|
+
default = 7
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
variable "db_high_availability" {
|
|
153
|
+
description = "Run the database zone-redundant (recommended for prod; not available on Burstable SKUs)."
|
|
154
|
+
type = bool
|
|
155
|
+
default = false
|
|
156
|
+
}
|
|
157
|
+
{{/if}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.6.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
azurerm = {
|
|
6
|
+
source = "hashicorp/azurerm"
|
|
7
|
+
version = "~> 4.14"
|
|
8
|
+
}
|
|
9
|
+
kubernetes = {
|
|
10
|
+
source = "hashicorp/kubernetes"
|
|
11
|
+
version = "~> 2.31"
|
|
12
|
+
}
|
|
13
|
+
helm = {
|
|
14
|
+
source = "hashicorp/helm"
|
|
15
|
+
version = "~> 2.17"
|
|
16
|
+
}
|
|
17
|
+
random = {
|
|
18
|
+
source = "hashicorp/random"
|
|
19
|
+
version = "~> 3.6"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
# Partial backend: the concrete resource group / storage account / container are
|
|
24
|
+
# supplied per environment via `-backend-config=environments/<env>/backend.hcl`
|
|
25
|
+
# at `terraform init`. This keeps a single root usable both locally and from
|
|
26
|
+
# CI/CD. State locking is a blob lease — no separate lock table exists or is
|
|
27
|
+
# needed.
|
|
28
|
+
backend "azurerm" {}
|
|
29
|
+
}
|
|
@@ -198,24 +198,24 @@ New findings cause a non-zero exit; known/accepted findings (baseline) do not.
|
|
|
198
198
|
Docs are live-reload: edit any `.md` file under `docs/docs/` and the browser refreshes automatically.
|
|
199
199
|
{{#if withIac}}
|
|
200
200
|
|
|
201
|
-
### Infrastructure (IaC —
|
|
201
|
+
### Infrastructure (IaC — {{iacLabel}})
|
|
202
202
|
|
|
203
|
-
This project ships Terraform + a Helm chart under `iac/` to deploy to
|
|
204
|
-
Terraform owns the infrastructure (VPC, EKS, ECR, ALB controller{{#if withPostgres}}, RDS{{/if}});
|
|
203
|
+
This project ships Terraform + a Helm chart under `iac/` to deploy to {{iacLabel}}.
|
|
204
|
+
Terraform owns the infrastructure ({{#if withAwsEks}}VPC, EKS, ECR, ALB controller{{#if withPostgres}}, RDS{{/if}}{{/if}}{{#if withAzureAks}}resource group, VNet, AKS, ACR, ingress-nginx{{#if withPostgres}}, PostgreSQL Flexible Server{{/if}}{{/if}});
|
|
205
205
|
Helm owns the application release. All commands are environment-scoped via
|
|
206
206
|
`--env` (**required** — no default, to avoid acting on the wrong environment).
|
|
207
207
|
Available environments are auto-discovered from `iac/terraform/environments/*`;
|
|
208
|
-
run any command without `--env` to list them. State lives in S3, so
|
|
209
|
-
the same locally and in CI. See `iac/README.md` for the full workflow.
|
|
208
|
+
run any command without `--env` to list them. State lives in {{#if withAwsEks}}S3{{/if}}{{#if withAzureAks}}Azure Blob Storage{{/if}}, so
|
|
209
|
+
commands run the same locally and in CI. See `iac/README.md` for the full workflow.
|
|
210
210
|
|
|
211
211
|
| Command | What it does |
|
|
212
212
|
|-------------------------|---------------------------------------------------------------|
|
|
213
213
|
| `dude iac new-env --env <name>` | Scaffold a new environment (copies `dev` by default) |
|
|
214
|
-
| `dude iac init` | `terraform init` (configures the
|
|
214
|
+
| `dude iac init` | `terraform init` (configures the remote backend for the env) |
|
|
215
215
|
| `dude iac plan` | `terraform plan` |
|
|
216
216
|
| `dude iac apply` | Provision/update infrastructure (`--yes` to auto-approve) |
|
|
217
217
|
| `dude iac destroy` | Tear down infrastructure (`--yes` to auto-approve) |
|
|
218
|
-
| `dude iac output` | Show outputs (cluster,
|
|
218
|
+
| `dude iac output` | Show outputs (cluster, registry URLs{{#if withPostgres}}, database endpoint{{/if}}; `--json`) |
|
|
219
219
|
| `dude iac fmt` | `terraform fmt -recursive` |
|
|
220
220
|
| `dude iac validate` | `terraform validate` |
|
|
221
221
|
| `dude iac kubeconfig` | Point `kubectl`/`helm` at the provisioned cluster |
|
|
@@ -296,7 +296,7 @@ cloud credentials profile.
|
|
|
296
296
|
| Command | Description |
|
|
297
297
|
|---------|-------------|
|
|
298
298
|
| `dude iac login --env <e>` | Configure/verify cloud credentials for an environment |
|
|
299
|
-
| `dude iac bootstrap --env <e> --
|
|
299
|
+
| `dude iac bootstrap --env <e> --yes` | One-time: create the shared remote-state backend (+ container registry). Takes a cloud-specific prefix flag — see the **Deploy** page |
|
|
300
300
|
| `dude iac new-env --env <name> [--from <env>]` | Scaffold a new environment by copying an existing one (default source: `dev`) |
|
|
301
301
|
| `dude iac init --env <e>` | Initialise the infra toolchain for the environment |
|
|
302
302
|
| `dude iac plan --env <e>` | Preview the infrastructure changes |
|
|
@@ -62,7 +62,7 @@ dude docs # → http://localhost:8001
|
|
|
62
62
|
- [Command reference](api.md) — auto-generated list of every command available in this project.
|
|
63
63
|
- [Writing docs](mkdocs.md) — How to add pages to this documentation site and the Markdown syntax supported.
|
|
64
64
|
{{#if withIac}}
|
|
65
|
-
- [Deploy (
|
|
65
|
+
- [Deploy ({{iacLabel}})](deploy.md) — provision cloud infrastructure and ship the app.
|
|
66
66
|
{{/if}}
|
|
67
67
|
|
|
68
68
|
---
|