Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 8eae0b0

Browse files
committed
Initial commit
0 parents  commit 8eae0b0

38 files changed

+3082
-0
lines changed

.copywrite.hcl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# NOTE: This file is for HashiCorp specific licensing automation and can be deleted after creating a new repo with this template.
2+
schema_version = 1
3+
4+
project {
5+
license = "MPL-2.0"
6+
copyright_year = 2024
7+
8+
header_ignore = [
9+
# examples used within documentation (prose)
10+
"examples/**",
11+
12+
# GitHub issue template configuration
13+
".github/ISSUE_TEMPLATE/*.yml",
14+
15+
# golangci-lint tooling configuration
16+
".golangci.yml",
17+
18+
# GoReleaser tooling configuration
19+
".goreleaser.yml",
20+
]
21+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @hashicorp/terraform-devex

.github/CODE_OF_CONDUCT.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code of Conduct
2+
3+
HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.
4+
5+
Please read the full text at https://www.hashicorp.com/community-guidelines

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# See GitHub's documentation for more information on this file:
2+
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
- package-ecosystem: "gomod"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"
13+
# TODO: Dependabot only updates hashicorp GHAs in the template repository, the following lines can be removed for consumers of this template
14+
allow:
15+
- dependency-name: "hashicorp/*"

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Terraform Provider release workflow.
2+
name: Release
3+
4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
# Releases need permissions to read and write the repository contents.
12+
# GitHub considers creating releases and uploading assets as writing contents.
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
goreleaser:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
25+
with:
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
30+
id: import_gpg
31+
with:
32+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
passphrase: ${{ secrets.PASSPHRASE }}
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
36+
with:
37+
args: release --clean
38+
env:
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/test.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Terraform Provider testing workflow.
2+
name: Tests
3+
4+
# This GitHub action runs your tests for each pull request and push.
5+
# Optionally, you can turn it on using a schedule for regular testing.
6+
on:
7+
pull_request:
8+
paths-ignore:
9+
- 'README.md'
10+
push:
11+
paths-ignore:
12+
- 'README.md'
13+
14+
# Testing only needs permissions to read the repository contents.
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
# Ensure project builds before running testing matrix
20+
build:
21+
name: Build
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
27+
with:
28+
go-version-file: 'go.mod'
29+
cache: true
30+
- run: go mod download
31+
- run: go build -v .
32+
- name: Run linters
33+
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
34+
with:
35+
version: latest
36+
37+
generate:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
41+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
42+
with:
43+
go-version-file: 'go.mod'
44+
cache: true
45+
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
46+
with:
47+
terraform_version: '1.9.4'
48+
terraform_wrapper: false
49+
- run: go generate ./...
50+
- name: git diff
51+
run: |
52+
git diff --compact-summary --exit-code || \
53+
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
54+
55+
# Run acceptance tests in a matrix with Terraform CLI versions
56+
test:
57+
name: Terraform Provider Acceptance Tests
58+
needs: build
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 15
61+
strategy:
62+
fail-fast: false
63+
matrix:
64+
# list whatever Terraform versions here you would like to support
65+
terraform:
66+
- '1.5.*'
67+
- '1.6.*'
68+
- '1.7.*'
69+
- '1.8.*'
70+
- '1.9.*'
71+
steps:
72+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
73+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
74+
with:
75+
go-version-file: 'go.mod'
76+
cache: true
77+
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3.1.1
78+
with:
79+
terraform_version: ${{ matrix.terraform }}
80+
terraform_wrapper: false
81+
- run: go mod download
82+
- env:
83+
TF_ACC: "1"
84+
run: go test -v -cover ./internal/provider/
85+
timeout-minutes: 10

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
*.dll
2+
*.exe
3+
.DS_Store
4+
example.tf
5+
terraform.tfplan
6+
terraform.tfstate
7+
bin/
8+
dist/
9+
modules-dev/
10+
/pkg/
11+
website/.vagrant
12+
website/.bundle
13+
website/build
14+
website/node_modules
15+
.vagrant/
16+
*.backup
17+
./*.tfstate
18+
.terraform/
19+
*.log
20+
*.bak
21+
*~
22+
.*.swp
23+
.idea
24+
*.iml
25+
*.test
26+
*.iml
27+
28+
website/vendor
29+
30+
# Test exclusions
31+
!command/test-fixtures/**/*.tfstate
32+
!command/test-fixtures/**/.terraform/
33+
34+
# Keep windows files with windows line endings
35+
*.winfile eol=crlf
36+
examples/provider-install-verification

.golangci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Visit https://golangci-lint.run/ for usage documentation
2+
# and information on other useful linters
3+
issues:
4+
max-per-linter: 0
5+
max-same-issues: 0
6+
7+
linters:
8+
disable-all: true
9+
enable:
10+
- durationcheck
11+
- errcheck
12+
- exportloopref
13+
- forcetypeassert
14+
- godot
15+
- gofmt
16+
- gosimple
17+
- ineffassign
18+
- makezero
19+
- misspell
20+
- nilerr
21+
- predeclared
22+
- staticcheck
23+
- tenv
24+
- unconvert
25+
- unparam
26+
- unused
27+
- govet

.goreleaser.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
# See https://goreleaser.com/customization/ for more information
3+
version: 2
4+
before:
5+
hooks:
6+
- go generate ./...
7+
- go mod tidy
8+
builds:
9+
- env:
10+
# goreleaser does not work with CGO, it could also complicate
11+
# usage by users in CI/CD systems like Terraform Cloud where
12+
# they are unable to install libraries.
13+
- CGO_ENABLED=0
14+
mod_timestamp: "{{ .CommitTimestamp }}"
15+
flags:
16+
- -trimpath
17+
ldflags:
18+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
19+
goos:
20+
- freebsd
21+
- windows
22+
- linux
23+
- darwin
24+
goarch:
25+
- amd64
26+
- '386'
27+
- arm
28+
- arm64
29+
ignore:
30+
- goos: darwin
31+
goarch: '386'
32+
binary: "{{ .ProjectName }}_v{{ .Version }}"
33+
archives:
34+
- format: zip
35+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
36+
checksum:
37+
extra_files:
38+
- glob: "terraform-registry-manifest.json"
39+
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
40+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
41+
algorithm: sha256
42+
signs:
43+
- artifacts: checksum
44+
args:
45+
# if you are using this in a GitHub action or some other automated pipeline, you
46+
# need to pass the batch flag to indicate its not interactive.
47+
- "--batch"
48+
- "--local-user"
49+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
50+
- "--output"
51+
- "${signature}"
52+
- "--detach-sign"
53+
- "${artifact}"
54+
release:
55+
extra_files:
56+
- glob: "terraform-registry-manifest.json"
57+
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
58+
# If you want to manually examine the release before its live, uncomment this line:
59+
# draft: true
60+
changelog:
61+
disable: true

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 (Unreleased)
2+
3+
FEATURES:

0 commit comments

Comments
 (0)