Skip to content

Commit

Permalink
fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Chubatiuk committed May 4, 2023
1 parent 368e04b commit 0bfcb7f
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 43 deletions.
45 changes: 10 additions & 35 deletions website/docs/d/tunnel.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,27 @@ This data source provides a mechanism for creating an SSH tunnel.
## Example Usage

```hcl
provider "ssh" {}
data "ssh_tunnel" "consul" {
user = "root"
auth {
private_key {
provider "ssh" {
user = "root"
auth = {
private_key = {
content = file(pathexpand("~/.ssh/id_rsa"))
}
}
server {
server = {
host = "localhost"
port = 22
}
remote {
}
data "ssh_tunnel" "consul" {
remote = {
port = 8500
}
}
provider "consul" {
address = data.ssh_tunnel.consul.local.0.address
address = data.ssh_tunnel.consul.local.address
scheme = "http"
}
Expand All @@ -48,27 +49,9 @@ data "consul_keys" "keys" {

The following arguments are supported:

* `user` - (Optional) SSH connection username. Uses current OS user by default.
* `auth` - (Optional) Configuration block for SSH server auth. Detailed below.
* `server` - (Required) Configuration block for SSH address. Detailed below.
* `local` - (Required) Configuration block for local SSH bind address. Detailed below.
* `remote` - (Required) Configuration block for remote SSH bind address. Detailed below.

### auth Configuration Block

The following arguments are supported by the `auth` configuration block:

* `sock` - (Optional) SSH Agent UNIX socket path.
* `password` - (Optional) SSH server auth password. Conflicts with `auth.0.private_key`.
* `private_key` - (Optional) Configuration block for SSH private key auth. Conflicts with `auth.0.password`. Detailed below.

### server Configuration Block

The following arguments are supported by the `server` configuration block:

* `host` - (Required) SSH server hostname or IP.
* `port` - (Optional) SSH server port. Default port is equal to 22 by default.

### local Configuration Block

The following arguments are supported by the `local` configuration block:
Expand All @@ -84,11 +67,3 @@ The following arguments are supported by the `remote` configuration block:
* `host` - (Optional) remote SSH bind hostname or IP. Default is localhost.
* `port` - (Optional) remote SSH bind port.
* `socket` - (Optional) remote SSH bind socket

### private_key Configuration Block

The following arguments are supported by the `private_key` configuration block:

* `content` - (Optional) SSH server private key.
* `password` - (Optional) SSH server private key password.
* `certificate` - (Optional) SSH server private key signing certificate.
48 changes: 40 additions & 8 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@ Use the navigation to the left to read about the available resources.
## Example Usage

```hcl
provider "ssh" {}
data "ssh_tunnel" "consul" {
provider "ssh" {
user = "root"
auth {
private_key {
auth = {
private_key = {
content = file(pathexpand("~/.ssh/id_rsa"))
}
}
server {
server = {
host = "localhost"
port = 22
}
remote {
}
data "ssh_tunnel" "consul" {
remote = {
port = 8500
}
}
provider "consul" {
address = data.ssh_tunnel.consul.local.0.address
address = data.ssh_tunnel.consul.local.address
scheme = "http"
}
Expand All @@ -45,3 +46,34 @@ data "consul_keys" "keys" {
}
}
```

## Argument Reference

The following arguments are supported:

* `user` - (Optional) SSH connection username. Uses current OS user by default.
* `auth` - (Optional) Configuration block for SSH server auth. Detailed below.
* `server` - (Required) Configuration block for SSH address. Detailed below.

### auth Configuration Block

The following arguments are supported by the `auth` configuration block:

* `sock` - (Optional) SSH Agent UNIX socket path.
* `password` - (Optional) SSH server auth password. Conflicts with `auth.0.private_key`.
* `private_key` - (Optional) Configuration block for SSH private key auth. Conflicts with `auth.0.password`. Detailed below.

### server Configuration Block

The following arguments are supported by the `server` configuration block:

* `host` - (Required) SSH server hostname or IP.
* `port` - (Optional) SSH server port. Default port is equal to 22 by default.

### private_key Configuration Block

The following arguments are supported by the `private_key` configuration block:

* `content` - (Optional) SSH server private key.
* `password` - (Optional) SSH server private key password.
* `certificate` - (Optional) SSH server private key signing certificate.

0 comments on commit 0bfcb7f

Please sign in to comment.