@swovohq/fuel 0.2.2-alpha.90 → 0.2.2-alpha.92
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 +107 -107
- package/dist/bin/fuel.js +2 -2
- package/dist/cleanup/finalize.d.ts.map +1 -1
- package/dist/cleanup/finalize.js +11 -3
- package/dist/cleanup/finalize.js.map +1 -1
- package/dist/commands/config-verify.d.ts.map +1 -1
- package/dist/commands/config-verify.js.map +1 -1
- package/dist/commands/create-app.d.ts.map +1 -1
- package/dist/commands/create-app.js +6 -4
- package/dist/commands/create-app.js.map +1 -1
- package/dist/commands/infra-deploy.d.ts.map +1 -1
- package/dist/commands/infra-deploy.js +37 -20
- package/dist/commands/infra-deploy.js.map +1 -1
- package/dist/commands/infra-destroy.d.ts.map +1 -1
- package/dist/commands/infra-destroy.js +1 -1
- package/dist/commands/infra-destroy.js.map +1 -1
- package/dist/commands/infra-init.d.ts.map +1 -1
- package/dist/commands/infra-init.js +168 -67
- package/dist/commands/infra-init.js.map +1 -1
- package/dist/commands/infra-pull.d.ts.map +1 -1
- package/dist/commands/infra-pull.js +2 -1
- package/dist/commands/infra-pull.js.map +1 -1
- package/dist/commands/list-modules.d.ts.map +1 -1
- package/dist/commands/list-modules.js +10 -3
- package/dist/commands/list-modules.js.map +1 -1
- package/dist/engines/convention.d.ts.map +1 -1
- package/dist/engines/convention.js +2 -2
- package/dist/engines/convention.js.map +1 -1
- package/dist/engines/dependencies.d.ts.map +1 -1
- package/dist/engines/dependencies.js.map +1 -1
- package/dist/engines/monorepo.d.ts.map +1 -1
- package/dist/engines/monorepo.js.map +1 -1
- package/dist/engines/template-source.d.ts.map +1 -1
- package/dist/engines/template-source.js +3 -1
- package/dist/engines/template-source.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infra/azure-defaults.js +8 -8
- package/dist/infra/azure-keyvault-client.d.ts.map +1 -1
- package/dist/infra/azure-keyvault-client.js.map +1 -1
- package/dist/infra/azure-rbac.d.ts.map +1 -1
- package/dist/infra/azure-rbac.js +3 -1
- package/dist/infra/azure-rbac.js.map +1 -1
- package/dist/infra/azure-state-storage.d.ts.map +1 -1
- package/dist/infra/azure-state-storage.js +9 -9
- package/dist/infra/azure-state-storage.js.map +1 -1
- package/dist/infra/config-loader.d.ts.map +1 -1
- package/dist/infra/config-loader.js.map +1 -1
- package/dist/infra/config-writer.js +1 -1
- package/dist/infra/credentials.d.ts.map +1 -1
- package/dist/infra/credentials.js.map +1 -1
- package/dist/infra/dependency-checker.d.ts.map +1 -1
- package/dist/infra/dependency-checker.js.map +1 -1
- package/dist/infra/deployment-detect.d.ts.map +1 -1
- package/dist/infra/deployment-detect.js.map +1 -1
- package/dist/infra/git-client.d.ts.map +1 -1
- package/dist/infra/git-client.js.map +1 -1
- package/dist/infra/github-client.d.ts.map +1 -1
- package/dist/infra/github-client.js +3 -3
- package/dist/infra/github-client.js.map +1 -1
- package/dist/infra/github-secrets-client.d.ts.map +1 -1
- package/dist/infra/github-secrets-client.js +2 -2
- package/dist/infra/github-secrets-client.js.map +1 -1
- package/dist/infra/github-token-link.d.ts.map +1 -1
- package/dist/infra/github-token-link.js +6 -2
- package/dist/infra/github-token-link.js.map +1 -1
- package/dist/infra/orchestrator.d.ts.map +1 -1
- package/dist/infra/orchestrator.js +20 -15
- package/dist/infra/orchestrator.js.map +1 -1
- package/dist/infra/port-utils.d.ts.map +1 -1
- package/dist/infra/port-utils.js.map +1 -1
- package/dist/infra/preflight.d.ts.map +1 -1
- package/dist/infra/preflight.js +9 -3
- package/dist/infra/preflight.js.map +1 -1
- package/dist/infra/s3-state-bucket.d.ts.map +1 -1
- package/dist/infra/s3-state-bucket.js +8 -4
- package/dist/infra/s3-state-bucket.js.map +1 -1
- package/dist/infra/secrets-manager-client.d.ts.map +1 -1
- package/dist/infra/secrets-manager-client.js +8 -5
- package/dist/infra/secrets-manager-client.js.map +1 -1
- package/dist/infra/subprocess.js +1 -1
- package/dist/infra/template-engine.d.ts.map +1 -1
- package/dist/infra/template-engine.js +17 -5
- package/dist/infra/template-engine.js.map +1 -1
- package/dist/infra/tofu-runner.d.ts.map +1 -1
- package/dist/infra/tofu-runner.js +8 -11
- package/dist/infra/tofu-runner.js.map +1 -1
- package/dist/infra/types.d.ts +1 -1
- package/dist/infra/types.d.ts.map +1 -1
- package/dist/infra/types.js +299 -91
- package/dist/infra/types.js.map +1 -1
- package/dist/infra-templates/TODO-azure-prod.md +16 -8
- package/dist/infra-templates/templates/azure/MANUAL_DEPLOY.md +1 -1
- package/dist/infra-templates/templates/ecs/README.md +92 -82
- package/package.json +1 -1
|
@@ -6,16 +6,18 @@ specs (SQL 6 vCore GP zone-redundant, Front Door Premium+WAF, Container
|
|
|
6
6
|
Apps Dedicated D4x2, Defender for Cloud, etc).
|
|
7
7
|
|
|
8
8
|
## Done — Key Vault per-app secrets pre-populated (closed on feature/azure-provider-support)
|
|
9
|
+
|
|
9
10
|
Each app's vault now gets an `azurerm_key_vault_secret` named `app-variables`
|
|
10
11
|
holding `jsonencode(local.app_variables[app])` — one JSON blob per app,
|
|
11
12
|
mirroring ECS's `modules/secret` (which also stores all of an app's
|
|
12
13
|
`variables:` as one JSON blob, not one secret per key).
|
|
13
14
|
|
|
14
15
|
Two blockers closed:
|
|
16
|
+
|
|
15
17
|
- **RBAC** (data-plane `Key Vault Secrets Officer`, which `Contributor` doesn't
|
|
16
|
-
cover): resolved
|
|
18
|
+
cover): resolved _without_ the Graph-lookup problem the github_oidc
|
|
17
19
|
`existing_principal_id` escape hatch needed — `data.azurerm_client_config.current.object_id`
|
|
18
|
-
resolves the
|
|
20
|
+
resolves the _running_ SP's own object_id purely via ARM, no
|
|
19
21
|
`Application.Read.All` required.
|
|
20
22
|
- **Network** (found while implementing, wasn't in this doc before): the vault
|
|
21
23
|
defaults to `public_network_access_enabled = false`, so `network_acls` never
|
|
@@ -28,7 +30,7 @@ Two blockers closed:
|
|
|
28
30
|
Azure RBAC propagation isn't instant, so writing in the same apply that
|
|
29
31
|
grants the role can otherwise 403 intermittently.
|
|
30
32
|
|
|
31
|
-
Not addressed: this doesn't give the
|
|
33
|
+
Not addressed: this doesn't give the _app itself_ read access over the network
|
|
32
34
|
at runtime (Container Apps egress via the NAT Gateway's public IP, which isn't
|
|
33
35
|
on the allowlist and isn't covered by `bypass = "AzureServices"`). Today no app
|
|
34
36
|
code actually reads from Key Vault via SDK — `KEY_VAULT_URI` is informational
|
|
@@ -38,6 +40,7 @@ ever needs to read its vault directly, this'll need a private endpoint or a
|
|
|
38
40
|
broader firewall rule for the Container Apps subnet's egress IP.
|
|
39
41
|
|
|
40
42
|
## Already fixed (committed on feature/azure-provider-support)
|
|
43
|
+
|
|
41
44
|
- `github_oidc.enabled` sensitivity leak (`for_each`/output error) — fixed via
|
|
42
45
|
`nonsensitive()` in `templates/azure/locals.tf` (`local.github_oidc_enabled`).
|
|
43
46
|
- Orphan private DNS zones in `modules/azure-network` (e.g. postgres zone
|
|
@@ -47,7 +50,7 @@ broader firewall rule for the Container Apps subnet's egress IP.
|
|
|
47
50
|
Azure secret name — fixed to reuse `local.secret_names`.
|
|
48
51
|
- SQL LTR + auto-pause both enabled by default, which Azure rejects on a
|
|
49
52
|
serverless database — LTR now only applies when `auto_pause_delay_in_minutes
|
|
50
|
-
|
|
53
|
+
== -1` (i.e. provisioned/prod databases).
|
|
51
54
|
- `packages/infra` was left behind in every scaffolded project (only
|
|
52
55
|
`packages/cli` was cleaned up) — now removed the same way. `templates/azure`
|
|
53
56
|
had no `.gitignore` (unlike `templates/ecs`) — added one.
|
|
@@ -65,10 +68,10 @@ broader firewall rule for the Container Apps subnet's egress IP.
|
|
|
65
68
|
without one. Added a Standard NAT Gateway to the subnet.
|
|
66
69
|
- `azurerm_container_app` always declared a `registry` block pointing at the
|
|
67
70
|
ACR, but the AcrPull role assignment for that identity is necessarily
|
|
68
|
-
created
|
|
71
|
+
created _after_ the container app — Azure hung validating an unauthorized
|
|
69
72
|
credential on first create regardless of which image was pulled. Dropped
|
|
70
73
|
the `registry` block; CI now configures it via `az containerapp registry
|
|
71
|
-
|
|
74
|
+
set` once the role assignment already exists.
|
|
72
75
|
- Every Front Door route also set `link_to_default_domain = true`, so the
|
|
73
76
|
second app's route collided with the first on the shared `*.azurefd.net`
|
|
74
77
|
hostname/path. Now only links the default domain when an app has no custom
|
|
@@ -76,6 +79,7 @@ broader firewall rule for the Container Apps subnet's egress IP.
|
|
|
76
79
|
- `github_repo_name` as explicit field — done, see below.
|
|
77
80
|
|
|
78
81
|
## Decided, not implemented yet
|
|
82
|
+
|
|
79
83
|
1. **Multi-environment pipelines.** `templates/azure/workflows/build_and_deploy.yml`
|
|
80
84
|
uses repo-wide secrets (`AZURE_CLIENT_ID`/`TENANT_ID`/`SUBSCRIPTION_ID`/
|
|
81
85
|
`ACR_LOGIN_SERVER`, no `environment:` on the job) and bakes
|
|
@@ -92,10 +96,11 @@ broader firewall rule for the Container Apps subnet's egress IP.
|
|
|
92
96
|
no longer conflicts with dev/stg — just needs the schema const relaxed
|
|
93
97
|
and the WAF resource added.
|
|
94
98
|
3. **Container Apps Dedicated plan** (D4 x2). `modules/azure-container-apps-environment`
|
|
95
|
-
is Consumption-only
|
|
99
|
+
is Consumption-only _by design_ (explicit comment in `main.tf`). Needs a
|
|
96
100
|
`workload_profile` block + a way to select Dedicated per-app/per-env.
|
|
97
101
|
|
|
98
102
|
## No Terraform module exists (infra gap, not config gap)
|
|
103
|
+
|
|
99
104
|
- Microsoft Defender for Cloud (Containers/SQL/Storage/Key Vault plans)
|
|
100
105
|
- Static Web Apps
|
|
101
106
|
- Azure DevOps pipelines (stack uses GitHub Actions instead — confirm this
|
|
@@ -104,16 +109,19 @@ broader firewall rule for the Container Apps subnet's egress IP.
|
|
|
104
109
|
won't ever be a fuel.yml field)
|
|
105
110
|
|
|
106
111
|
## Still need to verify
|
|
112
|
+
|
|
107
113
|
- Count actual `azurerm_private_endpoint`-equivalent resources created
|
|
108
114
|
today (SQL, Redis) vs. the prod spec line "5 private endpoints x 730h,
|
|
109
|
-
100GB in/out" — only confirmed the network
|
|
115
|
+
100GB in/out" — only confirmed the network _structure_ (subnets/DNS
|
|
110
116
|
zones) exists, not an exact endpoint count against spec.
|
|
111
117
|
|
|
112
118
|
## Action not yet taken
|
|
119
|
+
|
|
113
120
|
- No one has actually scaffolded `infra-prod` yet (new `fuel.yml` + running
|
|
114
121
|
the CLI generation into a separate target dir). Isolation is designed but
|
|
115
122
|
not yet real until that runs.
|
|
116
123
|
|
|
117
124
|
## Suggested next pick (unresolved — pick one to start)
|
|
125
|
+
|
|
118
126
|
- GitHub Environments wiring (workflow template + docs)
|
|
119
127
|
- Front Door WAF (schema + module)
|
|
@@ -8,7 +8,7 @@ on a machine without Node/`fuel` installed (e.g. CI runner, teammate's laptop).
|
|
|
8
8
|
Everything below assumes this `infra/` folder was already generated once by
|
|
9
9
|
`fuel infra:init` (so `backend.tf`/`default.tfvars` are already patched with real
|
|
10
10
|
names, not the `{placeholder}` tokens from the template source). If that never ran,
|
|
11
|
-
you don't have a project to deploy yet — this doc only replaces the
|
|
11
|
+
you don't have a project to deploy yet — this doc only replaces the _deploy_ step.
|
|
12
12
|
|
|
13
13
|
## 0. Prerequisites
|
|
14
14
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
# 🌍 Terraform Project: Infrastructure Setup
|
|
3
2
|
|
|
4
3
|
This Terraform project is designed to first create a centralized secret in AWS Secrets Manager, which serves as the foundation for provisioning the rest of the infrastructure.
|
|
@@ -10,15 +9,15 @@ Before you begin, ensure the following:
|
|
|
10
9
|
- [Terraform](https://www.terraform.io/downloads.html) is installed and available in your `PATH`
|
|
11
10
|
- AWS CLI is configured with appropriate credentials and region
|
|
12
11
|
- Permissions for creating the environment
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
- AmazonECS_FullAccess
|
|
13
|
+
- AmazonElastiCacheFullAccess
|
|
14
|
+
- AmazonRDSFullAccess
|
|
15
|
+
- AmazonS3FullAccess
|
|
16
|
+
- AWSCloudTrail_FullAccess
|
|
17
|
+
- AWSCodeBuildAdminAccess
|
|
18
|
+
- AWSCodePipeline_FullAccess
|
|
19
|
+
- CloudWatchFullAccessV2
|
|
20
|
+
- IAMFullAccess
|
|
22
21
|
|
|
23
22
|
### 🌐 Creating an ACM Certificate for Your Domain
|
|
24
23
|
|
|
@@ -61,92 +60,101 @@ To deploy secure resources using the Infrastructure Automation Script, follow th
|
|
|
61
60
|
- **HOST_URL**: Similarly, this URL is currently pointing to Flatirons' domain, and you will need to change it to match your own domain.
|
|
62
61
|
- **ssl**: Copy the certificate arn from the previous step
|
|
63
62
|
|
|
63
|
+
### 🌱 How to Modify app.json
|
|
64
64
|
|
|
65
|
-
### 🌱 How to Modify app.json
|
|
66
|
-
|
|
67
65
|
##### 1. **SSL Certificate ARN**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
|
|
67
|
+
- Replace the `"ssl"` field with the correct ARN for your SSL certificate, which you should have obtained through AWS Certificate Manager (ACM):
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
"ssl": "arn:aws:acm:========================="
|
|
71
|
+
```
|
|
72
|
+
|
|
73
73
|
##### 2. **Access IP Range**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
|
|
75
|
+
- Update the `"access_ip_range"` field to specify the IP range that can access your database. You can enter your IP address or any other IP range:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
"access_ip_range": "73.153.163.118/32"
|
|
79
|
+
```
|
|
79
80
|
|
|
80
81
|
##### 3. **Cognito API Key Header**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
|
|
83
|
+
- Ensure the `"cognito_apikey_header"` field points to the header for API key authentication if you are using Cognito for authentication:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
"cognito_apikey_header": "x-api-key"
|
|
87
|
+
```
|
|
88
|
+
|
|
86
89
|
##### 4. **Slack Webhook URL**
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
|
|
91
|
+
- Provide your Slack Webhook URL to receive alarms. If you don't have one, you can use the default placeholder URL:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
"slack_webhook_url": "Enter webhook URL to receive alarms or set default value https://hooks.slack.com/services/YOUR_WORKSPACE_ID/YOUR_CHANNEL_ID/YOUR_WEBHOOK_TOKEN"
|
|
95
|
+
```
|
|
92
96
|
|
|
93
97
|
##### 5. **Environment Setup**
|
|
94
|
-
- Update the `"name"` field with your project name:
|
|
95
|
-
|
|
96
|
-
```json
|
|
97
|
-
"name": "your-project"
|
|
98
|
-
```
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
"deployment": "ecs"
|
|
104
|
-
```
|
|
99
|
+
- Update the `"name"` field with your project name:
|
|
105
100
|
|
|
106
|
-
|
|
101
|
+
```json
|
|
102
|
+
"name": "your-project"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- The `"deployment"` field specifies the deployment method (ecs or eks):
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
"deployment": "ecs"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Nota: This application only works with ecs
|
|
107
112
|
|
|
108
113
|
##### 6. **Application Modules Configuration**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
|
|
115
|
+
- Modify the `"modules"` field to set the options for the different modules you are using in your application. For instance:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
"modules": "[{'name': 'auth', 'options': {'two_factor': False, 'invitation_only': False, 'remove_sign_up_phone': False}}, {'name': 'team', 'options': {'remove': True}}, {'name': 'billing', 'options': {'remove_stripe': True}}, {'name': 'e2e', 'options': {'remove': True}}]"
|
|
119
|
+
```
|
|
114
120
|
|
|
115
121
|
##### 7. **Application Configurations for API and Web**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
122
|
+
|
|
123
|
+
- Modify the application configuration under the `"apps"` section. For each app (e.g., `projectname-dev-api`, `projectname-staging-api`), update the following:
|
|
124
|
+
|
|
125
|
+
- **Domain Name**: Set the domain for each app.
|
|
126
|
+
- **API Keys and Secrets**: Ensure all required API keys and secrets (like Snowflake, JWT) are correctly configured.
|
|
127
|
+
- **Environment Variables**: Update any specific environment variables (e.g., `HOST_URL`, `FRONT_END_URL`).
|
|
128
|
+
|
|
129
|
+
Example for the **dev API app**:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
"apps": [
|
|
133
|
+
{
|
|
134
|
+
"name": "projectname-dev-api",
|
|
135
|
+
"technology": "nest",
|
|
136
|
+
"dockerfile": "apps/api/Dockerfile",
|
|
137
|
+
"health_check_path": "/health",
|
|
138
|
+
"domain": "projectname-dev-api.******.com",
|
|
139
|
+
"port": 3000,
|
|
140
|
+
"cognito": false,
|
|
141
|
+
"postgres": false,
|
|
142
|
+
"redis": false,
|
|
143
|
+
"variables": {
|
|
144
|
+
"NODE_TLS_REJECT_UNAUTHORIZED": 0,
|
|
145
|
+
"API_KEY_HEADER": "x-api-key",
|
|
146
|
+
"ENCRYPTION_PASSWORD": "xxxxxxxxxxxxxxx",
|
|
147
|
+
"HOST_URL": "https://projectname-dev-api.****.com",
|
|
148
|
+
"FRONT_END_URL": "https://projectname-dev.******.com",
|
|
149
|
+
"APP_NAME": "AppName",
|
|
150
|
+
"APP_COMPANY": "Flatirons",
|
|
151
|
+
"ADMIN_JS_EMAIL": "admin@flatirons.com",
|
|
152
|
+
"ADMIN_JS_PASSWORD": "xxxxxxxxxxxxxxxxx!!!"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
```
|
|
157
|
+
|
|
150
158
|
---
|
|
151
159
|
|
|
152
160
|
## 🚀 Usage
|
|
@@ -165,6 +173,7 @@ To begin, initialize the project and apply the `secret-main` module to create th
|
|
|
165
173
|
Note: For this step the config.json file is mandatory, please request it from the project administrator and place it at the root of the project directory
|
|
166
174
|
|
|
167
175
|
Region=fill your region below (if it is different from us-east-1)
|
|
176
|
+
|
|
168
177
|
```bash
|
|
169
178
|
cd modules/secret-main
|
|
170
179
|
terraform init -backend-config="region=us-east-1"
|
|
@@ -177,6 +186,7 @@ terraform apply
|
|
|
177
186
|
After the centralized secret is in place, proceed to initialize and apply the full infrastructure:
|
|
178
187
|
|
|
179
188
|
Region=fill your region below (if it is different from us-east-1)
|
|
189
|
+
|
|
180
190
|
```bash
|
|
181
191
|
terraform init -backend-config="region=us-east-1"
|
|
182
192
|
terraform plan
|