Skip to content

Commit

Permalink
release-v0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav Samanta authored and sourav-citrix committed Jul 8, 2024
1 parent 15cf51e commit 754013e
Show file tree
Hide file tree
Showing 170 changed files with 11,314 additions and 1,468 deletions.
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: Bug report
about: Report any issues using the Citrix Terraform Provider
title: "[Bug]"
labels: bug
assignees: ''

---

*Thanks for taking the time to fill out this bug report! Before submitting this issue please check the [open bugs](https://github.com/citrix/terraform-provider-citrix/issues?q=is%3Aissue+is%3Aopen+label%3Abug) to ensure the bug has not already been reported. If it has been reported give it a 👍*

*If this bug is present when using the Citrix service UI or REST APIs then it is not a bug in the provider but rather a bug in the underlying service or the environment. In some cases there can be an enhancement in the provider to handle the error better. Please open a feature request instead of a bug in this case. For more information see [CONTRIBUTING.md#provider-issue-vs-product-issue-vs-configuration-issue](https://github.com/citrix/terraform-provider-citrix/blob/main/CONTRIBUTING.md#provider-issue-vs-product-issue-vs-configuration-issue).*


## Describe the bug

*Summary of the issue*

**Terraform command (import, apply, etc):**
**Resource impacted:**


## Versions

*Use the `terraform -v` command to find the Terraform and Citrix Provider versions.*
**Terraform:**
**citrix/citrix provider:**
**Operation system:**

*For on-premises customers fill out any that apply with the CU or LTSR version (eg 2402).*
**CVAD (DDC, VDA, etc):**
**Storefront:**

## Terraform configuration files
*Paste or attach any relevant `.tf` files with secrets and identifying information removed.*


## Terraform console output
*Paste the output from Terraform CLI including any errors and the transactionIds if present.*

*If the output references a file in the temp directory include it as well.*


## Terraform log file
*If the issue is reproducible enable Terraform debug logging using one of the commands below. Then reproduce the issue and include the resulting log file. More information about Terraform logging is available [here](https://developer.hashicorp.com/terraform/plugin/log/managing#enable-logging).*

*cmd:*
```bat
set TF_LOG="DEBUG"
set TF_LOG_PATH="./citrix-provider-issue.txt"
terraform <command>
```

*Powershell:*
```powershell
$env:TF_LOG="DEBUG"
$env:TF_LOG_PATH="./citrix-provider-issue.txt"
terraform <command>
```

*bash:*
```bash
export TF_LOG="DEBUG"
export TF_LOG_PATH="./citrix-provider-issue.txt"
terraform <command>
```
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for the Citrix Terraform Provider
title: "[Feature]"
labels: enhancement
assignees: ''

---

*Thanks for taking the time to fill out this feature request! Before submitting this issue please check the [open feature requests](https://github.com/citrix/terraform-provider-citrix/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement) to ensure the feature has not already been reported. If it has been reported give it a 👍*

## Describe the feature request
*Fill out the following questions and add any additional information.*
**Summary:**

**Is this an enhancement to an existing resource or data source, if so which one?**

**If this is a new resource or data source describe what it should do.**

**Link to any docs that cover this feature:**
https://docs.citrix.com/

**Link to any APIs that cover this feature:**
https://developer-docs.citrix.com/
4 changes: 3 additions & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ In order to reduce errors this project has introduced a system to convert betwee
| `T` | `types.Object` | `TypedObjectToObjectValue` | `T` must implement `ModelWithAttributes` |
| `types.List` | `T[]` | `ObjectListToTypedArray[T]` | `T` must implement `ModelWithAttributes`. For a list of nested objects |
| `T[]` | `types.List` | `TypedArrayToObjectList[T]` | `T` must implement `ModelWithAttributes`. For a list of nested objects |
| `types.Set` | `T[]` | `ObjectSetToTypedArray[T]` | `T` must implement `ModelWithAttributes`. For a set of nested objects |
| `T[]` | `types.Set` | `TypedArrayToObjectSet[T]` | `T` must implement `ModelWithAttributes`. For a set of nested objects |
| `types.List` | `string[]` | `StringListToStringArray` | For a list of strings |
| `string[]` | `types.List` | `StringArrayToStringList` | For a list of strings |
| `types.Set` | `string[]` | `StringSetToStringArray` | For a set of strings |
| `string[]` | `types.Set` | `StringArrayToStringSet` | For a set of strings |

In order to use the first 4 of these methods, the struct `T` needs to implement the [ModelWithAttributes](internal/util/types.go) interface which is ultimately populated from the attribute's Schema. This gives the Terraform type system the necessary information to populate a `types.Object` or `types.List` with a nested object.
In order to use the first 6 of these methods, the struct `T` needs to implement the [ModelWithAttributes](internal/util/types.go) interface which is ultimately populated from the attribute's Schema. This gives the Terraform type system the necessary information to populate a `types.Object` or `types.List` with a nested object.

### Preserving order in lists
Often time the order of elements in a list does not matter to the service. In this case one of the following helper functions should be used. These functions will get state list in sync with the remote list while preserving the order in the state when possible.
Expand Down
40 changes: 11 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Citrix has developed a custom Terraform provider for automating Citrix product d
- [Examples and Deployment Guides](#examples-and-deployment-guides)
- [Frequently Asked Questions](#frequently-asked-questions)
- [What resource is supported for different connection types?](#what-resource-is-supported-for-different-connection-types)
- [What provisioning types are supported for machine catalog?](#what-provisioning-types-are-supported-for-machine-catalog)
- [Attributions](#attributions)
- [License](#license)

Expand Down Expand Up @@ -115,7 +114,7 @@ Refer the [Hashicorp documentation](https://learn.hashicorp.com/tutorials/terraf

### (On-Premises Only) Enable Web Studio

For on-premises sites with version >= 2308 are supported. Web Studio needs to be [installed and configured](https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/install-configure/install-core/install-web-studio.html#install-web-studio-1) for the provider to work.
For on-premises sites with version >= 2311 are supported. Web Studio needs to be [installed and configured](https://docs.citrix.com/en-us/citrix-virtual-apps-desktops/install-configure/install-core/install-web-studio.html#install-web-studio-1) for the provider to work.

### Configure your Plugin for Terraform Provider for Citrix DaaS™

Expand Down Expand Up @@ -164,38 +163,21 @@ Detailed instructions on setting up deployments on different cloud providers fro
- [AWS EC2](https://community.citrix.com/tech-zone/build/deployment-guides/terraform-daas-aws/)
- [Azure](https://community.citrix.com/tech-zone/build/deployment-guides/citrix-daas-terraform-azure/)
- [GCP](https://community.citrix.com/tech-zone/build/deployment-guides/terraform-daas-gcp/)
- [vSphere](https://community.citrix.com/tech-zone/build/deployment-guides/terraform-daas-vsphere8/)

## Frequently Asked Questions

#### What resource is supported for different connection types?

| Connection Type | Hypervisor | Resource Pool | MCS Power Managed | MCS Provisioning | PVS |
|-----------------|------------------|------------------|---------------------|-------------------|------------------------|
| AzureRM |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|In Progress |
| AWS EC2 |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|:heavy_multiplication_x:|
| GCP |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|:heavy_multiplication_x:|
| Vsphere |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|:heavy_multiplication_x:|
| XenServer |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|:heavy_multiplication_x:|
| Nutanix |:heavy_check_mark:|:heavy_check_mark:| :heavy_check_mark: | :heavy_check_mark:|:heavy_multiplication_x:|
| SCVMM |In Progress |In Progress | In Progress | In Progress |:heavy_multiplication_x:|


#### What provisioning types are supported for machine catalog?
- MCS provisioning
- Azure
- GCP
- AWS EC2
- Vsphere
- XenServer
- Nutanix
- Manual Power Managed
- Azure
- GCP
- AWS EC2
- Vsphere
- XenServer
- Nutanix
- Manual / Remote PC
| Connection Type | Hypervisor | Resource Pool | MCS Power Managed | MCS Provisioning | PVS | Manual/Remote PC |
|------------------|--------------------|--------------------|----------------------|----------------------|--------------------------|----------------------|
| AzureRM |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: |
| AWS EC2 |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_multiplication_x: | :heavy_check_mark: |
| GCP |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_multiplication_x: | :heavy_check_mark: |
| vSphere |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_multiplication_x: | :heavy_check_mark: |
| XenServer |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_multiplication_x: | :heavy_check_mark: |
| Nutanix |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |:heavy_multiplication_x: | :heavy_check_mark: |
| SCVMM |:heavy_check_mark: |:heavy_check_mark: | :heavy_check_mark: | In Progress |:heavy_multiplication_x: | :heavy_check_mark: |

## Attributions
The code in this repository makes use of the following packages:
Expand Down
66 changes: 58 additions & 8 deletions StoreFront.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This Terraform module allows you to manage resources in Citrix StoreFront.
- [Terraform Module for Citrix StoreFront](#terraform-module-for-citrix-storefront)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
- [PowerShell Remoting on Storefront Remote Server](#powershell-remoting-on-storefront-remote-server)
- [Enable Remoting using HTTPS (recommended)](#enable-remoting-using-https-recommended)
- [Enable Remoting using HTTP](#enable-remoting-using-http)
- [Verification of Connectivity](#verification-of-connectivity)
- [Installation](#installation)
- [StoreFront configuration for provider](#storefront-configuration-for-provider)
- [Usage](#usage)
Expand All @@ -20,6 +24,52 @@ This Terraform module allows you to manage resources in Citrix StoreFront.
- The machine running the provider needs to be running on Windows 10+ or Server 2016+
- The machine running the provider needs WinRM access to the specified StoreFront server ([Microsoft docs on how to enable WinRM](https://learn.microsoft.com/en-us/troubleshoot/windows-server/remote/how-to-enable-windows-remote-shell))

## PowerShell Remoting on Storefront Remote Server

PowerShell Remoting uses Windows Remote Management (WinRM) to allow users to run PowerShell commands on remote computers. PowerShell Remoting (and WinRM) listen on the following ports:

- HTTP: 5985
- HTTPS: 5986

### Enable Remoting using HTTPS (recommended)

1. Open PowerShell as Administrator on the storefront remote server to run the following commands.
2. Enable PowerShell Remoting (WinRM):
* `Enable-PSRemoting -Force`
3. Create a self signed cert on the storefront remote server
* `$fqdn = [System.Net.Dns]::GetHostByName($env:computerName).HostName`
* `$Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName $fqdn`
* `Export-Certificate -Cert $Cert -FilePath 'C:\Users\Public\Desktop\exch.cer'`
4. Create a firewall rule he storefront remote server
* `New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Cert.Thumbprint -Force`
* `New-NetFirewallRule -DisplayName 'WinRM HTTPS-In' -Name 'WinRM HTTPS-In' -Profile Any -LocalPort 5986 -Protocol TCP`
5. Copy and install the new cert `exch.cer` created on the desktop on your local development server

### Enable Remoting using HTTP

1. Open PowerShell as Administrator on the storefront remote server to run the following commands.
2. Enable PowerShell Remoting (WinRM):
* `Enable-PSRemoting -Force`
3. Configure WinRM HTTPS Listener (Optional)
* `New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "Cert:\LocalMachine\My"`
* `$thumbprint = (Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -like "*localhost*"}).Thumbprint`
* `$cmd = "winrm create winrm/config/Listener?Address=*+Transport=HTTPS '@{Hostname=""localhost""; CertificateThumbprint=""$thumbprint""}'"`
* `Invoke-Expression $cmd`
4. Configure Firewall
* `New-NetFirewallRule -DisplayName "WinRM HTTP" -Name "WinRM-HTTP-In-TCP" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 5985 -Action Allow`
* `New-NetFirewallRule -DisplayName "WinRM HTTPS" -Name "WinRM-HTTPS-In-TCP" -Enabled True -Direction Inbound -Protocol TCP -LocalPort 5986 -Action Allow`
5. Now, Open PowerShell as Administrator on the local server(development machine) to run the following commands to add storefront server to trusted host
* `Enable-PSRemoting -Force`
* `Set-Item WSMan:\localhost\Client\TrustedHosts -Value <Public IP of Storefront Machine>`

### Verification of Connectivity

Open PowerShell as Administrator on your local development server and run the following commands to establish a remote PS Session
* `$securePass = ConvertTo-SecureString -Force -AsPlainText '<password>'`
* `$credential = New-Object System.Management.Automation.PSCredential ('<domain>\<username>', $securePass)`
* `Enter-PSSession -ConnectionUri http://<public_ip>:<5985/5986> -Credential $credential -SessionOption (New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck) -Authentication Negotiate`


## Installation

If running the StoreFront provider on a machine other than the machine where StoreFront is installed, please provide the Active Directory Admin credentials in either environment variables or provider configuration
Expand All @@ -30,7 +80,7 @@ If running the StoreFront provider on a machine other than the machine where Sto
- `SF_AD_ADMIN_PASSWORD`:
- The Active Directory Admin password to connect to the remote PowerShell of the StoreFront server machine.


~~~~
### StoreFront configuration for provider
```hcl
Expand All @@ -56,16 +106,16 @@ Example Usage of the StoreFront Terraform Configuration
### Create a deployment
```hcl
resource citrix_stf_deployment "testSTFDeployment" {
site_id = 1
resource "citrix_stf_deployment" "example-stf-deployment" {
site_id = "1"
host_base_url = "https://example3.storefront.com"
}
```
### Create an authentication service
```hcl
resource "citrix_stf_authentication_service" "example-stf-authentication-service" {
site_id = "${citrix_stf_deployment.testSTFDeployment.site_id}"
site_id = citrix_stf_deployment.example-stf-deployment.site_id
friendly_name = "Auth"
virtual_path = "/Citrix/Authentication"
}
Expand All @@ -74,10 +124,10 @@ resource "citrix_stf_authentication_service" "example-stf-authentication-service
### Create a store service
```hcl
resource "citrix_stf_store_service" "example-stf-store-service" {
site_id = "${citrix_stf_deployment.testSTFDeployment.site_id}"
site_id = citrix_stf_deployment.example-stf-deployment.site_id
virtual_path = "/Citrix/Store"
friendly_name = "Store"
authentication_service = "${citrix_stf_authentication_service.example-stf-authentication-service.virtual_path}"
authentication_service_virtual_path = "${citrix_stf_authentication_service.example-stf-authentication-service.virtual_path}"
farm_config = {
farm_name = "Controller"
farm_type = "XenDesktop"
Expand All @@ -89,10 +139,10 @@ resource "citrix_stf_store_service" "example-stf-store-service" {
### Create a webreceiver service
```hcl
resource "citrix_stf_webreceiver_service" "example-stf-webreceiver-service"{
site_id = "${citrix_stf_deployment.testSTFDeployment.site_id}"
site_id = citrix_stf_deployment.example-stf-deployment.site_id
virtual_path = "/Citrix/StoreWeb"
friendly_name = "Receiver2"
store_service = "${citrix_stf_store_service.example-stf-store-service.virtual_path}"
store_virtual_path = "${citrix_stf_store_service.example-stf-store-service.virtual_path}"
authentication_methods = [
"ExplicitForms",
]
Expand Down
43 changes: 43 additions & 0 deletions docs/data-sources/delivery_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_delivery_group Data Source - citrix"
subcategory: ""
description: |-
Read data of an existing delivery group.
---

# citrix_delivery_group (Data Source)

Read data of an existing delivery group.

## Example Usage

```terraform
data "citrix_delivery_group" "example_delivery_group" {
name = "exampleDeliveryGroupName"
}
```

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

### Required

- `name` (String) Name of the delivery group.

### Read-Only

- `id` (String) GUID identifier of the delivery group.
- `vdas` (Attributes List) The VDAs associated with the delivery group. (see [below for nested schema](#nestedatt--vdas))

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

Read-Only:

- `associated_delivery_group` (String) Delivery group which the VDA is associated with.
- `associated_machine_catalog` (String) Machine catalog which the VDA is associated with.
- `hosted_machine_id` (String) Machine ID within the hypervisor hosting unit.
- `machine_name` (String) Machine name of the VDA.


33 changes: 33 additions & 0 deletions docs/data-sources/hypervisor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_hypervisor Data Source - citrix"
subcategory: ""
description: |-
Read data of an existing hypervisor.
---

# citrix_hypervisor (Data Source)

Read data of an existing hypervisor.

## Example Usage

```terraform
# Get Hypervisor resource of any connection type by name
data "citrix_hypervisor" "azure-hypervisor" {
name = "azure-hyperv"
}
```

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

### Required

- `name` (String) Name of the hypervisor.

### Read-Only

- `id` (String) GUID identifier of the hypervisor.


Loading

0 comments on commit 754013e

Please sign in to comment.