Skip to content

Commit f0a6043

Browse files
committed
Initial commit
Signed-off-by: Wilfried Roset <[email protected]>
0 parents  commit f0a6043

37 files changed

+1789
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ovh/critical-databases

.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/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
- package-ecosystem: "gomod"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"

.github/workflows/release.yml

+41
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@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
25+
with:
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.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@336e29918d653399e599bfca99fadc1d7ffbc9f7 # v4.3.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

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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@v3
26+
- uses: actions/setup-go@v4
27+
with:
28+
go-version-file: 'go.mod'
29+
cache: false
30+
- run: go mod download
31+
- run: go build -v .
32+
- name: Run linters
33+
uses: golangci/[email protected]
34+
with:
35+
version: v1.53
36+
37+
generate:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-go@v4
42+
with:
43+
go-version-file: 'go.mod'
44+
cache: false
45+
- run: go generate ./...
46+
- name: git diff
47+
run: |
48+
git diff --compact-summary --exit-code || \
49+
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
50+
51+
# Run acceptance tests in a matrix with Terraform CLI versions
52+
test:
53+
name: Terraform Provider Acceptance Tests
54+
needs: build
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 15
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
# list whatever Terraform versions here you would like to support
61+
terraform:
62+
- '1.0.*'
63+
- '1.1.*'
64+
- '1.2.*'
65+
- '1.3.*'
66+
- '1.4.*'
67+
steps:
68+
- uses: actions/checkout@v3
69+
- uses: actions/setup-go@v4
70+
with:
71+
go-version-file: 'go.mod'
72+
cache: true
73+
- uses: hashicorp/setup-terraform@v2
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

.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

.golangci.yml

+27
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+
- vet

.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

AUTHORS

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This is the official list of terraform-provider-eyaml authors for copyright purposes.
2+
# This file is distinct from the CONTRIBUTORS files
3+
# and it lists the copyright holders only.
4+
5+
Arnaud SINAYS <[email protected]>
6+
Julien RIOU <[email protected]>
7+
Wilfried ROSET <[email protected]>
8+
9+
# Please keep the list sorted.
10+
11+
OVH SAS

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0
2+
3+
* Initial release.

CONTRIBUTING.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to terraform-provider-eyaml
2+
3+
This project accepts contributions. In order to contribute, you should
4+
pay attention to a few things:
5+
6+
1. your code must follow the golang coding style rules (go fmt)
7+
2. your code must be added to the unit tests. Documentation is excluded
8+
from this task
9+
3. your code must be documented (README.md)
10+
4. your work must be signed (see below)
11+
5. you may contribute through GitHub Pull Requests which must pass all tests
12+
13+
# Submitting Modifications
14+
15+
The contributions should be submitted through Github Pull Requests
16+
and follow the DCO which is defined below.
17+
18+
# Licensing for new files
19+
20+
terraform-provider-eyaml is licensed under the Apache License 2.0. Anything
21+
contributed to terraform-provider-eyaml must be released under this license.
22+
23+
When introducing a new file into the project, please make sure it has a
24+
copyright header making clear under which license it's being released.
25+
26+
# Developer Certificate of Origin (DCO)
27+
28+
To improve tracking of contributions to this project we will use a
29+
process modeled on the modified DCO 1.1 and use a "sign-off" procedure
30+
on patches that are being emailed around or contributed in any other
31+
way.
32+
33+
The sign-off is a simple line at the end of the explanation for the
34+
patch, which certifies that you wrote it or otherwise have the right
35+
to pass it on as an open-source patch. The rules are pretty simple,
36+
if you can certify the below:
37+
38+
By making a contribution to this project, I certify that:
39+
40+
(a) The contribution was created in whole or in part by me and I have
41+
the right to submit it under the open source license indicated in
42+
the file; or
43+
44+
(b) The contribution is based upon previous work that, to the best of
45+
my knowledge, is covered under an appropriate open source License
46+
and I have the right under that license to submit that work with
47+
modifications, whether created in whole or in part by me, under
48+
the same open source license (unless I am permitted to submit
49+
under a different license), as indicated in the file; or
50+
51+
(c) The contribution was provided directly to me by some other person
52+
who certified (a), (b) or (c) and I have not modified it.
53+
54+
(d) The contribution is made free of any other party's intellectual
55+
property claims or rights.
56+
57+
(e) I understand and agree that this project and the contribution are
58+
public and that a record of the contribution (including all
59+
personal information I submit with it, including my sign-off) is
60+
maintained indefinitely and may be redistributed consistent with
61+
this project or the open source license(s) involved.
62+
63+
64+
then you just add a line saying
65+
66+
Signed-off-by: Random J Developer <[email protected]>
67+
68+
using your real name (sorry, no pseudonyms or anonymous contributions.)

CONTRIBUTORS

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the official list of the project maintainers.
2+
# This is mostly useful for contributors that want to push
3+
# significant pull requests or for project management issues.
4+
#
5+
#
6+
# Names should be added to this file like so:
7+
# Individual's name <submission email address>
8+
# Individual's name <submission email address>
9+
#
10+
# Please keep the list sorted.
11+
#
12+
Arnaud SINAYS <[email protected]>
13+
Julien RIOU <[email protected]>
14+
Wilfried ROSET <[email protected]>

GNUmakefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
default: testacc
2+
3+
# Run acceptance tests
4+
.PHONY: testacc docs
5+
testacc:
6+
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
7+
8+
build:
9+
go build -o dist/
10+
11+
docs:
12+
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
13+
14+
release:
15+
@test $${RELEASE_VERSION?Please set environment variable RELEASE_VERSION}
16+
@git tag $$RELEASE_VERSION
17+
@git push origin $$RELEASE_VERSION
18+
19+
clean:
20+
rm -rf dist/*

0 commit comments

Comments
 (0)