Skip to content

Commit

Permalink
import and merge equinix/terraform-provider-metal
Browse files Browse the repository at this point in the history
This includes resources, datasources, docs, guides, and provider attributes
from github.com/equinix/terraform-provider-metal and
github.com/packethost/terraform-provider-packet.

Many authors have contributed to this work. See archives of the old
repositories for proper attribution.

Signed-off-by: Marques Johansson <[email protected]>
  • Loading branch information
displague committed Jan 31, 2022
1 parent 3efa5ec commit a8b9d7e
Show file tree
Hide file tree
Showing 152 changed files with 16,670 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code.

Please read the full text at https://www.hashicorp.com/community-guidelines
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ assignees: ''
<!---
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
Note: the debug log may contain your API key, please search the log for `X-Auth-Token` and `Authorization` (HTTP request header holding the API token) and remove it.
To obtain the debug output, run `terraform apply` with the environment variable `TF_LOG=DEBUG`. See the [Terraform documentation on debugging](https://www.terraform.io/docs/internals/debugging.html) for more information.
--->

Expand Down
5 changes: 5 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Support

Terraform is a mature project with a growing community. There are active, dedicated people willing to help you through various mediums.

Take a look at those mediums listed at https://www.terraform.io/community.html
83 changes: 83 additions & 0 deletions .github/workflows/acctest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Acceptance Tests
on:
push:
paths-ignore:
- 'LICENSE'
- '**.md'
- 'website/**'
- 'docs/**'
jobs:

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
steps:

- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.16'
id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
test:
name: Matrix Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
version:
- stable
terraform:
- '1.0.7'
- '0.13.6'
steps:

- name: Set up Go
uses: actions/[email protected]
with:
go-version: '1.16'
id: go

- name: Check out code into the Go module directory
uses: actions/[email protected]

- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 180
env:
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
# TF_SCHEMA_PANIC_ON_ERROR: "1"
# TF_LOG: "DEBUG"
#

METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
run: |
go test -v -coverprofile coverage.txt -covermode=atomic -parallel 8 -timeout 180m ./...
- name: Sweeper
if: ${{ always() }}
env:
METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
run: |
go test ./... -v -sweep="tf_test"
- name: Upload coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: release
on:
push:
tags:
- "v*"
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ jobs:
run: go build -v .
- name: TF tests
run: go test -v -cover -parallel 4 ./...

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ website/node_modules
*.iml

website/vendor
vendor

# Test exclusions
!command/test-fixtures/**/*.tfstate
Expand Down
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.16.3
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ builds:
flags:
- -trimpath
ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
- "-s -w -X version.ProviderVersion={{.Version}} -X main.version={{.Version}} -X main.commit={{.Commit}}"
goos:
- freebsd
- windows
Expand Down
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dist: trusty
sudo: required
services:
- docker
language: go
go:
- "1.16.x"
env:
- GOFLAGS=-mod=vendor GO111MODULE=on

install:
# This script is used by the Travis build to install a cookie for
# go.googlesource.com so rate limits are higher when using `go get` to fetch
# packages that live there.
# See: https://github.com/golang/go/issues/12933
- bash scripts/gogetcookie.sh

script:
- make test
- make vet
- make website-test

branches:
only:
- main
matrix:
fast_finish: true
allow_failures:
- go: tip
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
## 1.5.0 (UNRELEASED)

FEATURES:

- **New Guide:** Migrating From the Packet Provider
- **New Guide:** Upgrading Devices from Facilities to Metros

- **New Provider Argument** `auth_token`
- **New Provider Argument** `max_retries`
- **New Provider Argument** `max_retry_wait_seconds`
- **New Resource:** `equinix_metal_port`
- **New Resource:** `equinix_metal_user_api_key`
- **New Resource:** `equinix_metal_project_api_key`
- **New Resource:** `equinix_metal_gateway`
- **New Resource:** `equinix_metal_connection`
- **New Resource:** `equinix_metal_virtual_circuit`
- **New Resource** `equinix_metal_bgp_session`
- **New Resource** `equinix_metal_device`
- **New Resource** `equinix_metal_device_network_type`
- **New Resource** `equinix_metal_ip_attachment`
- **New Resource** `equinix_metal_organization`
- **New Resource** `equinix_metal_port_vlan_attachment`
- **New Resource** `equinix_metal_project`
- **New Resource** `equinix_metal_project`
- **New Resource** `equinix_metal_project_ssh_key`
- **New Resource** `equinix_metal_reserved_ip_block`
- **New Resource** `equinix_metal_spot_market_request`
- **New Resource** `equinix_metal_ssh_key`
- **New Resource** `equinix_metal_volume`
- **New Resource** `equinix_metal_vlan`
- **New Resource** `equinix_metal_volume_attachment`
- **New Data Resource:** `equinix_metal_vlan`
- **New Data Resource:** `equinix_metal_reserved_ip_block`
- **New Data Resource:** `equinix_metal_port`
- **New Data Resource:** `equinix_metal_hardware_reservation`
- **New Data Resource:** `equinix_metal_metro`
- **New Data Resource:** `equinix_metal_connection`
- **New Data Resource** `equinix_metal_facility`
- **New Data Resource** `equinix_metal_device`
- **New Data Resource** `equinix_metal_device_bgp_neighbors`
- **New Data Resource** `equinix_metal_ip_block_ranges`
- **New Data Resource** `equinix_metal_operating_system`
- **New Data Resource** `equinix_metal_organization`
- **New Data Resource** `equinix_metal_precreated_ip_block`
- **New Data Resource** `equinix_metal_project`
- **New Data Resource** `equinix_metal_project_ssh_key`
- **New Data Resource** `equinix_metal_spot_market_price`
- **New Data Resource** `equinix_metal_spot_market_request`
- **New Data Resource** `equinix_metal_volume`

## 1.4.0 (January 14, 2022)

NOTES:
Expand Down
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Hello Contributors

Thx for your interest! We're so glad you're here.

## Important Resources

- bugs: [https://github.com/equinix/terraform-provider-equinix/issues](https://github.com/equinix/terraform-provider-equinix/issues)
- features: [https://github.com/equinix/terraform-provider-equinix/issues](https://github.com/equinix/terraform-provider-equinix/issues)

## Code of Conduct

Available via [https://github.com/equinix/terraform-provider-equinix/blob/main/.github/CODE_OF_CONDUCT.md](https://github.com/equinix/terraform-provider-equinix/blob/main/.github/CODE_OF_CONDUCT.md)

## Environment Details

[https://github.com/equinix/terraform-provider-equinix/blob/main/GNUmakefile](https://github.com/equinix/terraform-provider-equinix/blob/main/GNUmakefile)

## How to Submit Change Requests

Please submit change requests and / or features via [Issues](https://github.com/equinix/terraform-provider-equinix/issues). There's no guarantee it'll be changed, but you never know until you try. We'll try to add comments as soon as possible, though.

## How to Report a Bug

Bugs are problems in code, in the functionality of an application or in its UI design; you can submit them through [Issues/(https://github.com/equinix/terraform-provider-equinix/issues) as well.
24 changes: 24 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@ Reflected by Network Edge tests.
* `TF_ACC_NETWORK_DEVICE_VSRX_LICENSE_FILE` alters default path to JUNIPER VSRX device license file.
Reflected by Network Edge tests.

## Testing provider code

We have mostly acceptance tests in the provider. There's no point for you to run them all, but you should run the one covering the functionality which you change. The acceptance test run will cost you some money, so feel free to abstain. The acceptance test suite will be run for your PR during the review process.

To run an acceptance test, find the relevant test function in `*_test.go` (for example TestAccEquinixMetalDevice_Basic), and run it as

```sh
TF_ACC=1 go test -v -timeout=20m ./... -run=TestAccEquinixMetalDevice_Basic
```

If you want to see HTTP traffic, set `TF_LOG=DEBUG`, i.e.

```sh
TF_LOG=DEBUG TF_ACC=1 go test -v -timeout=20m ./... -run=TestAccEquinixMetalDevice_Basic
```

### Testing the provider with Terraform

Once you've built the plugin binary (see [Developing the provider](#developing-the-provider) above), it can be incorporated within your Terraform environment using the `-plugin-dir` option. Subsequent runs of Terraform will then use the plugin from your development environment.

```sh
terraform init -plugin-dir $GOPATH/bin
```

## Manual provider installation

*Note:* manual provider installation is needed only for manual testing of custom
Expand Down
Loading

0 comments on commit a8b9d7e

Please sign in to comment.