Skip to content

Commit 090f14e

Browse files
committed
Initial commit
0 parents  commit 090f14e

File tree

75 files changed

+8297
-0
lines changed

Some content is hidden

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

75 files changed

+8297
-0
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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@v4
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
id: import_gpg
30+
uses: crazy-max/[email protected]
31+
with:
32+
# These secrets will need to be configured for the repository:
33+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
34+
passphrase: ${{ secrets.PASSPHRASE }}
35+
- name: Run GoReleaser
36+
uses: goreleaser/[email protected]
37+
with:
38+
args: release --rm-dist
39+
env:
40+
# GitHub sets the GITHUB_TOKEN secret automatically.
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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+
workflow_dispatch:
8+
pull_request:
9+
paths-ignore:
10+
- "README.md"
11+
push:
12+
paths-ignore:
13+
- "README.md"
14+
15+
# Testing only needs permissions to read the repository contents.
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
# Ensure project builds before running testing matrix
21+
build:
22+
name: Build
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 5
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.10"
30+
- uses: actions/setup-go@v5
31+
with:
32+
go-version-file: "go.mod"
33+
cache: true
34+
- run: pip install yamale
35+
- run: yamale -s gen/schema/schema.yaml gen/definitions/
36+
- run: go mod download
37+
- run: go generate
38+
- run: git diff --exit-code
39+
- run: go build -v .
40+
41+
# Run acceptance tests in a matrix with Terraform CLI versions
42+
test:
43+
name: Terraform Provider Acceptance Tests
44+
needs: [build] # [consecutiveness, build]
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 90
47+
strategy:
48+
fail-fast: true
49+
max-parallel: 1
50+
matrix:
51+
# list whatever Terraform versions here you would like to support
52+
terraform:
53+
- "1.0.*"
54+
- "1.9.*"
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/setup-go@v5
58+
with:
59+
go-version-file: "go.mod"
60+
cache: true
61+
- uses: hashicorp/setup-terraform@v3
62+
with:
63+
terraform_version: ${{ matrix.terraform }}
64+
terraform_wrapper: false
65+
- run: go mod download
66+
- env:
67+
TF_ACC: "1"
68+
MERAKI_API_KEY: ${{ secrets.MERAKI_API_KEY }}
69+
run: go test -v -cover -timeout 45m ./internal/provider/
70+
timeout-minutes: 45

.gitignore

Lines changed: 35 additions & 0 deletions
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

Lines changed: 60 additions & 0 deletions
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

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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": "Launch generator",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "auto",
12+
"program": "gen/generator.go",
13+
"cwd": "./"
14+
}
15+
]
16+
}

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+
- Initial release

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by sending an email to [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# How to Contribute
2+
3+
Thanks for your interest in contributing to this Terraform provider! Here are a few general guidelines on contributing and
4+
reporting bugs that we ask you to review. Following these guidelines helps to communicate that you respect the time of
5+
the contributors managing and developing this open source project. In return, they should reciprocate that respect in
6+
addressing your issue, assessing changes, and helping you finalize your pull requests. In that spirit of mutual respect,
7+
we endeavor to review incoming issues and pull requests within 10 days, and will close any lingering issues or pull
8+
requests after 60 days of inactivity.
9+
10+
Please note that all of your interactions in the project are subject to our [Code of Conduct](/CODE_OF_CONDUCT.md). This
11+
includes creation of issues or pull requests, commenting on issues or pull requests, and extends to all interactions in
12+
any real-time space e.g., Slack, Discord, etc.
13+
14+
## Table Of Contents
15+
16+
- [Reporting Issues](#reporting-issues)
17+
- [Development](#development)
18+
- [Building the Provider](#building-the-provider)
19+
- [Acceptance Tests](#acceptance-tests)
20+
- [Sending Pull Requests](#sending-pull-requests)
21+
- [Other Ways to Contribute](#other-ways-to-contribute)
22+
23+
## Reporting Issues
24+
25+
Before reporting a new issue, please ensure that the issue was not already reported or fixed by searching through our
26+
[issues list](https://github.com/netascode/terraform-provider-meraki/issues).
27+
28+
When creating a new issue, please be sure to include a **title and clear description**, as much relevant information as
29+
possible, and, if possible, a test case.
30+
31+
**If you discover a security bug, please do not report it through GitHub. Instead, please see security procedures in
32+
[SECURITY.md](/SECURITY.md).**
33+
34+
## Development
35+
36+
### Building the Provider
37+
38+
1. Clone the repository
39+
2. Enter the repository directory
40+
3. Build the provider using the Go `install` command:
41+
42+
```shell
43+
go install
44+
```
45+
46+
### Acceptance Tests
47+
48+
In order to run the full suite of Acceptance tests, run `make testacc`. Make sure the respective environment variables are set (e.g., `MERAKI_DASHBOARD_API_KEY`).
49+
50+
Note: Acceptance tests create real resources.
51+
52+
```shell
53+
make testacc
54+
```
55+
56+
## Sending Pull Requests
57+
58+
Before sending a new pull request, take a look at existing pull requests and issues to see if the proposed change or fix
59+
has been discussed in the past, or if the change was already implemented but not yet released.
60+
61+
We expect new pull requests to include tests for any affected behavior, and, as we follow semantic versioning, we may
62+
reserve breaking changes until the next major version release.
63+
64+
## Other Ways to Contribute
65+
66+
We welcome anyone that wants to contribute to this Terraform provider to triage and reply to open issues to help troubleshoot
67+
and fix existing bugs. Here is what you can do:
68+
69+
- Help ensure that existing issues follows the recommendations from the _[Reporting Issues](#reporting-issues)_ section,
70+
providing feedback to the issue's author on what might be missing.
71+
- Review existing pull requests, and testing patches against real infrastructure.
72+
- Write a test, or add a missing test case to an existing test.
73+
74+
Thanks again for your interest on contributing to this Terraform provider!
75+
76+
:heart:

0 commit comments

Comments
 (0)