Skip to content

Commit

Permalink
release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yashbhokare-citrix committed Aug 8, 2024
1 parent 9edc15c commit ae8c975
Show file tree
Hide file tree
Showing 257 changed files with 8,758 additions and 3,056 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Plugin for Terraform Provider for Citrix®

Citrix has developed a custom Terraform provider for automating Citrix product deployments and configurations. Using [Terraform](https://www.terraform.io) with Citrix provider, you can manage your Citrix products via Infrastructure as Code, giving you higher efficiency and consistency on infrastructure management, as well as better reusability on infrastructure configuration. The provider is developed and maintained by Citrix. Please note that this provider is still in tech preview.
Citrix has developed a custom Terraform provider for automating Citrix product deployments and configurations. Using [Terraform](https://www.terraform.io) with Citrix provider, you can manage your Citrix products via Infrastructure as Code, giving you higher efficiency and consistency on infrastructure management, as well as better reusability on infrastructure configuration. The provider is developed and maintained by Citrix.

## Table of Contents
- [Plugin for Terraform Provider for Citrix®](#plugin-for-terraform-provider-for-citrix)
Expand Down Expand Up @@ -55,19 +55,23 @@ Example for on-premises site:

```hcl
provider "citrix" {
hostname = "10.71.136.250" # Optionally set with `CITRIX_HOSTNAME` environment variable.
client_id = "${var.domain_admin_id}" # Optionally set with `CITRIX_CLIENT_ID` environment variable.
client_secret = "${var.domain_admin_secret}" # Optionally set with `CITRIX_CLIENT_SECRET` environment variable.
cvad_config = {
hostname = "10.71.136.250" # Optionally set with `CITRIX_HOSTNAME` environment variable.
client_id = "${var.domain_admin_id}" # Optionally set with `CITRIX_CLIENT_ID` environment variable.
client_secret = "${var.domain_admin_secret}" # Optionally set with `CITRIX_CLIENT_SECRET` environment variable.
}
}
```

Example for Cloud site:

```hcl
provider "citrix" {
customer_id = "${var.customer_id}" # Optionally set with `CITRIX_CUSTOMER_ID` environment variable.
client_id = "${var.api_key_clientId}" # Optionally set with `CITRIX_CLIENT_ID` environment variable.
client_secret = "${var.api_key_clientSecret}" # Optionally set with `CITRIX_CLIENT_SECRET` environment variable.
cvad_config = {
customer_id = "${var.customer_id}" # Optionally set with `CITRIX_CUSTOMER_ID` environment variable.
client_id = "${var.api_key_clientId}" # Optionally set with `CITRIX_CLIENT_ID` environment variable.
client_secret = "${var.api_key_clientSecret}" # Optionally set with `CITRIX_CLIENT_SECRET` environment variable.
}
}
```

Expand Down
127 changes: 57 additions & 70 deletions StoreFront.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ 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)
- [PowerShell Remoting on StoreFront Remote Server](#powershell-remoting-on-storefront-remote-server)
- [Enable Remoting using HTTPS (recommended)](#enable-remoting-using-https-recommended)
- [Verification of Connectivity](#verification-of-connectivity)
- [Installation](#installation)
- [StoreFront configuration for provider](#storefront-configuration-for-provider)
- [Usage](#usage)
- [Provider Block](#provider-block)
- [Resource Block](#resource-block)
- [Create a deployment](#create-a-deployment)
- [Create an authentication service](#create-an-authentication-service)
- [Create a store service](#create-a-store-service)
Expand All @@ -21,17 +20,18 @@ This Terraform module allows you to manage resources in Citrix StoreFront.
## Prerequisites

- Terraform 0.14.x
- The provider needs to either run locally on the StoreFront server, or have WinRM access to it. In the latter case follow the instructions in the next section to config WinRM on StoreFront Remote Server.

### PowerShell Remoting on StoreFront Remote Server
- 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)
#### 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):
Expand All @@ -40,38 +40,30 @@ PowerShell Remoting uses Windows Remote Management (WinRM) to allow users to run
* `$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
4. Create a firewall rule on the 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
#### 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`
* `Enter-PSSession -ConnectionUri https://<public_ip>:5986 -Credential $credential -Authentication Negotiate`


## Installation

### Provider Block
If running the StoreFront provider on storefront locally
~~~~
provider "citrix" {
storefront_remote_host = {
}
}
~~~~

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
- `SF_COMPUTER_NAME`:
- The name of the remote computer where the StoreFront server is running.
Expand All @@ -81,77 +73,72 @@ If running the StoreFront provider on a machine other than the machine where Sto
- The Active Directory Admin password to connect to the remote PowerShell of the StoreFront server machine.

~~~~
### StoreFront configuration for provider
```hcl
provider "citrix" {
hostname =
customer_id =
environment =
client_id =
client_secret =
disable_ssl_verification =
storefront_remote_host = {
computer_name = "{Name of the remote computer where the StoreFront located}"
computer_name = "{public IP of the storefront VM}" //
ad_admin_username ="{Active Directory Admin Username}"
ad_admin_password ="{Active Directory Admin Password}"
}
}
```
~~~~

## Usage
### Resource Block
~~~~
Example Usage of the StoreFront Terraform Configuration
### Create a deployment
```hcl
### Create a deployment
resource "citrix_stf_deployment" "example-stf-deployment" {
site_id = "1"
host_base_url = "https://example3.storefront.com"
host_base_url = "http://<localhost name>"
}
```
### Create an authentication service
```hcl
resource "citrix_stf_authentication_service" "example-stf-authentication-service" {
site_id = citrix_stf_deployment.example-stf-deployment.site_id
friendly_name = "Auth"
virtual_path = "/Citrix/Authentication"
depends_on = [ citrix_stf_deployment.example-stf-deployment ] //Required dependency
}
```
### Create a store service
```hcl
resource "citrix_stf_store_service" "example-stf-store-service" {
site_id = citrix_stf_deployment.example-stf-deployment.site_id
virtual_path = "/Citrix/Store"
friendly_name = "Store"
authentication_service_virtual_path = "${citrix_stf_authentication_service.example-stf-authentication-service.virtual_path}"
farm_config = {
farm_name = "Controller"
farm_type = "XenDesktop"
servers = ["cvad.storefront.com"]
}
pna = {
enable = true
}
farms = [
{
farm_name = "Controller1"
farm_type = "XenDesktop"
servers = ["cvad.storefront.com"]
port = 80
},
{
farm_name = "Controller2"
farm_type = "XenDesktop"
servers = ["cvad.storefront2.com"]
port = 443
zones = ["Primary"]
}
]
// Add depends_on attribute to ensure the StoreFront Store with Authentication is created after the Authentication Service
depends_on = [ citrix_stf_authentication_service.example-stf-authentication-service ]
}
```
### Create a webreceiver service
```hcl
resource "citrix_stf_webreceiver_service" "example-stf-webreceiver-service"{
site_id = citrix_stf_deployment.example-stf-deployment.site_id
virtual_path = "/Citrix/StoreWeb"
friendly_name = "Receiver2"
virtual_path = "/Citrix/StoreWeb"
friendly_name = "ReceiverWeb"
store_virtual_path = "${citrix_stf_store_service.example-stf-store-service.virtual_path}"
authentication_methods = [
"ExplicitForms",
]
plugin_assistant = {
enabled = true
html5_single_tab_launch = true
upgrade_at_login = true
html5_enabled = "Off"
}
}
```
depends_on = [ citrix_stf_store_service.example-stf-store-service ]
}
6 changes: 2 additions & 4 deletions docs/data-sources/admin_scope.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_admin_scope Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Data source to get details regarding a specific Administrator scope.
---
Expand Down Expand Up @@ -39,6 +39,4 @@ data "citrix_admin_scope" "test_scope_by_id" {
- `is_built_in` (Boolean) Indicates whether the Admin Scope is built-in or not.
- `is_tenant_scope` (Boolean) Indicates whether the Admin Scope is tenant scope or not.
- `tenant_id` (String) ID of the tenant to which the Admin Scope belongs.
- `tenant_name` (String) Name of the tenant to which the Admin Scope belongs.


- `tenant_name` (String) Name of the tenant to which the Admin Scope belongs.
6 changes: 2 additions & 4 deletions docs/data-sources/application_folder_details.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_application_folder_details Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Data source for retrieving details of applications belonging to a specific folder.
---
Expand Down Expand Up @@ -43,6 +43,4 @@ Read-Only:

- `command_line_arguments` (String) The command-line arguments to use when launching the executable. Environment variables can be used.
- `command_line_executable` (String) The name of the executable file to launch. The full path need not be provided if it's already in the path. Environment variables can also be used.
- `working_directory` (String) The working directory which the executable is launched from. Environment variables can be used.


- `working_directory` (String) The working directory which the executable is launched from. Environment variables can be used.
6 changes: 2 additions & 4 deletions docs/data-sources/delivery_group.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_delivery_group Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Read data of an existing delivery group.
---
Expand Down Expand Up @@ -38,6 +38,4 @@ 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.


- `machine_name` (String) Machine name of the VDA.
6 changes: 2 additions & 4 deletions docs/data-sources/hypervisor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_hypervisor Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Read data of an existing hypervisor.
---
Expand All @@ -28,6 +28,4 @@ data "citrix_hypervisor" "azure-hypervisor" {

### Read-Only

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


- `id` (String) GUID identifier of the hypervisor.
6 changes: 2 additions & 4 deletions docs/data-sources/hypervisor_resource_pool.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_hypervisor_resource_pool Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Read data of an existing hypervisor resource pool.
---
Expand Down Expand Up @@ -31,6 +31,4 @@ data "citrix_hypervisor_resource_pool" "azure-resource-pool" {
### Read-Only

- `id` (String) GUID identifier of the hypervisor resource pool.
- `networks` (List of String) Networks available in the hypervisor resource pool.


- `networks` (List of String) Networks available in the hypervisor resource pool.
12 changes: 8 additions & 4 deletions docs/data-sources/machine_catalog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_machine_catalog Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
Read data of an existing machine catalog.
---
Expand All @@ -10,7 +10,13 @@ description: |-

Read data of an existing machine catalog.

## Example Usage

```terraform
data "citrix_machine_catalog" "example_machine_catalog" {
name = "example-catalog"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -32,6 +38,4 @@ 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.


- `machine_name` (String) Machine name of the VDA.
6 changes: 2 additions & 4 deletions docs/data-sources/pvs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "citrix_pvs Data Source - citrix"
subcategory: ""
subcategory: "CVAD"
description: |-
PVS Configuration to create machine catalog using PVSStreaming.
---
Expand Down Expand Up @@ -34,6 +34,4 @@ data "citrix_pvs" "example_pvs_config" {
### Read-Only

- `pvs_site_id` (String) Id of the PVS site.
- `pvs_vdisk_id` (String) Id of the PVS vDisk.


- `pvs_vdisk_id` (String) Id of the PVS vDisk.
Loading

0 comments on commit ae8c975

Please sign in to comment.