Skip to content

Commit e2b9cde

Browse files
committed
initial
1 parent aa10896 commit e2b9cde

81 files changed

Lines changed: 8488 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Bug Report
2+
description: Report a bug to help us improve
3+
labels: ["bug"]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for reporting a bug! Please provide as much detail as possible to help us resolve it.
10+
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Description
15+
description: Clear and concise description of the bug
16+
placeholder: |
17+
What happened?
18+
What did you expect to happen?
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: steps
24+
attributes:
25+
label: Steps to Reproduce
26+
description: Steps to reproduce the bug
27+
placeholder: |
28+
1. Configure YAML with...
29+
2. Run terraform plan
30+
3. See error...
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: yaml-config
36+
attributes:
37+
label: YAML Configuration
38+
description: Relevant portion of your YAML config (remove sensitive data)
39+
render: yaml
40+
placeholder: |
41+
project:
42+
name: example
43+
# ...
44+
45+
- type: textarea
46+
id: terraform-config
47+
attributes:
48+
label: Terraform Configuration
49+
description: Relevant portion of your Terraform config (remove sensitive data)
50+
render: hcl
51+
placeholder: |
52+
module "dbt_cloud" {
53+
# ...
54+
}
55+
56+
- type: textarea
57+
id: error
58+
attributes:
59+
label: Error Output
60+
description: Full error message or logs
61+
render: shell
62+
63+
- type: textarea
64+
id: environment
65+
attributes:
66+
label: Environment
67+
description: |
68+
- Terraform version (terraform --version)
69+
- dbt Cloud provider version
70+
- Operating system
71+
- dbt Cloud account type (Single tenant, multi-tenant, etc.)
72+
placeholder: |
73+
- Terraform v1.5.0
74+
- dbtcloud provider v0.3.0
75+
- macOS 13.5
76+
- dbt Cloud (multi-tenant)
77+
78+
- type: checkboxes
79+
id: checklist
80+
attributes:
81+
label: Checklist
82+
options:
83+
- label: I've searched for existing issues
84+
required: true
85+
- label: I've provided a clear description
86+
required: true
87+
- label: I've included steps to reproduce
88+
required: true
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Feature Request
2+
description: Suggest an enhancement
3+
labels: ["enhancement"]
4+
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thank you for suggesting a feature! Please describe what you'd like to see.
10+
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem Statement
15+
description: What problem does this feature solve?
16+
placeholder: |
17+
I find it difficult to...
18+
Currently, I have to...
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: solution
24+
attributes:
25+
label: Proposed Solution
26+
description: How would this feature work?
27+
placeholder: |
28+
It would be great if we could...
29+
The feature would allow users to...
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: examples
35+
attributes:
36+
label: Example Usage
37+
description: Show how you'd like to use this feature
38+
render: yaml
39+
placeholder: |
40+
project:
41+
name: example
42+
# your example here
43+
44+
- type: textarea
45+
id: alternatives
46+
attributes:
47+
label: Alternatives Considered
48+
description: Any other approaches you've considered?
49+
50+
- type: checkboxes
51+
id: checklist
52+
attributes:
53+
label: Checklist
54+
options:
55+
- label: I've searched for existing feature requests
56+
required: true
57+
- label: I've explained the use case clearly
58+
required: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Terraform Validation
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
paths: [ '**.tf', '**.yml' ]
7+
pull_request:
8+
branches: [ main, develop ]
9+
paths: [ '**.tf', '**.yml' ]
10+
11+
jobs:
12+
terraform-validate:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Terraform
19+
uses: hashicorp/setup-terraform@v2
20+
with:
21+
terraform_version: ~1.5
22+
23+
- name: Terraform Format Check
24+
run: terraform fmt -check -recursive
25+
26+
- name: Terraform Init
27+
run: terraform init
28+
29+
- name: Terraform Validate
30+
run: terraform validate
31+
32+
- name: Terraform Plan (Dry Run)
33+
run: terraform plan -lock=false -input=false
34+
env:
35+
TF_VAR_dbt_account_id: 0
36+
TF_VAR_dbt_token: dummy
37+
TF_VAR_dbt_host_url: https://cloud.getdbt.com
38+
TF_VAR_yaml_file: ./projects/demo/demo.yml

