Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/golang.org/x/crypto-0.…
Browse files Browse the repository at this point in the history
…29.0
  • Loading branch information
cjlapao authored Nov 11, 2024
2 parents e11492a + f162072 commit 3bc2b1b
Show file tree
Hide file tree
Showing 81 changed files with 5,151 additions and 1,065 deletions.
37 changes: 25 additions & 12 deletions docs/data-sources/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,20 @@ Virtual Machine Data Source

```terraform
data "parallels-desktop_vm" "example" {
host = "http://example.com:8080"
# You can only use one of the following options
# Use the host if you need to connect directly to a host
host = "http:#example.com:8080"
# Use the orchestrator if you need to connect to a Parallels Orchestrator
orchestrator = "https:#orchestrator.example.com:443"
# The authenticator block for authenticating to the API, either to the host or orchestrator
authenticator {
username = "john.doe"
password = "my-password"
}
# The filter block to filter the VMs
filter {
field_name = "name"
value = "exampe-vm"
Expand All @@ -26,14 +38,12 @@ data "parallels-desktop_vm" "example" {
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `host` (String)

### Optional

- `authenticator` (Block, Optional) Authenticator block, this is used to authenticate with the Parallels Desktop API, if empty it will try to use the root password (see [below for nested schema](#nestedblock--authenticator))
- `filter` (Block, Optional) Filter block, this is used to filter data sources (see [below for nested schema](#nestedblock--filter))
- `host` (String) Parallels Desktop DevOps Host
- `orchestrator` (String) Parallels Desktop DevOps Orchestrator

### Read-Only

Expand Down Expand Up @@ -67,10 +77,13 @@ Optional:

Read-Only:

- `description` (String)
- `home` (String)
- `host_ip` (String)
- `id` (String)
- `name` (String)
- `os_type` (String)
- `state` (String)
- `description` (String) The description of the virtual machine
- `external_ip` (String) VM external IP address
- `home` (String) The path to the virtual machine home directory
- `host_ip` (String) The IP address of the host machine
- `id` (String) The unique identifier of the virtual machine
- `internal_ip` (String) VM internal IP address
- `name` (String) The name of the virtual machine
- `orchestrator_host_id` (String) Orchestrator Host Id if the VM is running in an orchestrator
- `os_type` (String) The type of the operating system installed on the virtual machine
- `state` (String) The state of the virtual machine
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ You can also join our community on [Discord](https://discord.gg/aFsrjbkN) channe
```terraform
provider "parallels-desktop" {
license = "xxxx-xxxx-xxxx-xxxx"
# Optional, will disable TLS validation when doing calls to the API using HTTPS
# this is useful when the API is using a self-signed certificate
disable_tls_validation = true
}
```

Expand Down
116 changes: 111 additions & 5 deletions docs/resources/clone_vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ Parallels Desktop Clone VM resource

```terraform
data "parallels-desktop_vm" "example" {
host = "https://example.com:8080"
host = "https:#example.com:8080"
authenticator {
username = "john.doe"
password = "my-password"
}
filter {
field_name = "name"
Expand All @@ -24,16 +29,29 @@ data "parallels-desktop_vm" "example" {
}
resource "parallels-desktop_clone_vm" "example" {
host = "https://example.com:8080"
# You can only use one of the following options
# Use the host if you need to connect directly to a host
host = "http://example.com:8080"
# Use the orchestrator if you need to connect to a Parallels Orchestrator
orchestrator = "https://orchestrator.example.com:443"
name = "example-vm"
owner = "example"
base_vm_id = data.parallels-desktop_vm.example.machines[count.index].id
path = "/some/folder/path"
# The authenticator block for authenticating to the API, either to the host or orchestrator
# in this case we are using the API key
authenticator {
api_key = "some api key"
}
# The configuration for the VM
config {
start_headless = true
}
# this will allow you to fine grain the configuration of the VM
# you can pass any command that is compatible with the prlctl command
# directly to the VM
Expand All @@ -56,6 +74,24 @@ resource "parallels-desktop_clone_vm" "example" {
force_changes = true
# this flag will set the desired state for the VM
# if it is set to true it will keep the VM running otherwise it will stop it
# by default it is set to true, so all VMs will be running
keep_running = true
# This will contain the configuration for the port forwarding reverse proxy
# in this case we are opening a port to any part in the host, it will not be linked to any
# specific vm or container. by default it will listen on 0.0.0.0 (all interfaces)
# and the target host will also be 0.0.0.0 (all interfaces) so it will be open to the world
# use
reverse_proxy_host {
port = "2022"
tcp_route {
target_port = "22"
}
}
# This will contain the configuration for the shared folders
shared_folder {
name = "user_download_folder"
Expand All @@ -66,7 +102,7 @@ resource "parallels-desktop_clone_vm" "example" {
# allowing you to run any command on the VM after it has been deployed
# you can have multiple lines and they will be executed in order
post_processor_script {
// Retry the script 4 times with 10 seconds between each attempt
# Retry the script 4 times with 10 seconds between each attempt
retry {
attempts = 4
wait_between_attempts = "10s"
Expand All @@ -80,7 +116,7 @@ resource "parallels-desktop_clone_vm" "example" {
# This is a special block that will allow you to undo any changes your scripts have done
# if you are destroying a VM, like unregistering from a service where the VM was registered
on_destroy_script {
// Retry the script 4 times with 10 seconds between each attempt
# Retry the script 4 times with 10 seconds between each attempt
retry {
attempts = 4
wait_between_attempts = "10s"
Expand Down Expand Up @@ -113,14 +149,18 @@ resource "parallels-desktop_clone_vm" "example" {
- `owner` (String) Virtual Machine owner
- `post_processor_script` (Block List) Run any script after the virtual machine is created (see [below for nested schema](#nestedblock--post_processor_script))
- `prlctl` (Block List) Virtual Machine config block, this is used set some of the most common settings for a VM (see [below for nested schema](#nestedblock--prlctl))
- `run_after_create` (Boolean) Run after create, this will make the VM to run after creation
- `reverse_proxy_host` (Block List) Parallels Desktop DevOps Reverse Proxy configuration (see [below for nested schema](#nestedblock--reverse_proxy_host))
- `run_after_create` (Boolean, Deprecated) Run after create, this will make the VM to run after creation
- `shared_folder` (Block List) Shared Folders Block, this is used to share folders with the virtual machine (see [below for nested schema](#nestedblock--shared_folder))
- `specs` (Block, Optional) Virtual Machine Specs block, this is used to set the specs of the virtual machine (see [below for nested schema](#nestedblock--specs))
- `timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))

### Read-Only

- `external_ip` (String) VM external IP address
- `id` (String) Virtual Machine Id
- `internal_ip` (String) VM internal IP address
- `keep_running` (Boolean) This will keep the VM running after the terraform apply
- `os_type` (String) Virtual Machine OS type

<a id="nestedblock--authenticator"></a>
Expand Down Expand Up @@ -231,6 +271,72 @@ Optional:



<a id="nestedblock--reverse_proxy_host"></a>
### Nested Schema for `reverse_proxy_host`

Required:

- `port` (String) Reverse proxy port

Optional:

- `cors` (Block, Optional) Parallels Desktop DevOps Reverse Proxy Http Route CORS configuration (see [below for nested schema](#nestedblock--reverse_proxy_host--cors))
- `host` (String) Reverse proxy host
- `http_routes` (Block List) Parallels Desktop DevOps Reverse Proxy Http Route CORS configuration (see [below for nested schema](#nestedblock--reverse_proxy_host--http_routes))
- `tcp_route` (Block, Optional) Parallels Desktop DevOps Reverse Proxy TCP Route configuration (see [below for nested schema](#nestedblock--reverse_proxy_host--tcp_route))
- `tls` (Block, Optional) Parallels Desktop DevOps Reverse Proxy Http Route TLS configuration (see [below for nested schema](#nestedblock--reverse_proxy_host--tls))

Read-Only:

- `id` (String) Reverse proxy Host id

<a id="nestedblock--reverse_proxy_host--cors"></a>
### Nested Schema for `reverse_proxy_host.cors`

Optional:

- `allowed_headers` (List of String) Allowed headers
- `allowed_methods` (List of String) Allowed methods
- `allowed_origins` (List of String) Allowed origins
- `enabled` (Boolean) Enable CORS


<a id="nestedblock--reverse_proxy_host--http_routes"></a>
### Nested Schema for `reverse_proxy_host.http_routes`

Optional:

- `path` (String) Reverse proxy HTTP Route path
- `pattern` (String) Reverse proxy HTTP Route pattern
- `request_headers` (Map of String) Reverse proxy HTTP Route request headers
- `response_headers` (Map of String) Reverse proxy HTTP Route response headers
- `schema` (String) Reverse proxy HTTP Route schema
- `target_host` (String) Reverse proxy HTTP Route target host
- `target_port` (String) Reverse proxy HTTP Route target port
- `target_vm_id` (String) Reverse proxy HTTP Route target VM id


<a id="nestedblock--reverse_proxy_host--tcp_route"></a>
### Nested Schema for `reverse_proxy_host.tcp_route`

Optional:

- `target_host` (String) Reverse proxy host
- `target_port` (String) Reverse proxy port
- `target_vm_id` (String) Reverse proxy target VM ID


<a id="nestedblock--reverse_proxy_host--tls"></a>
### Nested Schema for `reverse_proxy_host.tls`

Optional:

- `certificate` (String) TLS Certificate
- `enabled` (Boolean) Enable TLS
- `private_key` (String) TLS Private Key



<a id="nestedblock--shared_folder"></a>
### Nested Schema for `shared_folder`

Expand Down
Loading

0 comments on commit 3bc2b1b

Please sign in to comment.