Skip to content

Commit adf96ee

Browse files
committed
Initial commit
0 parents  commit adf96ee

32 files changed

+1701
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @hashicorp/terraform-devex

.github/CODE_OF_CONDUCT.md

+5
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/ISSUE_TEMPLATE.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Hi there,
2+
3+
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
4+
5+
### Terraform Version
6+
Run `terraform -v` to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.
7+
8+
### Affected Resource(s)
9+
Please list the resources as a list, for example:
10+
- opc_instance
11+
- opc_storage_volume
12+
13+
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
14+
15+
### Terraform Configuration Files
16+
```hcl
17+
# Copy-paste your Terraform configurations here - for large Terraform configs,
18+
# please use a service like Dropbox and share a link to the ZIP file. For
19+
# security, you can also encrypt the files using our GPG public key.
20+
```
21+
22+
### Debug Output
23+
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
24+
25+
### Panic Output
26+
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`.
27+
28+
### Expected Behavior
29+
What should have happened?
30+
31+
### Actual Behavior
32+
What actually happened?
33+
34+
### Steps to Reproduce
35+
Please list the steps required to reproduce the issue, for example:
36+
1. `terraform apply`
37+
38+
### Important Factoids
39+
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
40+
41+
### References
42+
Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example:
43+
- GH-1234

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See GitHub's docs for more information on this file:
2+
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
3+
version: 2
4+
updates:
5+
# Maintain dependencies for GitHub Actions
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
# Check for updates to GitHub Actions every weekday
10+
interval: "daily"
11+
12+
# Maintain dependencies for Go modules
13+
- package-ecosystem: "gomod"
14+
directory: "/"
15+
schedule:
16+
# Check for updates to Go modules every weekday
17+
interval: "daily"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Based on https://github.com/leonsteinhaeuser/project-beta-automations
2+
3+
name: "Add Issues/PRs to TF Provider DevEx team board"
4+
5+
on:
6+
issues:
7+
types: [opened, reopened]
8+
pull_request_target:
9+
# NOTE: The way content is added to project board is equivalent to an "upsert".
10+
# Calling it multiple times will be idempotent.
11+
#
12+
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
13+
# to see the reasoning behind using `pull_request_target` instead of `pull_request`
14+
types: [opened, reopened, ready_for_review]
15+
16+
jobs:
17+
add-content-to-project:
18+
name: "Add Content to project"
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: "Set Issue to 'Priority = Triage Next'"
22+
uses: leonsteinhaeuser/[email protected]
23+
if: github.event_name == 'issues'
24+
with:
25+
gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
26+
organization: "hashicorp"
27+
project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
28+
resource_node_id: ${{ github.event.issue.node_id }}
29+
operation_mode: custom_field
30+
custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'
31+
- name: "Set Pull Request to 'Priority = Triage Next'"
32+
uses: leonsteinhaeuser/[email protected]
33+
if: github.event_name == 'pull_request_target'
34+
with:
35+
gh_token: ${{ secrets.TF_DEVEX_PROJECT_GITHUB_TOKEN }}
36+
organization: "hashicorp"
37+
project_id: 99 #< https://github.com/orgs/hashicorp/projects/99
38+
resource_node_id: ${{ github.event.pull_request.node_id }}
39+
operation_mode: custom_field
40+
custom_field_values: '[{\"name\":\"Priority\",\"type\":\"single_select\",\"value\":\"Triage Next\"}]'

.github/workflows/release.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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
13+
on:
14+
push:
15+
tags:
16+
- 'v*'
17+
permissions:
18+
contents: write
19+
jobs:
20+
goreleaser:
21+
runs-on: ubuntu-latest
22+
steps:
23+
-
24+
name: Checkout
25+
uses: actions/checkout@v3
26+
-
27+
name: Unshallow
28+
run: git fetch --prune --unshallow
29+
-
30+
name: Set up Go
31+
uses: actions/setup-go@v3
32+
with:
33+
go-version-file: 'go.mod'
34+
cache: true
35+
-
36+
name: Import GPG key
37+
uses: crazy-max/ghaction-import-gpg@v5
38+
id: import_gpg
39+
with:
40+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
41+
passphrase: ${{ secrets.PASSPHRASE }}
42+
-
43+
name: Run GoReleaser
44+
uses: goreleaser/[email protected]
45+
with:
46+
version: latest
47+
args: release --rm-dist
48+
env:
49+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
50+
# GitHub sets this automatically
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# This GitHub action runs your tests for each commit push and/or PR. Optionally
2+
# you can turn it on using a cron schedule for regular testing.
3+
#
4+
name: Tests
5+
on:
6+
pull_request:
7+
paths-ignore:
8+
- 'README.md'
9+
push:
10+
paths-ignore:
11+
- 'README.md'
12+
# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
13+
# we recommend testing at a regular interval not necessarily tied to code changes. This will
14+
# ensure you are alerted to something breaking due to an API change, even if the code did not
15+
# change.
16+
# schedule:
17+
# - cron: '0 13 * * *'
18+
jobs:
19+
# ensure the code builds...
20+
build:
21+
name: Build
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 5
24+
steps:
25+
26+
- name: Check out code into the Go module directory
27+
uses: actions/checkout@v3
28+
29+
- name: Set up Go
30+
uses: actions/setup-go@v3
31+
with:
32+
go-version-file: 'go.mod'
33+
cache: true
34+
id: go
35+
36+
- name: Get dependencies
37+
run: |
38+
go mod download
39+
40+
- name: Build
41+
run: |
42+
go build -v .
43+
44+
generate:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-go@v3
49+
with:
50+
go-version-file: 'go.mod'
51+
cache: true
52+
- run: go generate ./...
53+
- name: git diff
54+
run: |
55+
git diff --compact-summary --exit-code || \
56+
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
57+
58+
# run acceptance tests in a matrix with Terraform core versions
59+
test:
60+
name: Matrix Test
61+
needs: build
62+
runs-on: ubuntu-latest
63+
timeout-minutes: 15
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
# list whatever Terraform versions here you would like to support
68+
terraform:
69+
- '0.12.*'
70+
- '0.13.*'
71+
- '0.14.*'
72+
- '0.15.*'
73+
- '1.0.*'
74+
- '1.1.*'
75+
- '1.2.*'
76+
steps:
77+
78+
- name: Check out code into the Go module directory
79+
uses: actions/checkout@v3
80+
81+
- name: Set up Go
82+
uses: actions/setup-go@v3
83+
with:
84+
go-version-file: 'go.mod'
85+
cache: true
86+
id: go
87+
88+
- uses: hashicorp/setup-terraform@v2
89+
with:
90+
terraform_version: ${{ matrix.terraform }}
91+
terraform_wrapper: false
92+
93+
- name: Get dependencies
94+
run: |
95+
go mod download
96+
97+
- name: TF acceptance tests
98+
timeout-minutes: 10
99+
env:
100+
TF_ACC: "1"
101+
102+
# Set whatever additional acceptance test env vars here. You can
103+
# optionally use data from your repository secrets using the
104+
# following syntax:
105+
# SOME_VAR: ${{ secrets.SOME_VAR }}
106+
107+
run: |
108+
go test -v -cover ./internal/provider/

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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

.goreleaser.yml

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

0 commit comments

Comments
 (0)