Open topic with navigation

# Creating a Target Group for Port 5443

To create the target group for port 5443 using the web UI:

1. Using the Find Services search tool, locate and browse to the EC2 dashboard.
2. In the left navigation panel, under Load Balancing, click Target Groups.
3. On the Target Groups management page, click Create target group.

1. On the Specify group details page, enter values for the following:
   1. Under Choose a target type, select Instances.
   2. Target group name: Choose a descriptive name for easier identification; for example, srgdemo-5443-tg
   3. Protocol: change to HTTPS
   4. Port: 5443
   5. VPC: select your VPC
   6. Tags: Optionally, add descriptive tags as desired.
   7. Health Checks: Under Health check protocol, select HTTPS. For path, specify /th/cmak.

1. Click Next.
2. On the Register Targets page, set values for the following:
   1. Available instances: Select your worker node instances only.
   2. Ports for the selected instances: For the selected instances, use the value you retrieved previously and recorded on the AWS worksheet as `Node Port for Port 5443`.

1. Click Include as pending below. All marked instances will be added to the list of pending instances.

1. Click Create target group.
2. You will be redirected back to the target group management page. From the list, select the newly created target group. From the bottom of the page, record its ARN in the AWS worksheet.

To create the target group for port 5443 using the CLI:

1. Run the following command:
   `# aws elbv2 create-target-group \
   --name` <Target group 5443 Name>`\
   --protocol HTTPS \
   --port` `5443``\
   --vpc-id <VPC ID> \
   --health-check-protocol HTTPS \
   --target-type instance`

Parameters:

<Target group 5443 Name>: Choose some descriptive name, such as `srgdemo-<PORT_NUMBER>-tg` and record the value in the AWS worksheet.

<VPC ID>: The ID of your VPC as recorded in your AWS worksheet.

Example input and output:

    # aws elbv2 create-target-group \
    --name srgdemo-5443-tg \
    --protocol HTTPS \
    --port 5443 \
    --vpc-id vpc-0143197ca9bd9c117 \
    --health-check-protocol HTTPS \
    --target-type instance

    {
       "TargetGroups":[
          {
             "TargetGroupArn":"arn:aws:elasticloadbalancing:eu-central-\1:115370848038:targetgroup/srgdemo-3000-tg/c0684be94405b6b7",
             "TargetGroupName":"srgdemo-5443-tg",
             "Protocol":"HTTPS",
             "Port":5443,
             "VpcId":"vpc-0143197ca9bd9c117",
             "HealthCheckProtocol":"HTTPS",
             "HealthCheckPort":"traffic-port",
             "HealthCheckEnabled":true,
             "HealthCheckIntervalSeconds":30,
             "HealthCheckTimeoutSeconds":5,
             "HealthyThresholdCount":5,
             "UnhealthyThresholdCount":2,
             "HealthCheckPath":"/",
             "Matcher":{
                "HttpCode":"200"
             },
             "TargetType":"instance"
          }
       ]
    }

1. From the output, record the value of `TargetGroupArn` in your AWS worksheet.

## Tagging the Target Group (CLI)

Optionally, you can tag the target group for easier identification.

To tag the target group using the CLI:

1. Run the following command:
   `# aws elbv2 add-tags \
   --resource-arns <Target group 5443 ARN> \
   --tags Key=owner,Value=<owner>`

    # aws elbv2 add-tags \
    --resource-arns arn:aws:elasticloadbalancing:eu-central-1:115370848038:targetgroup/srgdemo-5443-tg/c0684be94405b6b7 \
    --tags Key=owner,Value=srgdemo

Next Step: Add Targets to the Target Group for Port 5443