Creating a Target Group for Ports 443, 32081, and 32080
In order for deployed products to correctly operate, you must set up target groups, and then a listener, for ports 443, 32081 and 32080.
- Using the Find Services search tool, locate and browse to the EC2 dashboard.
- In the left navigation panel, under Load Balancing, click Target Groups.
- On the Target Groups management page, click Create target group.
- On the Specify group details page, specify values for the following:
- Under Choose a target type, select Instances.
- Target group name: Choose a descriptive name for easier identification; for example srgdemo-443-tg.
- Protocol: Change to HTTPS.
- Port: Select 443.
- VPC: Select your VPC.
- Tags: (Optional) Add descriptive tags as desired.
- Health Checks: Under Health check protocol, select HTTPS. For path, specify /th/cmak.
- Click Next.
- On the Register Targets page, set values for the following:
- Available instances: Select your instances; do not select the bastion.
- Ports: For the selected instances, use the value you retrieved previously and recorded in the AWS worksheet as the
Node Port for Port 443.
- Click Include as pending below. All marked instances will be added to the list of pending instances.
- Click Create target group.
- 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, note its ARN in the AWS worksheet.
- Repeat Steps 1 through 9 for ports 32081.
- Repeat Steps 1 through 9 for ports 32080.
- Run the following command:
# aws elbv2 create-target-group \
--name <Target group 443 Name> \
--protocol HTTPS \
--port 443 --vpc-id <VPC ID> \
--health-check-protocol HTTPS \
--target-type instance
Where:
<Target group 443 Name>: Choose a descriptive name, such as srgdemo-443-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-443-tg --protocol HTTPS \ --port 443 --vpc-id vpc-0143197ca9bd9c117 \ --health-check-protocol HTTPS \ --target-type instance
{
"TargetGroups":[
{
"TargetGroupArn":"arn:aws:elasticloadbalancing:eu-central-1:115370811111:targetgroup/srgdemo-443-tg/6d30f1c7be588bb6",
"TargetGroupName":"srgdemo-443-tg",
"Protocol":"HTTPS",
"Port":443,
"VpcId":"vpc-0143197ca9bd9c117",
"HealthCheckProtocol":"HTTPS",
"HealthCheckPort":"traffic-port",
"HealthCheckEnabled":true,
"HealthCheckIntervalSeconds":30,
"HealthCheckTimeoutSeconds":5,
"HealthyThresholdCount":5,
"UnhealthyThresholdCount":2,
"HealthCheckPath":"/",
"Matcher":{
"HttpCode":"200"
},
"TargetType":"instance"
}
]
}
- From the output, record the value of
TargetGroupArnin your AWS worksheet. - Repeat Steps 1-2 for port 32081.
- Repeat Steps 1-2 for port 32080.
Tagging the Target Group (CLI)
Optionally, you can tag any newly-created target group for easier identification.
To tag the target group for port 443 using the CLI:
- Run the following command:
# aws elbv2 add-tags \
--resource-arns <Target group 443 ARN> \
--tags Key=owner,Value=<owner> - Repeat Step 1 for port 32081.
- Repeat Step 1 for port 32080.
Example:
# aws elbv2 add-tags \
--resource-arns arn:aws:elasticloadbalancing:eu-central-1:115370811111:targetgroup/srgdemo-443-tg/c0684be94405b6b7 \
--tags Key=owner,Value=srgdemo
Next Step: Adding Targets to the Target Group for Ports 443, 32081, and 32080