@gambi97/keel-cli 0.1.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/LICENSE +21 -0
- package/README.md +401 -0
- package/dist/bootstrap/github.js +190 -0
- package/dist/bootstrap/infisical.js +95 -0
- package/dist/bootstrap/scaleway.js +65 -0
- package/dist/config.js +153 -0
- package/dist/generate.js +104 -0
- package/dist/index.js +294 -0
- package/dist/prompts.js +109 -0
- package/dist/state.js +29 -0
- package/dist/ui.js +76 -0
- package/package.json +61 -0
- package/templates/.github/scripts/sync-database-url.sh +49 -0
- package/templates/.github/workflows/terraform-apply.yml +103 -0
- package/templates/.github/workflows/terraform-drift.yml +91 -0
- package/templates/.github/workflows/terraform-plan.yml +63 -0
- package/templates/LICENSE +21 -0
- package/templates/README.md +164 -0
- package/templates/_gitignore +28 -0
- package/templates/backend.hcl.example +9 -0
- package/templates/backend.tf +19 -0
- package/templates/main.tf +28 -0
- package/templates/modules/app_stack/main.tf +70 -0
- package/templates/modules/app_stack/outputs.tf +23 -0
- package/templates/modules/app_stack/variables.tf +55 -0
- package/templates/modules/app_stack/versions.tf +7 -0
- package/templates/outputs.tf +20 -0
- package/templates/prod.tfvars +7 -0
- package/templates/providers.tf +16 -0
- package/templates/staging.tfvars +7 -0
- package/templates/variables.tf +96 -0
- package/templates/versions.tf +15 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
output "container_url" {
|
|
2
|
+
description = "Auto-generated Scaleway URL of the deployed container (null until an image is deployed)."
|
|
3
|
+
value = module.app_stack.container_url
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
output "registry_endpoint" {
|
|
7
|
+
description = "Container Registry endpoint to push application images to."
|
|
8
|
+
value = module.app_stack.registry_endpoint
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
output "database_url" {
|
|
12
|
+
description = "Ready-to-use Postgres connection string (dedicated least-privilege IAM credential)."
|
|
13
|
+
value = module.app_stack.database_url
|
|
14
|
+
sensitive = true
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
output "container_namespace_id" {
|
|
18
|
+
description = "Scaleway Containers namespace ID."
|
|
19
|
+
value = module.app_stack.container_namespace_id
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Scaleway credentials are read from the environment:
|
|
2
|
+
# SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_DEFAULT_PROJECT_ID, SCW_DEFAULT_ORGANIZATION_ID
|
|
3
|
+
provider "scaleway" {
|
|
4
|
+
region = var.region
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
provider "infisical" {
|
|
8
|
+
host = var.infisical_host
|
|
9
|
+
|
|
10
|
+
auth = {
|
|
11
|
+
universal = {
|
|
12
|
+
client_id = var.infisical_client_id
|
|
13
|
+
client_secret = var.infisical_client_secret
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
variable "project_name" {
|
|
2
|
+
description = "Project name, used as prefix for every resource."
|
|
3
|
+
type = string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
variable "region" {
|
|
7
|
+
description = "Scaleway region."
|
|
8
|
+
type = string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
variable "environment" {
|
|
12
|
+
description = "Deployment environment. Must match the Terraform workspace and the Infisical environment slug."
|
|
13
|
+
type = string
|
|
14
|
+
|
|
15
|
+
validation {
|
|
16
|
+
condition = contains(["staging", "prod"], var.environment)
|
|
17
|
+
error_message = "environment must be either \"staging\" or \"prod\"."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
variable "container_image" {
|
|
22
|
+
description = "Full registry image to deploy (e.g. rg.fr-par.scw.cloud/ns/app:tag). Leave empty to provision everything except the container."
|
|
23
|
+
type = string
|
|
24
|
+
default = ""
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
variable "container_port" {
|
|
28
|
+
description = "Port the application listens on."
|
|
29
|
+
type = number
|
|
30
|
+
default = 8080
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
variable "cpu_limit" {
|
|
34
|
+
description = "Container CPU limit in mvCPU."
|
|
35
|
+
type = number
|
|
36
|
+
default = 500
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
variable "memory_limit" {
|
|
40
|
+
description = "Container memory limit in MB."
|
|
41
|
+
type = number
|
|
42
|
+
default = 1024
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
variable "min_scale" {
|
|
46
|
+
description = "Minimum number of container instances."
|
|
47
|
+
type = number
|
|
48
|
+
default = 0
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
variable "max_scale" {
|
|
52
|
+
description = "Maximum number of container instances."
|
|
53
|
+
type = number
|
|
54
|
+
default = 2
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
variable "db_min_cpu" {
|
|
58
|
+
description = "Serverless SQL Database minimum CPU."
|
|
59
|
+
type = number
|
|
60
|
+
default = 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
variable "db_max_cpu" {
|
|
64
|
+
description = "Serverless SQL Database maximum CPU."
|
|
65
|
+
type = number
|
|
66
|
+
default = 4
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
variable "enable_basic_auth" {
|
|
70
|
+
description = "When true, the container gets BASIC_AUTH_ENABLED=true and the app is expected to enforce Basic Auth using credentials stored in Infisical."
|
|
71
|
+
type = bool
|
|
72
|
+
default = false
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
variable "infisical_host" {
|
|
76
|
+
description = "Infisical instance URL."
|
|
77
|
+
type = string
|
|
78
|
+
default = "https://app.infisical.com"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
variable "infisical_project_id" {
|
|
82
|
+
description = "Infisical project (workspace) ID holding the application secrets."
|
|
83
|
+
type = string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
variable "infisical_client_id" {
|
|
87
|
+
description = "Infisical machine identity client ID (Universal Auth)."
|
|
88
|
+
type = string
|
|
89
|
+
sensitive = true
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
variable "infisical_client_secret" {
|
|
93
|
+
description = "Infisical machine identity client secret (Universal Auth)."
|
|
94
|
+
type = string
|
|
95
|
+
sensitive = true
|
|
96
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
# 1.10+ is required for S3-native state locking (use_lockfile).
|
|
3
|
+
required_version = ">= 1.10.0"
|
|
4
|
+
|
|
5
|
+
required_providers {
|
|
6
|
+
scaleway = {
|
|
7
|
+
source = "scaleway/scaleway"
|
|
8
|
+
version = "~> 2.0"
|
|
9
|
+
}
|
|
10
|
+
infisical = {
|
|
11
|
+
source = "infisical/infisical"
|
|
12
|
+
version = "~> 0.15"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|