@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.
Files changed (131) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +278 -0
  3. package/RELEASE_SUMMARY.md +53 -0
  4. package/STANDARDS_COMPLIANCE.md +85 -0
  5. package/bin/terraflow.js +3 -0
  6. package/bin/tf.js +3 -0
  7. package/dist/commands/apply.d.ts +7 -0
  8. package/dist/commands/apply.js +12 -0
  9. package/dist/commands/base.d.ts +7 -0
  10. package/dist/commands/base.js +12 -0
  11. package/dist/commands/config.d.ts +25 -0
  12. package/dist/commands/config.js +354 -0
  13. package/dist/commands/destroy.d.ts +7 -0
  14. package/dist/commands/destroy.js +12 -0
  15. package/dist/commands/init.d.ts +68 -0
  16. package/dist/commands/init.js +131 -0
  17. package/dist/commands/plan.d.ts +7 -0
  18. package/dist/commands/plan.js +12 -0
  19. package/dist/core/backend-state.d.ts +25 -0
  20. package/dist/core/backend-state.js +77 -0
  21. package/dist/core/config.d.ts +83 -0
  22. package/dist/core/config.js +295 -0
  23. package/dist/core/context.d.ts +52 -0
  24. package/dist/core/context.js +192 -0
  25. package/dist/core/environment.d.ts +62 -0
  26. package/dist/core/environment.js +205 -0
  27. package/dist/core/errors.d.ts +22 -0
  28. package/dist/core/errors.js +36 -0
  29. package/dist/core/plugin-loader.d.ts +21 -0
  30. package/dist/core/plugin-loader.js +136 -0
  31. package/dist/core/terraform.d.ts +45 -0
  32. package/dist/core/terraform.js +247 -0
  33. package/dist/core/validator.d.ts +103 -0
  34. package/dist/core/validator.js +304 -0
  35. package/dist/index.d.ts +7 -0
  36. package/dist/index.js +184 -0
  37. package/dist/plugins/auth/aws-assume-role.d.ts +10 -0
  38. package/dist/plugins/auth/aws-assume-role.js +110 -0
  39. package/dist/plugins/auth/azure-service-principal.d.ts +10 -0
  40. package/dist/plugins/auth/azure-service-principal.js +99 -0
  41. package/dist/plugins/auth/gcp-service-account.d.ts +10 -0
  42. package/dist/plugins/auth/gcp-service-account.js +105 -0
  43. package/dist/plugins/backends/azurerm.d.ts +10 -0
  44. package/dist/plugins/backends/azurerm.js +117 -0
  45. package/dist/plugins/backends/gcs.d.ts +10 -0
  46. package/dist/plugins/backends/gcs.js +75 -0
  47. package/dist/plugins/backends/local.d.ts +11 -0
  48. package/dist/plugins/backends/local.js +37 -0
  49. package/dist/plugins/backends/s3.d.ts +10 -0
  50. package/dist/plugins/backends/s3.js +185 -0
  51. package/dist/plugins/secrets/aws-secrets.d.ts +12 -0
  52. package/dist/plugins/secrets/aws-secrets.js +125 -0
  53. package/dist/plugins/secrets/azure-keyvault.d.ts +12 -0
  54. package/dist/plugins/secrets/azure-keyvault.js +178 -0
  55. package/dist/plugins/secrets/env.d.ts +24 -0
  56. package/dist/plugins/secrets/env.js +62 -0
  57. package/dist/plugins/secrets/gcp-secret-manager.d.ts +12 -0
  58. package/dist/plugins/secrets/gcp-secret-manager.js +157 -0
  59. package/dist/templates/application/go/go.mod.template +4 -0
  60. package/dist/templates/application/go/main.template +8 -0
  61. package/dist/templates/application/go/test.template +11 -0
  62. package/dist/templates/application/javascript/main.template +14 -0
  63. package/dist/templates/application/javascript/test.template +8 -0
  64. package/dist/templates/application/python/main.template +13 -0
  65. package/dist/templates/application/python/requirements.txt.template +3 -0
  66. package/dist/templates/application/python/test.template +8 -0
  67. package/dist/templates/application/typescript/main.template +14 -0
  68. package/dist/templates/application/typescript/test.template +8 -0
  69. package/dist/templates/application/typescript/tsconfig.json.template +20 -0
  70. package/dist/templates/config/README.md.template +82 -0
  71. package/dist/templates/config/env.example.template +22 -0
  72. package/dist/templates/config/gitignore.template +40 -0
  73. package/dist/templates/config/tfwconfig.yml.template +69 -0
  74. package/dist/templates/templates/application/go/go.mod.template +4 -0
  75. package/dist/templates/templates/application/go/main.template +8 -0
  76. package/dist/templates/templates/application/go/test.template +11 -0
  77. package/dist/templates/templates/application/javascript/main.template +14 -0
  78. package/dist/templates/templates/application/javascript/test.template +8 -0
  79. package/dist/templates/templates/application/python/main.template +13 -0
  80. package/dist/templates/templates/application/python/requirements.txt.template +3 -0
  81. package/dist/templates/templates/application/python/test.template +8 -0
  82. package/dist/templates/templates/application/typescript/main.template +14 -0
  83. package/dist/templates/templates/application/typescript/test.template +8 -0
  84. package/dist/templates/templates/application/typescript/tsconfig.json.template +20 -0
  85. package/dist/templates/templates/config/README.md.template +82 -0
  86. package/dist/templates/templates/config/env.example.template +22 -0
  87. package/dist/templates/templates/config/gitignore.template +40 -0
  88. package/dist/templates/templates/config/tfwconfig.yml.template +69 -0
  89. package/dist/templates/templates/terraform/aws/_init.tf.template +24 -0
  90. package/dist/templates/templates/terraform/aws/inputs.tf.template +11 -0
  91. package/dist/templates/templates/terraform/azure/_init.tf.template +19 -0
  92. package/dist/templates/templates/terraform/azure/inputs.tf.template +11 -0
  93. package/dist/templates/templates/terraform/gcp/_init.tf.template +20 -0
  94. package/dist/templates/templates/terraform/gcp/inputs.tf.template +16 -0
  95. package/dist/templates/templates/terraform/locals.tf.template +9 -0
  96. package/dist/templates/templates/terraform/main.tf.template +8 -0
  97. package/dist/templates/templates/terraform/modules/inputs.tf.template +5 -0
  98. package/dist/templates/templates/terraform/modules/main.tf.template +2 -0
  99. package/dist/templates/templates/terraform/modules/outputs.tf.template +2 -0
  100. package/dist/templates/templates/terraform/outputs.tf.template +6 -0
  101. package/dist/templates/terraform/aws/_init.tf.template +24 -0
  102. package/dist/templates/terraform/aws/inputs.tf.template +11 -0
  103. package/dist/templates/terraform/azure/_init.tf.template +19 -0
  104. package/dist/templates/terraform/azure/inputs.tf.template +11 -0
  105. package/dist/templates/terraform/gcp/_init.tf.template +20 -0
  106. package/dist/templates/terraform/gcp/inputs.tf.template +16 -0
  107. package/dist/templates/terraform/locals.tf.template +9 -0
  108. package/dist/templates/terraform/main.tf.template +8 -0
  109. package/dist/templates/terraform/modules/inputs.tf.template +5 -0
  110. package/dist/templates/terraform/modules/main.tf.template +2 -0
  111. package/dist/templates/terraform/modules/outputs.tf.template +2 -0
  112. package/dist/templates/terraform/outputs.tf.template +6 -0
  113. package/dist/types/config.d.ts +92 -0
  114. package/dist/types/config.js +6 -0
  115. package/dist/types/context.d.ts +59 -0
  116. package/dist/types/context.js +6 -0
  117. package/dist/types/index.d.ts +7 -0
  118. package/dist/types/index.js +23 -0
  119. package/dist/types/plugins.d.ts +77 -0
  120. package/dist/types/plugins.js +6 -0
  121. package/dist/utils/cloud.d.ts +43 -0
  122. package/dist/utils/cloud.js +150 -0
  123. package/dist/utils/git.d.ts +88 -0
  124. package/dist/utils/git.js +258 -0
  125. package/dist/utils/logger.d.ts +67 -0
  126. package/dist/utils/logger.js +121 -0
  127. package/dist/utils/scaffolding.d.ts +92 -0
  128. package/dist/utils/scaffolding.js +338 -0
  129. package/dist/utils/templates.d.ts +25 -0
  130. package/dist/utils/templates.js +70 -0
  131. package/package.json +60 -0
