Citrix Cloud Direct



downloadWhy can't I download this file?,à Put proxy IP
[string]$port='8888',à Proxy port
[string]$awsEndPoint='https://ec2.us-east-1.amazonaws.com',à Put the region specific global endpoint URL
[string]$hypConnName='AWSConnection', à Connection name
[string]$apiKey='xxxxxxxxxxx', à API Key
[string]$secretKey='xxxxxxxxxxxxxxxxxxxxxxx',à Secret Key
[string]$resourceLocation='Divesh-AWS-Citrix' à Resource location name
)
Add-PSSnapinCitrix.*
$hypTypeDirect='AWS'
# Setup the metadata entry for the proxy host and port that you are intending to use.
$options='ProxyHost=$server,ProxyPort=$port'
$secureSecretKey=ConvertTo-SecureStringDirect-String$secretKey-AsPlainText-Force
# getting our resource location identifier so this connection knows where to go for xdhyp provider
$zoneUid= (Get-ConfigZone|Where-ObjectName-EQ'$resourceLocation').Uid
$hypHc=New-Item-Pathxdhyp:Connections `
-Name$hypConnName `
-HypervisorAddressCloud$awsEndPoint `
-UserName$apiKey `
-SecurePassword$secureSecretKey `
-ConnectionType$hypType `
-Metadata @{ 'Citrix_MachineManagement_Options'=$options } `
-CustomProperties' `
-Persist `
-ZoneUid$zoneUid
$bhc=New-BrokerHypervisorConnection-HypHypervisorConnectionUid$hypHc.HypervisorConnectionUid
  • After making the changes, DDC hosting unit should get entries for proxy server and port number.

Problem Cause

  • When adding hosting connection on Citrix cloud DDC, AWS connector instance tries to resolve the AWS EC2 global endpoints directly by sending the traffic to public IP’s of AWS global endpoints for ec2 service.
  • Due to which connector server was not able reach the hosting connection URL and failed to add the hosting unit.
  • Collecting Wireshark/fiddler logs showed that TCP Port 443 traffic intended for ec2.amazonaws.com is going to public IP address of the website, instead of going via proxy server.
  • Running this script forces the connector server to send the traffic intended EC2 public endpoints via proxy.
  • Apart from AWS global endpoints, other URL’s go via proxy server.

Ref: https://aws.amazon.com/blogs/aws/new-aws-privatelink-endpoints-kinesis-ec2-systems-manager-and-elb-apis-in-your-vpc/

Additional Resources

Disclaimer

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.
downloadCCCCv1.2.zipWhy can't I download this file?