Skip to content

Commit

Permalink
Merge branch 'main' into CXF-74547-Fabric-Network
Browse files Browse the repository at this point in the history
  • Loading branch information
srushti-patl authored Jan 31, 2024
2 parents b8f3994 + d351d0d commit 32c5097
Show file tree
Hide file tree
Showing 162 changed files with 3,777 additions and 2,097 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
blank_issues_enabled: true
contact_links:
- name: Terraform Equinix Provider Questions
url: https://community.equinix.com/t5/forums/filteredbylabelpage/board-id/OR/label-name/Developer
url: https://community.equinix.com/developers
about: GitHub issues in this repository are only intended for bug reports and feature requests. Other issues will be closed. Please ask and answer questions through the Equinix Community Forum.

- name: Terraform Core Bug Reports and Feature Requests
Expand Down
195 changes: 195 additions & 0 deletions .github/workflows/fabric_acctest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
name: Fabric Acceptance Tests
# This workflow determines whether a PR comes from an external fork
# (which requires approval from us) or from a branch on this repository
# (which means it was made by us and can run immediately). Once a PR
# is approved, the PR code gains access to secrets referenced in this
# workflow.

# The 'build' job and subsequent jobs, are executed only when the pull
# request is not a draft, regardless of whether it is from an internal
# branch or external fork.

# Any changes to this job, even from internal contributors, require heavy scrutiny.

on:
pull_request_target:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- '**fabric**'
- '!LICENSE'
- '!**.md'
- '!website/**'
- '!docs/**'
- '!.github/ISSUE_TEMPLATE/**'
workflow_dispatch:

permissions:
pull-requests: read
contents: read

jobs:

authorize:
if: (github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request_target' && github.event.pull_request.draft == false)
environment:
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event_name == 'pull_request_target' && format('acctest-authorize-pr-{0}', github.event.pull_request.number) || 'acctest-authorize' }}
cancel-in-progress: true
steps:
- run: true

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

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

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

- name: Get dependencies
run: |
go mod download
- name: Build
run: |
go build -v .
test-PFNV:
name: Matrix Test
needs: build
concurrency: fabricacctestpfnv
runs-on: ubuntu-latest
env:
EQUINIX_API_ENDPOINT: "https://uatapi.equinix.com"
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
version:
- stable
terraform:
- '1.5'
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

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

- name: Get dependencies
run: |
go mod download
- name: TF Fabric PNFV acceptance tests
timeout-minutes: 180
env:
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
EQUINIX_API_CLIENTID: ${{ secrets.EQUINIX_API_CLIENTID_PNFV }}
EQUINIX_API_CLIENTSECRET: ${{ secrets.EQUINIX_API_CLIENTSECRET_PNFV }}
METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
run: |
go test ./... -v -coverprofile coverage_pnfv.txt -covermode=atomic -count 1 -parallel 8 -run "(PNFV)" -timeout 180m
- name: Sweeper PNFV
if: ${{ always() }}
env:
EQUINIX_API_CLIENTID: ${{ secrets.EQUINIX_API_CLIENTID_PNFV }}
EQUINIX_API_CLIENTSECRET: ${{ secrets.EQUINIX_API_CLIENTSECRET_PNFV }}
METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
SWEEP: "all" #Flag required to define the regions that the sweeper is to be ran in
SWEEP_ALLOW_FAILURES: "true" #Enable to allow Sweeper Tests to continue after failures
SWEEP_DIR: "./equinix"
run: |
# Added sweep-run to filter Fabric PNFV test
go test ${SWEEP_DIR} -v -timeout 180m -sweep=${SWEEP} -sweep-allow-failures=${SWEEP_ALLOW_FAILURES} -sweep-run=$(grep -o 'AddTestSweepers("[^"]*PNFV"' equinix/resource_fabric_* | cut -d '"' -f2 | paste -s -d, -)
- name: Upload coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_pnfv.txt

test-PFCR:
name: Matrix Test
needs: build
concurrency: fabricacctestpfcr
runs-on: ubuntu-latest
env:
EQUINIX_API_ENDPOINT: "https://uatapi.equinix.com"
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
version:
- stable
terraform:
- '1.5'
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

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

- name: Get dependencies
run: |
go mod download
- name: TF Fabric PFCR acceptance tests
timeout-minutes: 180
env:
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
EQUINIX_API_CLIENTID: ${{ secrets.EQUINIX_API_CLIENTID_PFCR }}
EQUINIX_API_CLIENTSECRET: ${{ secrets.EQUINIX_API_CLIENTSECRET_PFCR }}
METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
run: |
go test ./... -v -coverprofile coverage_pfcr.txt -covermode=atomic -count 1 -parallel 8 -run "(PFCR)" -timeout 180m
- name: Sweeper PFCR
if: ${{ always() }}
env:
EQUINIX_API_CLIENTID: ${{ secrets.EQUINIX_API_CLIENTID_PFCR }}
EQUINIX_API_CLIENTSECRET: ${{ secrets.EQUINIX_API_CLIENTSECRET_PFCR }}
METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }}
SWEEP: "all" #Flag required to define the regions that the sweeper is to be ran in
SWEEP_ALLOW_FAILURES: "true" #Enable to allow Sweeper Tests to continue after failures
SWEEP_DIR: "./equinix"
run: |
# Added sweep-run to filter Fabric PFCR test
go test ${SWEEP_DIR} -v -timeout 180m -sweep=${SWEEP} -sweep-allow-failures=${SWEEP_ALLOW_FAILURES} -sweep-run=$(grep -o 'AddTestSweepers("[^"]*PFCR"' equinix/resource_fabric_* | cut -d '"' -f2 | paste -s -d, -)
- name: Upload coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage_pfcr.txt
11 changes: 11 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file
#
* @equinix/governor-devrel-engineering
/cmd/migration-tool @equinix/governor-metal-client-interfaces
*metal* @t0mk @equinix/governor-metal-client-interfaces
*fabric* @equinix/governor-digin-fabric
*ecx* @equinix/governor-digin-fabric
*connection_e2e* @equinix/governor-digin-fabric
*resource_network_* @equinix/governor-ne-network-edge-engineering
*data_source_network_* @equinix/governor-ne-network-edge-engineering
**/edge-networking @equinix/governor-ne-network-edge-engineering
6 changes: 2 additions & 4 deletions docs/data-sources/equinix_ecx_l2_sellerprofile.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
subcategory: "Fabric"
---