@@ -0,0 +1,8 @@
1
+ import { main } from '../main/index';
2
+
3
+ describe('<project-name>', () => {
4
+ it('should run main function', () => {
5
+ expect(() => main()).not.toThrow();
6
+ });
7
+ });
8
+
@@ -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,11 @@
1
+ variable "aws_region" {
2
+ description = "AWS region for resources"
3
+ type = string
4
+ default = "us-east-1"
5
+ }
6
+
7
+ variable "environment" {
8
+ description = "Environment name (e.g., dev, staging, prod)"
9
+ type = string
10
+ }
11
+
@@ -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,11 @@
1
+ variable "azure_location" {
2
+ description = "Azure region for resources"
3
+ type = string
4
+ default = "eastus"
5
+ }
6
+
7
+ variable "environment" {
8
+ description = "Environment name"
9
+ type = string
10
+ }
11
+
@@ -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,9 @@
1
+ locals {
2
+ # Common tags/labels for all resources
3
+ common_tags = {
4
+ Environment = var.environment
5
+ ManagedBy = "terraform"
6
+ Project = "<project-name>"
7
+ }
8
+ }
9
+
@@ -0,0 +1,8 @@
1
+ # Main infrastructure resources go here
2
+ # Example module usage:
3
+ # module "example" {
4
+ # source = "./modules"
5
+ #
6
+ # environment = var.environment
7
+ # }
8
+
@@ -0,0 +1,5 @@
1
+ variable "environment" {
2
+ description = "Environment name"
3
+ type = string
4
+ }
5
+
@@ -0,0 +1,2 @@
1
+ # Module resources go here
2
+
@@ -0,0 +1,2 @@
1
+ # Module outputs go here
2
+
@@ -0,0 +1,6 @@
1
+ # Output values from your infrastructure
2
+ # output "example_output" {
3
+ # description = "Example output description"
4
+ # value = module.example.output_value
5
+ # }
6
+
@@ -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,11 @@
1
+ variable "aws_region" {
2
+ description = "AWS region for resources"
3
+ type = string
4
+ default = "us-east-1"
5
+ }
6
+
7
+ variable "environment" {
8
+ description = "Environment name (e.g., dev, staging, prod)"
9
+ type = string
10
+ }
11
+
@@ -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,11 @@
1
+ variable "azure_location" {
2
+ description = "Azure region for resources"
3
+ type = string
4
+ default = "eastus"
5
+ }
6
+
7
+ variable "environment" {
8
+ description = "Environment name"
9
+ type = string
10
+ }
11
+
@@ -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,9 @@
1
+ locals {
2
+ # Common tags/labels for all resources
3
+ common_tags = {
4
+ Environment = var.environment
5
+ ManagedBy = "terraform"
6
+ Project = "<project-name>"
7
+ }
8
+ }
9
+
@@ -0,0 +1,8 @@
1
+ # Main infrastructure resources go here
2
+ # Example module usage:
3
+ # module "example" {
4
+ # source = "./modules"
5
+ #
6
+ # environment = var.environment
7
+ # }
8
+
@@ -0,0 +1,5 @@
1
+ variable "environment" {
2
+ description = "Environment name"
3
+ type = string
4
+ }
5
+
@@ -0,0 +1,2 @@
1
+ # Module resources go here
2
+
@@ -0,0 +1,2 @@
1
+ # Module outputs go here
2
+
@@ -0,0 +1,6 @@
1
+ # Output values from your infrastructure
2
+ # output "example_output" {
3
+ # description = "Example output description"
4
+ # value = module.example.output_value
5
+ # }
6
+
@@ -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
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Configuration type definitions for Terraflow CLI
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=config.js.map