Skip to content

Commit

Permalink
Merge pull request #68 from umich-vci/framework_migration
Browse files Browse the repository at this point in the history
Framework migration
  • Loading branch information
adarobin authored Feb 29, 2024
2 parents a9cfc62 + 9dd7339 commit 7ef68ae
Show file tree
Hide file tree
Showing 38 changed files with 3,112 additions and 2,129 deletions.
5 changes: 0 additions & 5 deletions .github/CODE_OF_CONDUCT.md

This file was deleted.

43 changes: 0 additions & 43 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

9 changes: 2 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# See GitHub's docs for more information on this file:
# https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/configuration-options-for-dependency-updates
# See GitHub's documentation for more information on this file:
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"

# Maintain dependencies for Go modules
- package-ecosystem: "gomod"
directory: "/"
schedule:
# Check for updates to Go modules every weekday
interval: "daily"
61 changes: 26 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,41 @@
# This GitHub action can publish assets for release when a tag is created.
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
#
# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
# secret. If you would rather own your own GPG handling, please fork this action
# or use an alternative one for key handling.
#
# You will need to pass the `--batch` flag to `gpg` in your signing step
# in `goreleaser` to indicate this is being used in a non-interactive mode.
#
name: release
# Terraform Provider release workflow.
name: Release

# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- 'v*'

# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
-
name: Import GPG key
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
id: import_gpg
uses: hashicorp/[email protected]
env:
# These secrets will need to be configured for the repository:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
PASSPHRASE: ${{ secrets.PASSPHRASE }}
-
name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0
with:
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
# GitHub sets this automatically
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
130 changes: 55 additions & 75 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,44 @@
# This GitHub action runs your tests for each commit push and/or PR. Optionally
# you can turn it on using a cron schedule for regular testing.
#
# Terraform Provider testing workflow.
name: Tests

# This GitHub action runs your tests for each pull request and push.
# Optionally, you can turn it on using a schedule for regular testing.
on:
pull_request:
paths-ignore:
- 'README.md'
push:
paths-ignore:
- 'README.md'
# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
# we recommend testing at a regular interval not necessarily tied to code changes. This will
# ensure you are alerted to something breaking due to an API change, even if the code did not
# change.
# schedule:
# - cron: '0 13 * * *'

# Testing only needs permissions to read the repository contents.
permissions:
contents: read

jobs:
# ensure the code builds...
# Ensure project builds before running testing matrix
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
id: go

- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go build -v .
- name: Run linters
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
with:
version: latest

generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: 'go.mod'
cache: true
Expand All @@ -55,49 +48,36 @@ jobs:
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
# run acceptance tests in a matrix with Terraform core versions
test:
name: Matrix Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- '1.0.*'
- '1.1.*'
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
id: go

- uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ matrix.terraform }}
terraform_wrapper: false

- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 10
env:
TF_ACC: "1"

# Set whatever additional acceptance test env vars here. You can
# optionally use data from your repository secrets using the
# following syntax:
# SOME_VAR: ${{ secrets.SOME_VAR }}
# Run acceptance tests in a matrix with Terraform CLI versions
# test:
# name: Terraform Provider Acceptance Tests
# needs: build
# runs-on: ubuntu-latest
# timeout-minutes: 15
# strategy:
# fail-fast: false
# matrix:
# # list whatever Terraform versions here you would like to support
# terraform:
# - '1.0.*'
# - '1.1.*'
# - '1.2.*'
# - '1.3.*'
# - '1.4.*'
# - '1.5.*'

run: |
go test -v -cover ./internal/provider/
# steps:
# - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
# with:
# go-version-file: 'go.mod'
# cache: true
# - uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
# with:
# terraform_version: ${{ matrix.terraform }}
# terraform_wrapper: false
# - run: go mod download
# - env:
# TF_ACC: "1"
# run: go test -v -cover ./internal/provider/
# timeout-minutes: 10
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ website/vendor

# Keep windows files with windows line endings
*.winfile eol=crlf

terraform-provider-bluecat*
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Copyright (c) 2019 Regents of the University of Michigan
Copyright (c) 2021 HashiCorp, Inc.

Mozilla Public License Version 2.0
==================================

Expand Down
9 changes: 2 additions & 7 deletions docs/data-sources/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,10 @@ output "bluecat_config_id" {
### Required

- `name` (String) The name of the entity to find.
- `parent_id` (Number) The object ID of the parent object that contains the entity. Configurations are stored in ID `0`.
- `type` (String) The type of the entity you want to retrieve.

### Optional

- `parent_id` (String) The object ID of the parent object that contains the entity. Configurations are stored in ID `0`. Defaults to `0`.

### Read-Only

- `id` (String) The ID of this resource.
- `id` (Number) Entity identifier
- `properties` (String) The properties of the entity as returned by the API (pipe delimited).


17 changes: 5 additions & 12 deletions docs/data-sources/host_record.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
page_title: "bluecat_host_record Data Source - terraform-provider-bluecat"
subcategory: ""
description: |-
Data source to access the attributes of a host record. If the API returns more than one host record that matches, an error will be returned.
Example data source
---

# bluecat_host_record (Data Source)

Data source to access the attributes of a host record. If the API returns more than one host record that matches, an error will be returned.
Example data source

## Example Usage

Expand All @@ -29,23 +29,16 @@ output "bluecat_host_addresses" {

- `absolute_name` (String) The absolute name/fqdn of the host record.

### Optional

- `result_count` (Number) The number of results the API should return. This must be between 1 and 10. You most likely want to leave this alone. Defaults to `10`.
- `start` (Number) The start index of the search results the API should return. You most likely want to leave this alone. Defaults to `0`.

### Read-Only

- `address_ids` (Set of String) A set of all address ids associated with the host record.
- `address_ids` (Set of Number) A set of all address ids associated with the host record.
- `addresses` (Set of String) A set of all addresses associated with the host record.
- `custom_properties` (Map of String) A map of all custom properties associated with the host record.
- `id` (String) The ID of this resource.
- `id` (Number) Entity identifier
- `name` (String) The short name of the host record.
- `parent_id` (String) The ID of the parent of the host record.
- `parent_id` (Number) The ID of the parent of the host record.
- `parent_type` (String) The type of the parent of the host record.
- `properties` (String) The properties of the host record as returned by the API (pipe delimited).
- `reverse_record` (Boolean) A boolean that represents if the host record should set reverse records.
- `ttl` (Number) The TTL of the host record.
- `type` (String) The type of the resource.


6 changes: 2 additions & 4 deletions docs/data-sources/ip4_address.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ output "bluecat_address_mac" {
### Required

- `address` (String) The IPv4 address to get data for.
- `container_id` (String) The object ID of the container that has the specified `address`. This can be a Configuration, IPv4 Block, IPv4 Network, or DHCP range.
- `container_id` (Number) The object ID of the container that has the specified `address`. This can be a Configuration, IPv4 Block, IPv4 Network, or DHCP range.

### Read-Only

- `custom_properties` (Map of String) A map of all custom properties associated with the IPv4 address.
- `id` (String) The ID of this resource.
- `id` (Number) IP4 Address identifier
- `mac_address` (String) The MAC address associated with the IPv4 address.
- `name` (String) The name assigned to the IPv4 address. This is not related to DNS.
- `properties` (String) The properties of the IPv4 address as returned by the API (pipe delimited).
- `state` (String) The state of the IPv4 address.
- `type` (String) The type of the resource.


Loading

0 comments on commit 7ef68ae

Please sign in to comment.