Add a Physical Data Center connector
You can connect Harness to the physical data centers (PDCs) where you will deploy your services.
PDCs are typically used in traditional deployments, including Secure Shell (SSH) and WinRM.
Add a Physical Data Center connector
- YAML
- API
- Harness Manager
Here's an example of a PDC connector YAML:
connector:
name: PDC-Connector
identifier: PDCConnector
description: ""
orgIdentifier: default
projectIdentifier: CD_Docs
type: Pdc
spec:
hosts:
- hostname: ec2-54-111-26-183.us-west-2.compute.amazonaws.com
- hostname: ec2-54-222-142-249.us-west-2.compute.amazonaws.com
Create the PDC connector using the Create a Connector API.
curl --location --request POST 'https://app.harness.io/gateway/ng/api/connectors?accountIdentifier=123456' \
--header 'Content-Type: text/yaml' \
--header 'x-api-key: pat.123456.123456' \
--data-raw 'connector:
name: PDC-Connector
identifier: PDCConnector
description: ""
orgIdentifier: default
projectIdentifier: CD_Docs
type: Pdc
spec:
hosts:
- hostname: ec2-54-111-26-183.us-west-2.compute.amazonaws.com
- hostname: ec2-54-222-142-249.us-west-2.compute.amazonaws.com'
- In your project, org, or account, select Connectors, and then select New Connector.
- Select Physical Data Center.
- Enter a name for the connector and select Continue.
- Enter the target hosts manually or by using a JSON file. Both options are described in detail below.
- Select Continue.
- Select the Harness Delegate(s) you want to use to perform the connection, and then select Save and Continue.
Manually enter hosts
To manually enter hosts in the connector, add each host's domain name or IP address on a new line.
JSON hosts file
Here's an example of a JSON hosts file:
[
{
"hostname": "ec2-54-87-11-191.compute-1.amazonaws.com:5986",
"hostAttributes": {
"type": "node",
"region": "east",
"name": "node1",
"ip": "54.87.11.191"
}
},
{
"hostname": "ec2-3-83-219-167.compute-1.amazonaws.com:5986",
"hostAttributes": {
"type": "db",
"region": "east",
"name": "node2",
"ip": "3.83.219.167"
}
}
]
JSON host file details:
- The
hostname
andhostAttributes
properties are mandatory. - The
hostAttributes
property can have as many key-value pairs as you need. - When you select this PDC connector in an infrastructure definition, you can select Filter by host name or Filter by host attributes to select the host(s) for deployment.
- Specify the host attributes as a comma-separated list of
attribute:value
(for example,region:west,type:node
).
- Specify the host attributes as a comma-separated list of