.pre-commit-config.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
repos:
2+
# Terraform formatting and documentation
3+
- repo: https://github.com/terraform-docs/terraform-docs
4+
rev: v0.16.0
5+
hooks:
6+
- id: terraform-docs-go
7+
name: terraform-docs
8+
description: Generate terraform documentation
9+
entry: terraform-docs -c .terraform-docs.yml
10+
language: golang
11+
files: ^[^/]*\.tf$
12+
exclude: ^\.terraform/.*$
13+
args: [--sort-by-required]
14+
15+
# Terraform linting
16+
- repo: https://github.com/terraform-linters/tflint
17+
rev: v0.50.3
18+
hooks:
19+
- id: tflint
20+
name: tflint
21+
description: Run tflint to check terraform code quality
22+
entry: tflint
23+
language: golang
24+
files: \.tf$
25+
exclude: ^\.terraform/.*$
26+
27+
# General linting and formatting
28+
- repo: https://github.com/pre-commit/pre-commit-hooks
29+
rev: v4.4.0
30+
hooks:
31+
- id: trailing-whitespace
32+
name: Trim trailing whitespace
33+
exclude: ^\.terraform/.*$
34+
35+
- id: end-of-file-fixer
36+
name: Fix end of file
37+
exclude: ^\.terraform/.*$
38+
39+
- id: check-yaml
40+
name: Check YAML syntax
41+
args: [--safe]
42+
exclude: ^\.terraform/.*$
43+
44+
- id: check-json
45+
name: Check JSON syntax
46+
exclude: ^\.terraform/.*$
47+
48+
- id: check-added-large-files
49+
name: Check for large files
50+
args: [--maxkb=1000]
51+
exclude: ^\.terraform/.*$
52+
53+
# Detect secrets
54+
- repo: https://github.com/Yelp/detect-secrets
55+
rev: v1.4.0
56+
hooks:
57+
- id: detect-secrets
58+
name: Detect secrets
59+
args: [--baseline, .secrets.baseline]
60+
exclude: ^\.terraform/.*$

.tflint.hcl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
plugin "aws" {
2+
enabled = false
3+
}
4+
5+
rule "terraform_required_version" {
6+
enabled = true
7+
}
8+
9+
rule "terraform_required_providers" {
10+
enabled = true
11+
}
12+
13+
rule "terraform_documented_variables" {
14+
enabled = true
15+
}
16+
17+
rule "terraform_documented_outputs" {
18+
enabled = true
19+
}
20+
21+
rule "terraform_naming_convention" {
22+
enabled = true
23+
format = "snake_case"
24+
}
25+
26+
rule "terraform_comment_syntax" {
27+
enabled = true
28+
}
29+
30+
rule "terraform_unused_declarations" {
31+
enabled = true
32+
}
33+
34+
rule "terraform_unused_required_providers" {
35+
enabled = true
36+
}
37+
38+
rule "terraform_standard_module_structure" {
39+
enabled = true
40+
}

CHANGELOG.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
### Changed
13+
14+
### Fixed
15+
16+
### Removed
17+
18+
## [1.0.0] - 2024-01-XX
19+
20+
### Added
21+
22+
- Initial release of dbt Cloud Terraform Modules with YAML configuration support
23+
- Root module wrapper for easy usage as a Terraform module
24+
- Support for dbt Cloud projects, environments, jobs, and credentials
25+
- Environment variables configuration (project-level and job-level)
26+
- Credential management with secure token handling
27+
- Repository configuration for Git integration
28+
- Comprehensive documentation and examples
29+
- Input validation for variables
30+
- Support for multiple credential types
31+
32+
### Module Coverage
33+
34+
- `project` - Create and configure dbt Cloud projects
35+
- `repository` - Configure Git repositories
36+
- `project_repository` - Link repositories to projects
37+
- `credentials` - Manage database credentials
38+
- `environments` - Create development and deployment environments
39+
- `jobs` - Configure dbt Cloud jobs with schedules and triggers
40+
- `environment_variables` - Manage project and job environment variables
41+
- `environment_variable_job_overrides` - Job-specific variable overrides
42+
43+
[Unreleased]: https://github.com/yourusername/dbt-terraform-modules-yaml/compare/v1.0.0...HEAD
44+
[1.0.0]: https://github.com/yourusername/dbt-terraform-modules-yaml/releases/tag/v1.0.0

0 commit comments

Comments
 (0)