# DEPRECATED RESOURCE

End of Life will be June 30th, 2024. Use equinix_fabric_service_profile instead.

# equinix_ecx_l2_sellerprofile (Data Source)

!> **DEPRECATED** End of Life will be June 30th, 2024. Use `equinix_fabric_service_profile` instead.

Use this data source to get details of Equinix Fabric layer 2 seller profile with a given name
and / or organization.

Expand Down
6 changes: 2 additions & 4 deletions docs/data-sources/equinix_ecx_l2_sellerprofiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
subcategory: "Fabric"
---

# DEPRECATED RESOURCE

End of Life will be June 30th, 2024. Use equinix_fabric_service_profiles instead.

# equinix_ecx_l2_sellerprofiles (Data Source)

!> **DEPRECATED** End of Life will be June 30th, 2024. Use `equinix_fabric_service_profiles` instead.

Use this data source to get details of available Equinix Fabric layer 2 seller profiles. It is
possible to apply filtering criteria for returned list of profiles.

Expand Down
6 changes: 2 additions & 4 deletions docs/data-sources/equinix_ecx_port.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
subcategory: "Fabric"
---

# DEPRECATED RESOURCE

End of Life will be June 30th, 2024. Use equinix_fabric_port and equinix_fabric_ports instead.

# equinix_ecx_port (Data Source)

!> **DEPRECATED** End of Life will be June 30th, 2024. Use `equinix_fabric_port` and `equinix_fabric_ports` instead.

Use this data source to get details of Equinix Fabric port with a given name.

## Example Usage
Expand Down
10 changes: 7 additions & 3 deletions docs/data-sources/equinix_fabric_cloud_router.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@ page_title: "equinix_fabric_cloud_router Data Source - terraform-provider-equini
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch Fabric Cloud Router for a given UUID
~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md
---

# equinix_fabric_clouder_router (Data Source)

Fabric V4 API compatible data resource that allow user to fetch Fabric Cloud Router for a given UUID

~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)

API documentation can be found here - https://developer.equinix.com/dev-docs/fabric/api-reference/fabric-v4-apis#fabric-cloud-routers

## Example Usage

```hcl
data "equinix_fabric_cloud_router" "cloud_router_data_name" {
uuid = "<uuid_of_cloud_router>"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 6 additions & 3 deletions docs/data-sources/equinix_fabric_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ page_title: "equinix_fabric_connection Data Source - terraform-provider-equinix"
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch connection for a given UUID
~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md
---

# equinix_fabric_connection (Data Source)

Fabric V4 API compatible data resource that allow user to fetch connection for a given UUID

~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)

## Example Usage

```hcl
data "equinix_fabric_connection" "connection_data_name" {
uuid = "<uuid_of_connection>"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 6 additions & 3 deletions docs/data-sources/equinix_fabric_port.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ page_title: "equinix_fabric_port Data Source - terraform-provider-equinix"
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch port by uuid
~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md
---

# equinix_fabric_port (Data Source)

Fabric V4 API compatible data resource that allow user to fetch port by uuid

~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)

## Example Usage

```hcl
data "equinix_fabric_port" "port_data_name" {
uuid = "<uuid_of_port>"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/equinix_fabric_ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@ page_title: "equinix_fabric_ports Data Source - terraform-provider-equinix"
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch port by name
~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md
---

# equinix_fabric_ports (Data Source)

Fabric V4 API compatible data resource that allow user to fetch port by name

~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)

## Example Usage

```hcl
data "equinix_fabric_ports" "ports_data_name" {
filters {
name = "<name_of_port||port_prefix>"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
11 changes: 8 additions & 3 deletions docs/data-sources/equinix_fabric_routing_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@ page_title: "equinix_fabric_routing_protocol Data Source - terraform-provider-eq
subcategory: "Fabric"
description: |-
Fabric V4 API compatible data resource that allow user to fetch routing protocol for a given UUID
~> Note Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to equinix_fabric_ resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new issue https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md
---

# equinix_fabric_routing_protocol (Data Source)

Fabric V4 API compatible data resource that allow user to fetch routing protocol for a given UUID

~> **Note** Equinix Fabric v4 resources and datasources are currently in Beta. The interfaces related to `equinix_fabric_` resources and datasources may change ahead of general availability. Please, do not hesitate to report any problems that you experience by opening a new [issue](https://github.com/equinix/terraform-provider-equinix/issues/new?template=bug.md)

API documentation can be found here - https://developer.equinix.com/dev-docs/fabric/api-reference/fabric-v4-apis#routing-protocols

## Example Usage

```hcl
data "equinix_fabric_routing_protocol" "routing_protocol_data_name" {
uuid = "<uuid_of_routing_protocol>"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down
Loading

0 comments on commit 32c5097

Please sign in to comment.