Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batch api, gcp support #20

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Manage and deploy Citrix resources easily using the Citrix Terraform provider. T
provider "citrix" {
customer_id = ""
client_id = ""
client_secret = ""
# secret can be specified via the CITRIX_CLIENT_SECRET environment variable
}

# On-Premises Provider
provider "citrix" {
hostname = "10.0.0.6"
client_id = "foo.local\\admin"
client_secret = "foo"
# secret can be specified via the CITRIX_CLIENT_SECRET environment variable
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/daas_delivery_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resource "citrix_daas_delivery_group" "example-delivery-group" {
name = "example-delivery-group"
associated_machine_catalogs = [
{
machine_catalog = citrix_daas_machine_catalog.example-machine-catalog.id
machine_catalog = citrix_daas_machine_catalog.example-azure-mtsession.id
machine_count = 1
}
]
Expand Down
21 changes: 10 additions & 11 deletions docs/resources/daas_hypervisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ resource "citrix_daas_hypervisor" "example-gcp-hypervisor" {
name = "example-gcp-hypervisor"
connection_type = "GoogleCloudPlatform"
zone = "{Zone Id}"
project_name = "{GCP project name}"
service_account_id = "{GCP service account Id}"
service_account_credentials = "{GCP service account private key}"
}
Expand All @@ -56,16 +55,16 @@ resource "citrix_daas_hypervisor" "example-gcp-hypervisor" {

### Optional

- `active_directory_id` (String) Azure Active Directory ID. Required when connection type is AzureRM.
- `api_key` (String) The API key used to authenticate with the AWS APIs. Required when connection type is AWS.
- `application_id` (String) Application ID of the service principal used to access the Azure APIs. Required when connection type is AzureRM.
- `application_secret` (String, Sensitive) The Application Secret of the service principal used to access the Azure APIs. Required when connection type is AzureRM.
- `application_secret_expiration_date` (String) The expiration date of the application secret of the service principal used to access the Azure APIs. Format is YYYY-MM-DD.
- `aws_region` (String) AWS region to connect to. Required when connection type is AWS.
- `secret_key` (String, Sensitive) The secret key used to authenticate with the AWS APIs. Required when connection type is AWS.
- `service_account_credentials` (String, Sensitive) The JSON-encoded service account credentials used to access the Google Cloud APIs. Required when connection type is GCP.
- `service_account_id` (String) The service account ID used to access the Google Cloud APIs. Required when connection type is GCP.
- `subscription_id` (String) Azure Subscription ID. Required when connection type is AzureRM.
- `active_directory_id` (String) **[Azure: Required]** Azure Active Directory ID.
- `api_key` (String) **[AWS: Required]** The API key used to authenticate with the AWS APIs.
- `application_id` (String) **[Azure: Required]** Application ID of the service principal used to access the Azure APIs.
- `application_secret` (String, Sensitive) **[Azure: Required]** The Application Secret of the service principal used to access the Azure APIs.
- `application_secret_expiration_date` (String) **[Azure: Optional]** The expiration date of the application secret of the service principal used to access the Azure APIs. Format is YYYY-MM-DD.
- `aws_region` (String) **[AWS: Required]** AWS region to connect to.
- `secret_key` (String, Sensitive) **[AWS: Required]** The secret key used to authenticate with the AWS APIs.
- `service_account_credentials` (String, Sensitive) **[GCP: Required]** The JSON-encoded service account credentials used to access the Google Cloud APIs.
- `service_account_id` (String) **[GCP: Required]** The service account ID used to access the Google Cloud APIs.
- `subscription_id` (String) **[Azure: Required]** Azure Subscription ID.

### Read-Only

Expand Down
23 changes: 12 additions & 11 deletions docs/resources/daas_hypervisor_resource_pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,33 @@ Manages a hypervisor resource pool.
## Example Usage

```terraform
resource "citrix_daas_hypervisor_resource_pool" "example-azure-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-azure-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-azure-hypervisor.id
region = "East US"
virtual_network_resource_group = "{Resource Group Name}"
virtual_network = "{VNet name}"
subnet = [
subnets = [
"subnet 1",
"subnet 2"
]
}

resource "citrix_daas_hypervisor_resource_pool" "example-aws-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-aws-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-aws-hypervisor.id
subnet = [
subnets = [
"10.0.1.0/24",
]
virtual_network = "{VPC name}"
availability_zone = "us-east-2a"
}

resource "citrix_daas_hypervisor_resource_pool" "example-gcp-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-gcp-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-gcp-hypervisor.id
region = "us-east1"
subnet = [
subnets = [
"us-east1",
]
virtual_network = "{VPC name}"
Expand All @@ -57,11 +57,12 @@ resource "citrix_daas_hypervisor_resource_pool" "example-gcp-hypervisor-resource

### Optional

- `availability_zone` (String) The name of the availability zone resource to use for provisioning operations in this resource pool. Required when connection type is AWS.
- `project_name` (String) GCP Project name. Required when connection type is GCP.
- `region` (String) Cloud Region where the virtual network sits in. Required when connection type is Azure or GCP.
- `subnets` (List of String) List of subnets to allocate VDAs within the virtual network. Required when connection type is Azure or GCP.
- `virtual_network_resource_group` (String) The name of the resource group where the vnet resides. Required when connection type is Azure.
- `availability_zone` (String) **[AWS: Required]** The name of the availability zone resource to use for provisioning operations in this resource pool.
- `project_name` (String) **[GCP: Required]** GCP Project name.
- `region` (String) **[Azure, GCP: Required]** Cloud Region where the virtual network sits in.
- `shared_vpc` (Boolean) **[GCP: Optional]** Indicate whether the GCP Virtual Private Cloud is a shared VPC.
- `subnets` (List of String) **[Azure, GCP: Required]** List of subnets to allocate VDAs within the virtual network.
- `virtual_network_resource_group` (String) **[Azure: Required]** The name of the resource group where the vnet resides.

### Read-Only

Expand Down
73 changes: 60 additions & 13 deletions docs/resources/daas_machine_catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ resource "citrix_daas_machine_catalog" "example-azure-mtsession" {
session_support = "MultiSession"
provisioning_scheme = {
machine_config = {
hypervisor = citrix_daas_hypervisor.azure-hypervisor-1.id
hypervisor_resource_pool = citrix_daas_hypervisor_resource_pool.azure-hypervisor-resource-pool.id
hypervisor = citrix_daas_hypervisor.example-azure-hypervisor.id
hypervisor_resource_pool = citrix_daas_hypervisor_resource_pool.example-azure-hypervisor-resource-pool.id
service_offering = "Standard_D2_v2"
resource_group = "{Azure resource group name for image vhd}"
storage_account = "{Azure storage account name for image vhd}"
Expand All @@ -37,7 +37,7 @@ resource "citrix_daas_machine_catalog" "example-azure-mtsession" {
}
number_of_total_machines = 1
machine_account_creation_rules ={
naming_scheme = "multi-##"
naming_scheme = "az-multi-##"
naming_scheme_type ="Numeric"
domain = "{domain-fqdn}"
}
Expand All @@ -54,6 +54,41 @@ resource "citrix_daas_machine_catalog" "example-azure-mtsession" {
}
}
}

resource "citrix_daas_machine_catalog" "example-gcp-mtsession" {
name = "example-gcp-mtsession"
description = "Example multi-session catalog on GCP hypervisor"
zone = "{zone Id}"
service_account = "{domain-admin-account}"
service_account_password = "{domain-admin-password}"
allocation_type = "Random"
session_support = "MultiSession"
provisioning_scheme = {
storage_type = "pd-standard"
availability_zones = "{project name}:{region}:{availability zone1},{project name}:{region}:{availability zone2},..."
machine_config = {
hypervisor = citrix_daas_hypervisor.example-gcp-hypervisor.id
hypervisor_resource_pool = citrix_daas_hypervisor_resource_pool.example-gcp-hypervisor-resource-pool.id
machine_profile = "{Machine profile template VM name}"
master_image = "{Image template VM name}"
machine_snapshot = "{Image template VM snapshot name}"
}
number_of_total_machines = 1
machine_account_creation_rules = {
naming_scheme = "gcp-multi-##"
naming_scheme_type = "Numeric"
domain = "serenity.local"
}
writeback_cache = {
wbc_disk_storage_type = "Standard_LRS"
persist_wbc = true
persist_os_disk = true
persist_vm = true
writeback_cache_disk_size_gb = 127
storage_cost_saving = true
}
}
}
```

<!-- schema generated by tfplugindocs -->
Expand Down Expand Up @@ -91,9 +126,9 @@ Optional:

- `availability_zones` (String) The Azure Availability Zones containing provisioned virtual machines. Use a comma as a delimiter for multiple availability_zones.
- `network_mapping` (Attributes) Specifies how the attached NICs are mapped to networks. If this parameter is omitted, provisioned VMs are created with a single NIC, which is mapped to the default network in the hypervisor resource pool. If this parameter is supplied, machines are created with the number of NICs specified in the map, and each NIC is attached to the specified network. (see [below for nested schema](#nestedatt--provisioning_scheme--network_mapping))
- `storage_type` (String) Storage account type used for provisioned virtual machine disks on Azure. Storage account types include: Standard_LRS, StandardSSD_LRS and Premium_LRS. Only applicable to Azure hypervisor catalogs.
- `use_managed_disks` (Boolean) Indicate whether to use Azure managed disks for the provisioned virtual machine. Only applicable to Azure hypervisor catalogs.
- `vda_resource_group` (String) Designated resource group where the VDA VMs will be located on Azure.
- `storage_type` (String) **[Azure, GCP: Required]** Storage account type used for provisioned virtual machine disks on Azure / GCP.<br />Azure storage types include: `Standard_LRS`, `StandardSSD_LRS` and `Premium_LRS`.<br />GCP storage types include: `pd-standar`, `pd-balanced`, `pd-ssd` and `pd-extreme`.
- `use_managed_disks` (Boolean) **[Azure: Optional]** Indicate whether to use Azure managed disks for the provisioned virtual machine.
- `vda_resource_group` (String) **[Azure: Optional]** Designated resource group where the VDA VMs will be located on Azure.
- `writeback_cache` (Attributes) Write-back Cache config. Leave this empty to disable Write-back Cache. (see [below for nested schema](#nestedatt--provisioning_scheme--writeback_cache))

<a id="nestedatt--provisioning_scheme--machine_account_creation_rules"></a>
Expand All @@ -117,16 +152,28 @@ Required:

- `hypervisor` (String) Id of the hypervisor for creating the machines.
- `hypervisor_resource_pool` (String) Id of the hypervisor resource pool that will be used for provisioning operations.
- `master_image` (String) The name of the virtual machine snapshot or VM template that will be used. This identifies the hard disk to be used and the default values for the memory and processors.

Optional:

- `container` (String) The Azure Storage Account Container where the image VHD for creating machines is located. Only applicable to Azure VHD image blob.
- `image_ami` (String) AMI of the AWS image to be used as the template image for the machine catalog. Only applicable to AWS Hypervisor.
- `machine_profile` (String) The name of the virtual machine template that will be used to identify the default value for the tags, virtual machine size, boot diagnostics, host cache property of OS disk, accelerated networking and availability zone. Only applicable to GCP Hypervisor.
- `master_image` (String) The name of the virtual machine snapshot or VM template that will be used. This identifies the hard disk to be used and the default values for the memory and processors.
- `resource_group` (String) The Azure Resource Group where the image VHD for creating machines is located. Only applicable to Azure Hypervisor.
- `service_offering` (String) The VM Sku of a Cloud service offering to use when creating machines.
- `storage_account` (String) The Azure Storage Account where the image VHD for creating machines is located. Only applicable to Azure VHD image blob.
- `container` (String) **[Azure: Optional]** The Azure Storage Account Container where the image VHD for creating machines is located. Only applicable to Azure VHD image blob.
- `gallery_image` (Attributes) **[Azure: Optional]** Details of the Azure Image Gallery image to use for creating machines. Only Applicable to Azure Image Gallery image. (see [below for nested schema](#nestedatt--provisioning_scheme--machine_config--gallery_image))
- `image_ami` (String) **[AWS: Required]** AMI of the AWS image to be used as the template image for the machine catalog.
- `machine_profile` (String) **[GCP: Optional]** The name of the virtual machine template that will be used to identify the default value for the tags, virtual machine size, boot diagnostics, host cache property of OS disk, accelerated networking and availability zone. If not specified, the VM specified in master_image will be used as template.
- `machine_snapshot` (String) **[GCP: Optional]** The name of the virtual machine snapshot of a GCP VM that will be used as master image.
- `resource_group` (String) **[Azure: Required]** The Azure Resource Group where the image VHD for creating machines is located.
- `service_offering` (String) **[Azure, AWS: Required]** The VM Sku of a Cloud service offering to use when creating machines.
- `storage_account` (String) **[Azure: Optional]** The Azure Storage Account where the image VHD for creating machines is located. Only applicable to Azure VHD image blob.

<a id="nestedatt--provisioning_scheme--machine_config--gallery_image"></a>
### Nested Schema for `provisioning_scheme.machine_config.gallery_image`

Required:

- `definition` (String) The image definition for the image to be used in the Azure Image Gallery. Only applicable to Azure Image Gallery image.
- `gallery` (String) The Azure Image Gallery where the image for creating machines is located. Only applicable to Azure Image Gallery image.
- `version` (String) The image version for the image to be used in the Azure Image Gallery. Only applicable to Azure Image Gallery image.



<a id="nestedatt--provisioning_scheme--network_mapping"></a>
Expand Down
4 changes: 2 additions & 2 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
provider "citrix" {
customer_id = ""
client_id = ""
client_secret = ""
# secret can be specified via the CITRIX_CLIENT_SECRET environment variable
}

# On-Premises Provider
provider "citrix" {
hostname = "10.0.0.6"
client_id = "foo.local\\admin"
client_secret = "foo"
# secret can be specified via the CITRIX_CLIENT_SECRET environment variable
}
2 changes: 1 addition & 1 deletion examples/resources/citrix_daas_delivery_group/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ resource "citrix_daas_delivery_group" "example-delivery-group" {
name = "example-delivery-group"
associated_machine_catalogs = [
{
machine_catalog = citrix_daas_machine_catalog.example-machine-catalog.id
machine_catalog = citrix_daas_machine_catalog.example-azure-mtsession.id
machine_count = 1
}
]
Expand Down
1 change: 0 additions & 1 deletion examples/resources/citrix_daas_hypervisor/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ resource "citrix_daas_hypervisor" "example-gcp-hypervisor" {
name = "example-gcp-hypervisor"
connection_type = "GoogleCloudPlatform"
zone = "{Zone Id}"
project_name = "{GCP project name}"
service_account_id = "{GCP service account Id}"
service_account_credentials = "{GCP service account private key}"
}
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
resource "citrix_daas_hypervisor_resource_pool" "example-azure-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-azure-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-azure-hypervisor.id
region = "East US"
virtual_network_resource_group = "{Resource Group Name}"
virtual_network = "{VNet name}"
subnet = [
subnets = [
"subnet 1",
"subnet 2"
]
}

resource "citrix_daas_hypervisor_resource_pool" "example-aws-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-aws-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-aws-hypervisor.id
subnet = [
subnets = [
"10.0.1.0/24",
]
virtual_network = "{VPC name}"
availability_zone = "us-east-2a"
}

resource "citrix_daas_hypervisor_resource_pool" "example-gcp-hypervisor-resource_pool" {
resource "citrix_daas_hypervisor_resource_pool" "example-gcp-hypervisor-resource-pool" {
name = "example-hypervisor-resource-pool"
hypervisor = citrix_daas_hypervisor.example-gcp-hypervisor.id
region = "us-east1"
subnet = [
subnets = [
"us-east1",
]
virtual_network = "{VPC name}"
Expand Down
Loading
Loading