Skip to content

Commit 146e7fe

Browse files
committed
Initial commit
0 parents  commit 146e7fe

29 files changed

+1800
-0
lines changed

.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"

.github/workflows/release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
jobs:
18+
goreleaser:
19+
runs-on: ubuntu-latest
20+
steps:
21+
-
22+
name: Checkout
23+
uses: actions/[email protected]
24+
-
25+
name: Unshallow
26+
run: git fetch --prune --unshallow
27+
-
28+
name: Set up Go
29+
uses: actions/setup-go@v2
30+
with:
31+
go-version: 1.14
32+
-
33+
name: Import GPG key
34+
id: import_gpg
35+
uses: hashicorp/[email protected]
36+
env:
37+
# These secrets will need to be configured for the repository:
38+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
39+
PASSPHRASE: ${{ secrets.PASSPHRASE }}
40+
-
41+
name: Run GoReleaser
42+
uses: goreleaser/[email protected]
43+
with:
44+
version: latest
45+
args: release --rm-dist
46+
env:
47+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
48+
# GitHub sets this automatically
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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: Set up Go
27+
uses: actions/[email protected]
28+
with:
29+
go-version: '1.15'
30+
id: go
31+
32+
- name: Check out code into the Go module directory
33+
uses: actions/[email protected]
34+
35+
- name: Get dependencies
36+
run: |
37+
go mod download
38+
39+
- name: Build
40+
run: |
41+
go build -v .
42+
43+
# run acceptance tests in a matrix with Terraform core versions
44+
test:
45+
name: Matrix Test
46+
needs: build
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 15
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
# list whatever Terraform versions here you would like to support
53+
terraform:
54+
- '0.12.29'
55+
- '0.13.4'
56+
- '0.14.0-beta2'
57+
steps:
58+
59+
- name: Set up Go
60+
uses: actions/[email protected]
61+
with:
62+
go-version: '1.15'
63+
id: go
64+
65+
- name: Check out code into the Go module directory
66+
uses: actions/[email protected]
67+
68+
- name: Get dependencies
69+
run: |
70+
go mod download
71+
72+
- name: TF acceptance tests
73+
timeout-minutes: 10
74+
env:
75+
TF_ACC: "1"
76+
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
77+
78+
# Set whatever additional acceptance test env vars here. You can
79+
# optionally use data from your repository secrets using the
80+
# following syntax:
81+
# SOME_VAR: ${{ secrets.SOME_VAR }}
82+
83+
run: |
84+
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

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
37+
algorithm: sha256
38+
signs:
39+
- artifacts: checksum
40+
args:
41+
# if you are using this in a GitHub action or some other automated pipeline, you
42+
# need to pass the batch flag to indicate its not interactive.
43+
- "--batch"
44+
- "--local-user"
45+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
46+
- "--output"
47+
- "${signature}"
48+
- "--detach-sign"
49+
- "${artifact}"
50+
release:
51+
# If you want to manually examine the release before its live, uncomment this line:
52+
# draft: true
53+
changelog:
54+
skip: true

.vscode/launch.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Acceptance Tests",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "test",
12+
// this assumes your workspace is the root of the repo
13+
"program": "${fileDirname}",
14+
"env": {
15+
"TF_ACC": "1",
16+
},
17+
"args": [],
18+
},
19+
{
20+
"name": "Debug - Attach External CLI",
21+
"type": "go",
22+
"request": "launch",
23+
"mode": "debug",
24+
// this assumes your workspace is the root of the repo
25+
"program": "${workspaceFolder}",
26+
"env": {},
27+
"args": [
28+
// pass the debug flag for reattaching
29+
"-debug",
30+
],
31+
}
32+
]
33+
}

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 (Unreleased)
2+
3+
BACKWARDS INCOMPATIBILITIES / NOTES:

GNUmakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
default: testacc
2+
3+
# Run acceptance tests
4+
.PHONY: testacc
5+
testacc:
6+
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

0 commit comments

Comments
 (0)