@salte-common/terraflow 0.1.0-alpha.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 +22 -0
- package/README.md +278 -0
- package/RELEASE_SUMMARY.md +53 -0
- package/STANDARDS_COMPLIANCE.md +85 -0
- package/bin/terraflow.js +3 -0
- package/bin/tf.js +3 -0
- package/dist/commands/apply.d.ts +7 -0
- package/dist/commands/apply.js +12 -0
- package/dist/commands/base.d.ts +7 -0
- package/dist/commands/base.js +12 -0
- package/dist/commands/config.d.ts +25 -0
- package/dist/commands/config.js +354 -0
- package/dist/commands/destroy.d.ts +7 -0
- package/dist/commands/destroy.js +12 -0
- package/dist/commands/init.d.ts +68 -0
- package/dist/commands/init.js +131 -0
- package/dist/commands/plan.d.ts +7 -0
- package/dist/commands/plan.js +12 -0
- package/dist/core/backend-state.d.ts +25 -0
- package/dist/core/backend-state.js +77 -0
- package/dist/core/config.d.ts +83 -0
- package/dist/core/config.js +295 -0
- package/dist/core/context.d.ts +52 -0
- package/dist/core/context.js +192 -0
- package/dist/core/environment.d.ts +62 -0
- package/dist/core/environment.js +205 -0
- package/dist/core/errors.d.ts +22 -0
- package/dist/core/errors.js +36 -0
- package/dist/core/plugin-loader.d.ts +21 -0
- package/dist/core/plugin-loader.js +136 -0
- package/dist/core/terraform.d.ts +45 -0
- package/dist/core/terraform.js +247 -0
- package/dist/core/validator.d.ts +103 -0
- package/dist/core/validator.js +304 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +184 -0
- package/dist/plugins/auth/aws-assume-role.d.ts +10 -0
- package/dist/plugins/auth/aws-assume-role.js +110 -0
- package/dist/plugins/auth/azure-service-principal.d.ts +10 -0
- package/dist/plugins/auth/azure-service-principal.js +99 -0
- package/dist/plugins/auth/gcp-service-account.d.ts +10 -0
- package/dist/plugins/auth/gcp-service-account.js +105 -0
- package/dist/plugins/backends/azurerm.d.ts +10 -0
- package/dist/plugins/backends/azurerm.js +117 -0
- package/dist/plugins/backends/gcs.d.ts +10 -0
- package/dist/plugins/backends/gcs.js +75 -0
- package/dist/plugins/backends/local.d.ts +11 -0
- package/dist/plugins/backends/local.js +37 -0
- package/dist/plugins/backends/s3.d.ts +10 -0
- package/dist/plugins/backends/s3.js +185 -0
- package/dist/plugins/secrets/aws-secrets.d.ts +12 -0
- package/dist/plugins/secrets/aws-secrets.js +125 -0
- package/dist/plugins/secrets/azure-keyvault.d.ts +12 -0
- package/dist/plugins/secrets/azure-keyvault.js +178 -0
- package/dist/plugins/secrets/env.d.ts +24 -0
- package/dist/plugins/secrets/env.js +62 -0
- package/dist/plugins/secrets/gcp-secret-manager.d.ts +12 -0
- package/dist/plugins/secrets/gcp-secret-manager.js +157 -0
- package/dist/templates/application/go/go.mod.template +4 -0
- package/dist/templates/application/go/main.template +8 -0
- package/dist/templates/application/go/test.template +11 -0
- package/dist/templates/application/javascript/main.template +14 -0
- package/dist/templates/application/javascript/test.template +8 -0
- package/dist/templates/application/python/main.template +13 -0
- package/dist/templates/application/python/requirements.txt.template +3 -0
- package/dist/templates/application/python/test.template +8 -0
- package/dist/templates/application/typescript/main.template +14 -0
- package/dist/templates/application/typescript/test.template +8 -0
- package/dist/templates/application/typescript/tsconfig.json.template +20 -0
- package/dist/templates/config/README.md.template +82 -0
- package/dist/templates/config/env.example.template +22 -0
- package/dist/templates/config/gitignore.template +40 -0
- package/dist/templates/config/tfwconfig.yml.template +69 -0
- package/dist/templates/templates/application/go/go.mod.template +4 -0
- package/dist/templates/templates/application/go/main.template +8 -0
- package/dist/templates/templates/application/go/test.template +11 -0
- package/dist/templates/templates/application/javascript/main.template +14 -0
- package/dist/templates/templates/application/javascript/test.template +8 -0
- package/dist/templates/templates/application/python/main.template +13 -0
- package/dist/templates/templates/application/python/requirements.txt.template +3 -0
- package/dist/templates/templates/application/python/test.template +8 -0
- package/dist/templates/templates/application/typescript/main.template +14 -0
- package/dist/templates/templates/application/typescript/test.template +8 -0
- package/dist/templates/templates/application/typescript/tsconfig.json.template +20 -0
- package/dist/templates/templates/config/README.md.template +82 -0
- package/dist/templates/templates/config/env.example.template +22 -0
- package/dist/templates/templates/config/gitignore.template +40 -0
- package/dist/templates/templates/config/tfwconfig.yml.template +69 -0
- package/dist/templates/templates/terraform/aws/_init.tf.template +24 -0
- package/dist/templates/templates/terraform/aws/inputs.tf.template +11 -0
- package/dist/templates/templates/terraform/azure/_init.tf.template +19 -0
- package/dist/templates/templates/terraform/azure/inputs.tf.template +11 -0
- package/dist/templates/templates/terraform/gcp/_init.tf.template +20 -0
- package/dist/templates/templates/terraform/gcp/inputs.tf.template +16 -0
- package/dist/templates/templates/terraform/locals.tf.template +9 -0
- package/dist/templates/templates/terraform/main.tf.template +8 -0
- package/dist/templates/templates/terraform/modules/inputs.tf.template +5 -0
- package/dist/templates/templates/terraform/modules/main.tf.template +2 -0
- package/dist/templates/templates/terraform/modules/outputs.tf.template +2 -0
- package/dist/templates/templates/terraform/outputs.tf.template +6 -0
- package/dist/templates/terraform/aws/_init.tf.template +24 -0
- package/dist/templates/terraform/aws/inputs.tf.template +11 -0
- package/dist/templates/terraform/azure/_init.tf.template +19 -0
- package/dist/templates/terraform/azure/inputs.tf.template +11 -0
- package/dist/templates/terraform/gcp/_init.tf.template +20 -0
- package/dist/templates/terraform/gcp/inputs.tf.template +16 -0
- package/dist/templates/terraform/locals.tf.template +9 -0
- package/dist/templates/terraform/main.tf.template +8 -0
- package/dist/templates/terraform/modules/inputs.tf.template +5 -0
- package/dist/templates/terraform/modules/main.tf.template +2 -0
- package/dist/templates/terraform/modules/outputs.tf.template +2 -0
- package/dist/templates/terraform/outputs.tf.template +6 -0
- package/dist/types/config.d.ts +92 -0
- package/dist/types/config.js +6 -0
- package/dist/types/context.d.ts +59 -0
- package/dist/types/context.js +6 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +23 -0
- package/dist/types/plugins.d.ts +77 -0
- package/dist/types/plugins.js +6 -0
- package/dist/utils/cloud.d.ts +43 -0
- package/dist/utils/cloud.js +150 -0
- package/dist/utils/git.d.ts +88 -0
- package/dist/utils/git.js +258 -0
- package/dist/utils/logger.d.ts +67 -0
- package/dist/utils/logger.js +121 -0
- package/dist/utils/scaffolding.d.ts +92 -0
- package/dist/utils/scaffolding.js +338 -0
- package/dist/utils/templates.d.ts +25 -0
- package/dist/utils/templates.js +70 -0
- package/package.json +60 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"declaration": true,
|
|
14
|
+
"declarationMap": true,
|
|
15
|
+
"sourceMap": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["node_modules", "dist"]
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# <project-name>
|
|
2
|
+
|
|
3
|
+
Infrastructure as Code project managed with [Terraflow](https://github.com/salte-common/terraflow).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- [Terraform](https://www.terraform.io/downloads) >= 1.0
|
|
8
|
+
- [Node.js](https://nodejs.org/) >= 18.x
|
|
9
|
+
- [Terraflow](https://www.npmjs.com/package/terraflow): `npm install -g terraflow`
|
|
10
|
+
- Cloud provider credentials (<provider>)
|
|
11
|
+
|
|
12
|
+
## Getting Started
|
|
13
|
+
|
|
14
|
+
1. Copy `.env.example` to `.env` and configure your credentials:
|
|
15
|
+
```bash
|
|
16
|
+
cp .env.example .env
|
|
17
|
+
# Edit .env with your credentials
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. Review and update `.tfwconfig.yml` with your backend configuration
|
|
21
|
+
|
|
22
|
+
3. Initialize Terraform:
|
|
23
|
+
```bash
|
|
24
|
+
terraflow init
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
4. Plan your infrastructure:
|
|
28
|
+
```bash
|
|
29
|
+
terraflow plan
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
5. Apply your infrastructure:
|
|
33
|
+
```bash
|
|
34
|
+
terraflow apply
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Project Structure
|
|
38
|
+
|
|
39
|
+
- `src/` - Application source code
|
|
40
|
+
- `main/` - Main application code
|
|
41
|
+
- `test/` - Test files
|
|
42
|
+
- `terraform/` - Infrastructure as Code
|
|
43
|
+
- `modules/` - Reusable Terraform modules
|
|
44
|
+
- `_init.tf` - Provider and backend configuration
|
|
45
|
+
- `*.tf` - Main terraform configuration
|
|
46
|
+
- `.tfwconfig.yml` - Terraflow configuration
|
|
47
|
+
- `.env` - Local environment variables (not committed)
|
|
48
|
+
|
|
49
|
+
## Terraflow Commands
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Initialize terraform and workspace
|
|
53
|
+
terraflow init
|
|
54
|
+
|
|
55
|
+
# Plan changes
|
|
56
|
+
terraflow plan
|
|
57
|
+
|
|
58
|
+
# Apply changes
|
|
59
|
+
terraflow apply
|
|
60
|
+
|
|
61
|
+
# Destroy infrastructure
|
|
62
|
+
terraflow destroy
|
|
63
|
+
|
|
64
|
+
# Show current configuration
|
|
65
|
+
terraflow config show
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Workspace Management
|
|
69
|
+
|
|
70
|
+
Terraflow automatically derives workspace names from your git branch:
|
|
71
|
+
- Main branch → `main` workspace
|
|
72
|
+
- Feature branches (e.g., `feature/new-api`) → hostname-based workspace
|
|
73
|
+
- Can be overridden with `--workspace` flag
|
|
74
|
+
|
|
75
|
+
## Configuration
|
|
76
|
+
|
|
77
|
+
See `.tfwconfig.yml` for all available options and the [documentation](https://github.com/salte-common/terraflow/blob/main/docs/configuration.md) for detailed configuration reference.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT
|
|
82
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AWS Credentials (for S3 backend and AWS provider)
|
|
2
|
+
# AWS_ACCESS_KEY_ID=your_access_key
|
|
3
|
+
# AWS_SECRET_ACCESS_KEY=your_secret_key
|
|
4
|
+
# AWS_REGION=us-east-1
|
|
5
|
+
|
|
6
|
+
# Azure Credentials (for Azure backend and provider)
|
|
7
|
+
# ARM_CLIENT_ID=your_client_id
|
|
8
|
+
# ARM_CLIENT_SECRET=your_client_secret
|
|
9
|
+
# ARM_SUBSCRIPTION_ID=your_subscription_id
|
|
10
|
+
# ARM_TENANT_ID=your_tenant_id
|
|
11
|
+
|
|
12
|
+
# GCP Credentials (for GCS backend and GCP provider)
|
|
13
|
+
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
|
|
14
|
+
# GCP_PROJECT_ID=your-project-id
|
|
15
|
+
|
|
16
|
+
# Terraflow Configuration
|
|
17
|
+
# TERRAFLOW_WORKSPACE=development
|
|
18
|
+
# TERRAFLOW_SKIP_COMMIT_CHECK=false
|
|
19
|
+
|
|
20
|
+
# Terraform Variables (TF_VAR_*)
|
|
21
|
+
# TF_VAR_environment=development
|
|
22
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Terraform
|
|
2
|
+
**/.terraform/*
|
|
3
|
+
*.tfstate
|
|
4
|
+
*.tfstate.*
|
|
5
|
+
*.tfvars
|
|
6
|
+
.terraform.lock.hcl
|
|
7
|
+
|
|
8
|
+
# Terraflow
|
|
9
|
+
.terraflow/
|
|
10
|
+
|
|
11
|
+
# Environment
|
|
12
|
+
.env
|
|
13
|
+
|
|
14
|
+
# Language-specific (adjust based on --language)
|
|
15
|
+
# Node.js:
|
|
16
|
+
node_modules/
|
|
17
|
+
npm-debug.log*
|
|
18
|
+
dist/
|
|
19
|
+
|
|
20
|
+
# Python:
|
|
21
|
+
__pycache__/
|
|
22
|
+
*.py[cod]
|
|
23
|
+
venv/
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
|
|
27
|
+
# Go:
|
|
28
|
+
*.exe
|
|
29
|
+
*.dll
|
|
30
|
+
*.so
|
|
31
|
+
*.dylib
|
|
32
|
+
vendor/
|
|
33
|
+
|
|
34
|
+
# IDE
|
|
35
|
+
.vscode/
|
|
36
|
+
.idea/
|
|
37
|
+
*.swp
|
|
38
|
+
*.swo
|
|
39
|
+
.DS_Store
|
|
40
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Terraflow configuration
|
|
2
|
+
# See: https://github.com/salte-common/terraflow/blob/main/docs/configuration.md
|
|
3
|
+
|
|
4
|
+
# Working directory for terraform files
|
|
5
|
+
working-dir: ./terraform
|
|
6
|
+
|
|
7
|
+
# Workspace derivation strategy
|
|
8
|
+
workspace_strategy:
|
|
9
|
+
- cli
|
|
10
|
+
- env
|
|
11
|
+
- tag
|
|
12
|
+
- branch
|
|
13
|
+
- hostname
|
|
14
|
+
|
|
15
|
+
# Backend configuration (adjust for your provider)
|
|
16
|
+
backend:
|
|
17
|
+
type: <provider> # local, s3, azurerm, or gcs
|
|
18
|
+
config:
|
|
19
|
+
# Template variables are supported: ${VAR_NAME}
|
|
20
|
+
# See documentation for available template variables
|
|
21
|
+
|
|
22
|
+
# Uncomment and configure based on your provider:
|
|
23
|
+
|
|
24
|
+
# AWS S3 Backend:
|
|
25
|
+
# bucket: ${AWS_REGION}-${AWS_ACCOUNT_ID}-terraform-state
|
|
26
|
+
# key: ${GITHUB_REPOSITORY}
|
|
27
|
+
# region: ${AWS_REGION}
|
|
28
|
+
# dynamodb_table: terraform-statelock
|
|
29
|
+
# encrypt: true
|
|
30
|
+
|
|
31
|
+
# Azure Backend:
|
|
32
|
+
# storage_account_name: mystorageaccount
|
|
33
|
+
# container_name: tfstate
|
|
34
|
+
# key: terraform.tfstate
|
|
35
|
+
|
|
36
|
+
# GCP Backend:
|
|
37
|
+
# bucket: my-gcs-bucket
|
|
38
|
+
# prefix: terraform/state
|
|
39
|
+
|
|
40
|
+
# Uncomment to configure secrets from secret manager
|
|
41
|
+
# secrets:
|
|
42
|
+
# provider: env # env | aws-secrets | azure-keyvault | gcp-secret-manager
|
|
43
|
+
# config:
|
|
44
|
+
# # AWS Secrets Manager:
|
|
45
|
+
# # region: us-east-1
|
|
46
|
+
# # secret_name: <project-name>/terraform-vars
|
|
47
|
+
#
|
|
48
|
+
# # Azure Key Vault:
|
|
49
|
+
# # vault_name: my-keyvault
|
|
50
|
+
#
|
|
51
|
+
# # GCP Secret Manager:
|
|
52
|
+
# # project_id: my-project
|
|
53
|
+
|
|
54
|
+
# Terraform variables
|
|
55
|
+
variables:
|
|
56
|
+
environment: development
|
|
57
|
+
|
|
58
|
+
# Validations
|
|
59
|
+
validations:
|
|
60
|
+
require_git_commit: true
|
|
61
|
+
# allowed_workspaces:
|
|
62
|
+
# - development
|
|
63
|
+
# - staging
|
|
64
|
+
# - production
|
|
65
|
+
|
|
66
|
+
# Logging
|
|
67
|
+
logging:
|
|
68
|
+
level: info
|
|
69
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
aws = {
|
|
6
|
+
source = "hashicorp/aws"
|
|
7
|
+
version = "~> 5.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "s3" {
|
|
12
|
+
# Backend configuration provided via:
|
|
13
|
+
# - terraflow CLI flags
|
|
14
|
+
# - environment variables (TERRAFLOW_*)
|
|
15
|
+
# - .tfwconfig.yml
|
|
16
|
+
#
|
|
17
|
+
# Do not hardcode values here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
provider "aws" {
|
|
22
|
+
region = var.aws_region
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
azurerm = {
|
|
6
|
+
source = "hashicorp/azurerm"
|
|
7
|
+
version = "~> 3.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "azurerm" {
|
|
12
|
+
# Backend configuration provided via terraflow
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
provider "azurerm" {
|
|
17
|
+
features {}
|
|
18
|
+
}
|
|
19
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
google = {
|
|
6
|
+
source = "hashicorp/google"
|
|
7
|
+
version = "~> 5.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "gcs" {
|
|
12
|
+
# Backend configuration provided via terraflow
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
provider "google" {
|
|
17
|
+
project = var.gcp_project_id
|
|
18
|
+
region = var.gcp_region
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
variable "gcp_project_id" {
|
|
2
|
+
description = "GCP project ID"
|
|
3
|
+
type = string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
variable "gcp_region" {
|
|
7
|
+
description = "GCP region for resources"
|
|
8
|
+
type = string
|
|
9
|
+
default = "us-central1"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "environment" {
|
|
13
|
+
description = "Environment name"
|
|
14
|
+
type = string
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
aws = {
|
|
6
|
+
source = "hashicorp/aws"
|
|
7
|
+
version = "~> 5.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "s3" {
|
|
12
|
+
# Backend configuration provided via:
|
|
13
|
+
# - terraflow CLI flags
|
|
14
|
+
# - environment variables (TERRAFLOW_*)
|
|
15
|
+
# - .tfwconfig.yml
|
|
16
|
+
#
|
|
17
|
+
# Do not hardcode values here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
provider "aws" {
|
|
22
|
+
region = var.aws_region
|
|
23
|
+
}
|
|
24
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
azurerm = {
|
|
6
|
+
source = "hashicorp/azurerm"
|
|
7
|
+
version = "~> 3.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "azurerm" {
|
|
12
|
+
# Backend configuration provided via terraflow
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
provider "azurerm" {
|
|
17
|
+
features {}
|
|
18
|
+
}
|
|
19
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_version = ">= 1.0"
|
|
3
|
+
|
|
4
|
+
required_providers {
|
|
5
|
+
google = {
|
|
6
|
+
source = "hashicorp/google"
|
|
7
|
+
version = "~> 5.0"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
backend "gcs" {
|
|
12
|
+
# Backend configuration provided via terraflow
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
provider "google" {
|
|
17
|
+
project = var.gcp_project_id
|
|
18
|
+
region = var.gcp_region
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
variable "gcp_project_id" {
|
|
2
|
+
description = "GCP project ID"
|
|
3
|
+
type = string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
variable "gcp_region" {
|
|
7
|
+
description = "GCP region for resources"
|
|
8
|
+
type = string
|
|
9
|
+
default = "us-central1"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
variable "environment" {
|
|
13
|
+
description = "Environment name"
|
|
14
|
+
type = string
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration type definitions for Terraflow CLI
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Backend configuration
|
|
6
|
+
*/
|
|
7
|
+
export interface BackendConfig {
|
|
8
|
+
/** Backend type: local | s3 | azurerm | gcs */
|
|
9
|
+
type: string;
|
|
10
|
+
/** Backend-specific configuration */
|
|
11
|
+
config?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Secrets provider configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface SecretsConfig {
|
|
17
|
+
/** Secrets provider type: env | aws-secrets | azure-keyvault | gcp-secret-manager */
|
|
18
|
+
provider: string;
|
|
19
|
+
/** Provider-specific configuration */
|
|
20
|
+
config?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Authentication configuration
|
|
24
|
+
*/
|
|
25
|
+
export interface AuthConfig {
|
|
26
|
+
/** AWS assume role configuration */
|
|
27
|
+
assume_role?: {
|
|
28
|
+
role_arn: string;
|
|
29
|
+
session_name?: string;
|
|
30
|
+
duration?: number;
|
|
31
|
+
};
|
|
32
|
+
/** Azure service principal configuration */
|
|
33
|
+
service_principal?: {
|
|
34
|
+
client_id: string;
|
|
35
|
+
tenant_id: string;
|
|
36
|
+
client_secret?: string;
|
|
37
|
+
};
|
|
38
|
+
/** GCP service account configuration */
|
|
39
|
+
service_account?: {
|
|
40
|
+
key_file: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Workspace derivation strategy
|
|
45
|
+
*/
|
|
46
|
+
export type WorkspaceStrategy = 'cli' | 'env' | 'tag' | 'branch' | 'hostname';
|
|
47
|
+
/**
|
|
48
|
+
* Logging configuration
|
|
49
|
+
*/
|
|
50
|
+
export interface LoggingConfig {
|
|
51
|
+
/** Log level: error | warn | info | debug */
|
|
52
|
+
level: 'error' | 'warn' | 'info' | 'debug';
|
|
53
|
+
/** Enable Terraform log output */
|
|
54
|
+
terraform_log?: boolean;
|
|
55
|
+
/** Terraform log level */
|
|
56
|
+
terraform_log_level?: 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Validation configuration
|
|
60
|
+
*/
|
|
61
|
+
export interface ValidationConfig {
|
|
62
|
+
/** Require git commit before apply/destroy */
|
|
63
|
+
require_git_commit?: boolean;
|
|
64
|
+
/** List of allowed workspace names (empty = allow all) */
|
|
65
|
+
allowed_workspaces?: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Main Terraflow configuration file structure
|
|
69
|
+
*/
|
|
70
|
+
export interface TerraflowConfig {
|
|
71
|
+
/** Workspace name */
|
|
72
|
+
workspace?: string;
|
|
73
|
+
/** Terraform working directory */
|
|
74
|
+
'working-dir'?: string;
|
|
75
|
+
/** Skip git commit check */
|
|
76
|
+
'skip-commit-check'?: boolean;
|
|
77
|
+
/** Backend configuration */
|
|
78
|
+
backend?: BackendConfig;
|
|
79
|
+
/** Secrets management configuration */
|
|
80
|
+
secrets?: SecretsConfig;
|
|
81
|
+
/** Authentication configuration */
|
|
82
|
+
auth?: AuthConfig;
|
|
83
|
+
/** Terraform variables */
|
|
84
|
+
variables?: Record<string, unknown>;
|
|
85
|
+
/** Workspace derivation strategy */
|
|
86
|
+
workspace_strategy?: WorkspaceStrategy[];
|
|
87
|
+
/** Validation configuration */
|
|
88
|
+
validations?: ValidationConfig;
|
|
89
|
+
/** Logging configuration */
|
|
90
|
+
logging?: LoggingConfig;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=config.d.ts.map
|