Skip to content

Commit 88355ab

Browse files
author
Sean Sundberg
authored
Refresh plugin to new provider framework (#39)
Signed-off-by: Sean Sundberg <[email protected]>
1 parent 9f62eca commit 88355ab

File tree

2,833 files changed

+777766
-1254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,833 files changed

+777766
-1254
lines changed

.copywrite.hcl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 = "MIT"
6+
copyright_year = 2025
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+
# IntelliJ metadata
22+
".idea/**",
23+
24+
# Github workflow configuration
25+
".github/**"
26+
]
27+
}

.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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
# Maintain dependencies for Go modules
6+
- package-ecosystem: "gomod"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to Go modules every weekday
10+
interval: "daily"
11+
- package-ecosystem: "gomod"
12+
directory: "/tools"
13+
schedule:
14+
interval: "daily"
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "daily"
19+
# TODO: Dependabot only updates hashicorp GHAs in the template repository, the following lines can be removed for consumers of this template
20+
allow:
21+
- dependency-name: "hashicorp/*"

.github/scripts/validate-deploy.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/usr/bin/env bash
2+
# Copyright (c) 2025 Cloud-Native Toolkit
3+
# SPDX-License-Identifier: MIT
24

35
BIN_DIR=$(cat .bin_dir)
46

.github/workflows/release.yml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,41 @@
1-
# This GitHub action can publish assets for release when a tag is created.
2-
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
3-
#
4-
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
5-
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
6-
# secret. If you would rather own your own GPG handling, please fork this action
7-
# or use an alternative one for key handling.
8-
#
9-
# You will need to pass the `--batch` flag to `gpg` in your signing step
10-
# in `goreleaser` to indicate this is being used in a non-interactive mode.
11-
#
12-
name: release
1+
# Terraform Provider release workflow.
2+
name: Release
133

4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
146
on:
157
push:
168
tags:
179
- 'v*'
1810

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+
1916
jobs:
2017
goreleaser:
2118
runs-on: ubuntu-latest
2219
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2521
with:
22+
# Allow goreleaser to access older tag information.
2623
fetch-depth: 0
27-
28-
- name: Set up Go
29-
uses: actions/setup-go@v3
24+
- uses: actions/setup-go@v5
3025
with:
31-
go-version: 1.19.4
32-
26+
go-version-file: 'go.mod'
27+
cache: true
3328
- name: Import GPG key
29+
uses: crazy-max/[email protected]
3430
id: import_gpg
35-
uses: crazy-max/[email protected]
3631
with:
3732
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
38-
passphrase: ${{ secrets.GPG_PASSPHRASE }}
39-
33+
passphrase: ${{ secrets.PASSPHRASE }}
4034
- name: Run GoReleaser
41-
uses: goreleaser/goreleaser-action@v3
35+
uses: goreleaser/goreleaser-action@v6.2.1
4236
with:
43-
version: latest
44-
args: release --rm-dist
37+
args: release --clean
4538
env:
46-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
47-
# GitHub sets this automatically
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
4840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/tag.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Tag
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the main branch
5+
on:
6+
push:
7+
branches: [ main ]
8+
9+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
10+
jobs:
11+
tag:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Drafts your next Release notes as Pull Requests are merged into "main"
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
# Create a draft release to generate a tag name
20+
- name: Draft release
21+
id: releaser
22+
uses: release-drafter/release-drafter@v6
23+
with:
24+
config-name: release-drafter.yaml
25+
publish: false
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
29+
# Delete the release because a new one will be created when tag is created
30+
- name: Delete release
31+
run: gh release delete ${{ steps.releaser.outputs.tag_name }}
32+
33+
# Create a tag using the tag_name generated by Release Drafter
34+
- name: Create tag
35+
uses: mathieudutour/[email protected]
36+
with:
37+
custom_tag: ${{ steps.releaser.outputs.tag_name }}
38+
create_annotated_tag: true
39+
github_token: ${{ secrets.TOKEN }}

.github/workflows/test.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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+
11+
# Testing only needs permissions to read the repository contents.
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
# Ensure project builds before running testing matrix
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: 'go.mod'
26+
cache: true
27+
- run: go mod download
28+
- run: go build -v .
29+
- name: Run linters
30+
uses: golangci/golangci-lint-action@v6
31+
with:
32+
version: latest
33+
34+
generate:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
- uses: actions/setup-go@v5
39+
with:
40+
go-version-file: 'go.mod'
41+
cache: true
42+
# We need the latest version of Terraform for our documentation generation to use
43+
- uses: hashicorp/setup-terraform@v3
44+
with:
45+
terraform_wrapper: false
46+
- run: make generate
47+
- name: git diff
48+
run: |
49+
git diff --compact-summary --exit-code || \
50+
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate' command and commit."; exit 1)
51+
52+
# Run acceptance tests in a matrix with Terraform CLI versions
53+
test:
54+
name: Terraform Provider Acceptance Tests
55+
needs: build
56+
runs-on: ubuntu-latest
57+
timeout-minutes: 15
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
# list whatever Terraform versions here you would like to support
62+
terraform:
63+
- '1.6.*'
64+
- '1.7.*'
65+
- '1.8.*'
66+
- '1.9.*'
67+
steps:
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69+
- uses: actions/setup-go@v5
70+
with:
71+
go-version-file: 'go.mod'
72+
cache: true
73+
- uses: hashicorp/setup-terraform@v3
74+
with:
75+
terraform_version: ${{ matrix.terraform }}
76+
terraform_wrapper: false
77+
- run: go mod download
78+
- env:
79+
TF_ACC: "1"
80+
run: go test -v -cover ./internal/provider/
81+
timeout-minutes: 10
82+
83+
verifyReleaser:
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 0
90+
91+
- name: Set up Go
92+
uses: actions/setup-go@v5
93+
with:
94+
go-version-file: 'go.mod'
95+
cache: true
96+
97+
- name: Import GPG key
98+
id: import_gpg
99+
uses: crazy-max/[email protected]
100+
with:
101+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
102+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
103+
104+
verifyAll:
105+
needs: [generate,test,verifyReleaser]
106+
runs-on: ubuntu-latest
107+
108+
steps:
109+
- run: echo "Success"

.github/workflows/verify-pr.yaml

Lines changed: 0 additions & 110 deletions
This file was deleted.

0 commit comments

Comments
 (0)