Skip to content

Commit

Permalink
Update documentation in preparation for release
Browse files Browse the repository at this point in the history
  • Loading branch information
wrgeorge1983 committed May 2, 2022
1 parent ef76d45 commit bf9c20d
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 79 deletions.
153 changes: 76 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,77 @@
# Terraform Provider SDWAN

Requirements
------------

- [Terraform](https://www.terraform.io/downloads.html) v0.13 and v0.14.

- [Go](https://golang.org/doc/install) Latest Version

## Building The Provider ##
Clone this repository to: `$GOPATH/src/github.com/CiscoDevNet/terraform-provider-sdwan`.
Clone [sdwan-go-client](https://github.com/CiscoDevNet/sdwan-go-client) to `$GOPATH/src/github.com/CiscoDevNet/sdwan-go-client`.

```sh
$ mkdir -p $GOPATH/src/github.com/CiscoDevNet; cd $GOPATH/src/github.com/CiscoDevNet
$ git clone https://github.com/CiscoDevNet/terraform-provider-sdwan.git
$ git clone https://github.com/CiscoDevNet/sdwan-go-client.git
```

Enter the provider directory, After that run make build to build the provider binary. This will build the provider with sanity checks present in scripts directory and put the provider binary in `$GOPATH/bin` directory.

```sh
$ cd $GOPATH/src/github.com/CiscoDevNet/terraform-provider-sdwan
$ make build

```


Using The Provider
------------------
Move the generated binary from the build step to the [plugin directory](https://www.terraform.io/docs/cli/config/config-file.html#implied-local-mirror-directories)/CiscoDevNet/sdwan/`<version>`/`<os>_<arch>`. Examples for `<os>_<arch>` are `windows_amd64`, `linux_arm`, `darwin_amd64`, etc. After placing it into your plugins directory, run `terraform init` to initialize it.

example:
```hcl
#configure provider with your SDWAN credentials.
terraform {
required_providers {
sdwan = {
source = "CiscoDevNet/sdwan"
}
}
}
provider "sdwan" {
# cisco-sdwan user name
username = "admin"
# cisco-sdwan password
password = "password"
# cisco-sdwan url
url = "https://my-cisco-sdwan.com"
insecure = true
}
resource "sdwan_device_template" "test" {
template_name = "example1"
template_description = "For testing purpose"
device_type = "vedge-cloud"
device_role = "sdwan-edge"
config_type = "file"
factory_default = false
template_configuration = "`"
}
```


Developing The Provider
-----------------------
If you want to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine. You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make build`. This will build the provider with sanity checks present in scripts directory and put the provider binary in `$GOPATH/bin` directory.


## Debugging and Troubleshooting

- Set environment variable `TF_LOG` to one of the log levels `TRACE`, `DEBUG`, `INFO`, `WARN` or `ERROR`
- Set environment variable `TF_LOG_PATH` to write logs in a file. e.g. `TF_LOG_PATH=tf.log`

# Terraform Provider SDWAN
## NOTE: ## ### this is a fork of the CiscoDevNet provider by Apcela intended to be published independently. ###
### There are still many references to `CiscoDevNet` in the code and docs, many of these are historical at this point. ###


Requirements
------------
This provider is being developed and tested against:

- [Terraform](https://www.terraform.io/downloads.html) v1.0.11+

- [Go](https://golang.org/doc/install) 1.18+

## Building The Provider ##

Clone this repository and enter the provider directory.
```sh
$ git clone https://github.com/Apcela/terraform-provider-sdwan.git
```

Enter the provider directory. Use the `make` command to build, test and validate the provider.

```sh
$ cd terraform-provider-sdwan
$ make
```

Using The Provider
------------------
Move the generated binary from the build step to the [plugin directory](https://www.terraform.io/docs/cli/config/config-file.html#implied-local-mirror-directories)/CiscoDevNet/sdwan/`<version>`/`<os>_<arch>`. Examples for `<os>_<arch>` are `windows_amd64`, `linux_arm`, `darwin_amd64`, etc. After placing it into your plugins directory, run `terraform init` to initialize it.

example:
```hcl
#configure provider with your SDWAN credentials.
terraform {
required_providers {
sdwan = {
source = "Apcela/sdwan"
}
}
}
provider "sdwan" {
# cisco-sdwan user name
username = "admin"
# cisco-sdwan password
password = "password"
# cisco-sdwan url
url = "https://my-cisco-sdwan.com"
insecure = true
}
resource "sdwan_device_template" "test" {
template_name = "example1"
template_description = "For testing purpose"
device_type = "vedge-cloud"
device_role = "sdwan-edge"
config_type = "file"
factory_default = false
template_configuration = "`"
}
```


Developing The Provider
-----------------------
If you want to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine. You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.

To compile the provider, run `make build`. This will build the provider with sanity checks present in scripts directory and put the provider binary in `$GOPATH/bin` directory.


## Debugging and Troubleshooting

- Set environment variable `TF_LOG` to one of the log levels `TRACE`, `DEBUG`, `INFO`, `WARN` or `ERROR`
- Set environment variable `TF_LOG_PATH` to write logs in a file. e.g. `TF_LOG_PATH=tf.log`

For more details visit - [Terraform Debugging](https://www.terraform.io/docs/internals/debugging.html)
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: "sdwan"
page_title: "Provider: SDWAN"
sidebar_current: "docs-sdwan-index"
description: |-
The Cisco SDWAN provider is used to interact with the resources provided by Cisco vManage. The provider needs to be configured with the proper credentials before it can be used.
The Apcela SDWAN provider is used to interact with the resources provided by Cisco vManage. The provider needs to be configured with the proper credentials before it can be used.
---


Expand All @@ -13,7 +13,7 @@ Cisco SD-WAN is a cloud-delivered overlay WAN architecture connecting branches t

Cisco SDWAN Provider
------------
The Cisco SDWAN provider is used to interact with the resources provided by Cisco vManage. The provider needs to be configured with the proper credentials before it can be used.
The Apcela SDWAN provider is used to interact with the resources provided by Cisco vManage. The provider needs to be configured with the proper credentials before it can be used.

Authentication
--------------
Expand Down

0 comments on commit bf9c20d

Please sign in to comment.