Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/iopr 4186 #8

Merged
merged 22 commits into from
Aug 12, 2024
Merged
13 changes: 13 additions & 0 deletions .github/actions/setup-gitconfig/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: setup gitconfig
description: set up gitconfig with an org PAT to clone private repos
inputs:
ORG_GITHUB_TOKEN:
description: 'organizational personal access token with read private repositories permission'
required: true

runs:
using: composite
steps:
- name: Set up gitconfig to clone github private repositories
run: git config --global url."https://${{ inputs.ORG_GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
shell: bash
110 changes: 79 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,111 @@ on:
- feat/**
- fix/**
- hotfix/**
- main
push:
branches:
- main

env:
NODE_VERSION: 14
GO_VERSION: 1.22.0
NODE_VERSION: 22.6.0
GO_VERSION: v1.22.0
GOLANGCI_LINT_VERSION: v1.59
GOPRIVATE: github.com/intercloud
TF_VERSION: 1.9.0
TF_MODULE_PATH: examples/autonomi

jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
- name: checkout code
uses: actions/checkout@v4
- name: set up Node
uses: actions/setup-node@v4
with:
node-version: $NODE_VERSION
- name: Install markdownlint-cli
node-version: ${{ env.NODE_VERSION }}
- name: install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Run markdownlint
- name: markdownlint
run: markdownlint '**/*.md'

go-mod-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
- name: checkout code
uses: actions/checkout@v4
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: set up gitconfig
uses: ./.github/actions/setup-gitconfig
with:
go-version: $GO_VERSION
- name: Run go mod tidy
ORG_GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
- name: go mod tidy
run: go mod tidy

go-lint:
golangci-lint:
runs-on: ubuntu-latest
needs:
- go-mod-tidy
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
- name: checkout code
uses: actions/checkout@v4
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
go-version: $GO_VERSION
- name: Install go-tools
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run go-tools
run: staticcheck ./...
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: './...'

go-test:
runs-on: ubuntu-latest
needs:
- golangci-lint
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
- name: checkout code
uses: actions/checkout@v4
- name: set up Go
uses: actions/setup-go@v5
with:
go-version: $GO_VERSION
- name: Run tests
go-version: ${{ env.GO_VERSION }}
- name: go test
run: go test ./... -v

tf-validate:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform init
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform init
- name: terraform validate
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform validate

tf-plan:
runs-on: ubuntu-latest
needs:
- tf-validate
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: set up terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: terraform plan
working-directory: ${{ env.TF_MODULE_PATH }}
run: terraform plan
env:
TF_VAR_pat_token: ${{ secrets.TF_VAR_PAT_TOKEN }}
TF_VAR_aws_account_id: ${{ secrets.TF_VAR_AWS_ACCOUNT_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ go.work.sum
# Terraform local file
*.backup
*.tfvars
!examples/autonomi/terraform.auto.tfvars
*.tfstate

examples/autonomi/main.tf
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# for more details on golangci-lint configuration file, see:
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

# options for analysis running
run:
tests: true
19 changes: 19 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# for more details on the markdownlint configuration file, see:
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml

# default state for all rules
default: true

# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md
MD013:
line_length: 120

# MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md
MD022:
lines_above: 0

# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md
MD033:
allowed_elements:
- img
- a
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Terraform Provider Autonomi

The autonomi provider enables Terraform to manage autonomi resources.
The autonomi provider enables Terraform to manage autonomi resources.
8 changes: 5 additions & 3 deletions docs/data-sources/cloud_products.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ data "autonomi_cloud_products" "clouds" {

### Read-Only

- `facet_distribution` (Attributes) The **facet_distribution** attribute provides an overview of the distribution of various facets within the cloud products returned by the Meilisearch query. This attribute allows you to analyze the frequency of different categories or attributes in the search results. (see [below for nested schema](#nestedatt--facet_distribution))
- `hits` (Attributes List) The **hits** attribute contains the list of cloud products returned by the Meilisearch query. Each hit represents a cloud product that matches the specified search criteria. (see [below for nested schema](#nestedatt--hits))
- `facet_distribution` (Attributes) The **facet_distribution** attribute provides an overview of the distribution of
various facets within the cloud products returned by the Meilisearch query. This attribute allows you to analyze the
frequency of different categories or attributes in the search results. (see [below for nested schema](#nestedatt--facet_distribution))
- `hits` (Attributes List) The **hits** attribute contains the list of cloud products returned by the Meilisearch query.
Each hit represents a cloud product that matches the specified search criteria. (see [below for nested schema](#nestedatt--hits))

<a id="nestedatt--facet_distribution"></a>
### Nested Schema for `facet_distribution`
Expand All @@ -48,7 +51,6 @@ Read-Only:
- `location` (Map of Number)
- `provider` (Map of Number)


<a id="nestedatt--hits"></a>
### Nested Schema for `hits`

Expand Down
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ provider "autonomi" {
}
```


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

Expand Down
6 changes: 2 additions & 4 deletions docs/resources/cloud_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ resource "autonomi_cloud_node" "cloud_node" {
}
```



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

Expand All @@ -37,7 +35,8 @@ resource "autonomi_cloud_node" "cloud_node" {

### Read-Only

- `administrative_state` (String) Administrative state of the cloud node [creation_pending, creation_proceed, creation_error, deployed, delete_pending, delete_proceed, delete_error]
- `administrative_state` (String) Administrative state of the cloud node [creation_pending, creation_proceed,
creation_error, deployed, delete_pending, delete_proceed, delete_error]
- `connection_id` (String) Connection ID created and returned by the cloud provider
- `created_at` (String) Creation date of the cloud node
- `dxcon_id` (String) Dxcon ID created and returned by AWS
Expand All @@ -53,7 +52,6 @@ Required:

- `sku` (String) ID of the product


<a id="nestedatt--provider_config"></a>
### Nested Schema for `provider_config`

Expand Down
1 change: 0 additions & 1 deletion docs/resources/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ resource "autonomi_workspace" {
}
```


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

Expand Down
8 changes: 8 additions & 0 deletions examples/autonomi/terraform.auto.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
csp_name = "AWS"
csp_city = "pa"
csp_region = "eu-west-3"
underlay_provider = "EQUINIX"
bandwidth = 50
location = "EQUINIX AM2"
host_url = "https://api.autonomi.io"
catalog_url = "https://catalog.autonomi.io"
Loading