Create a target group for your Network Load Balancer - Elastic Load Balancing

Create a target group for your Network Load Balancer

You register targets for your Network Load Balancer with a target group. By default, the load balancer sends requests to registered targets using the port and protocol that you specified for the target group. You can override this port when you register each target with the target group.

After you create a target group, you can add tags.

To route traffic to the targets in a target group, create a listener and specify the target group in the default action for the listener. For more information, see Listener rules.

You can add or remove targets from your target group at any time. For more information, see Register targets with your target group. You can also modify the health check settings for your target group. For more information, see Modify the health check settings of a target group.

New console

To create a target group using the new console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, under Load Balancing, choose Target Groups.

  3. Choose Create target group.

  4. For Choose a target type, select Instances to register targets by instance ID or IP addresses to register targets by IP address.

  5. For Target group name, enter a name for the target group. This name must be unique per Region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

  6. For Protocol, choose a protocol as follows:

    • If the listener protocol is TCP, choose TCP or TCP_UDP.

    • If the listener protocol is TLS, choose TCP or TLS.

    • If the listener protocol is UDP, choose UDP or TCP_UDP.

    • If the listener protocol is TCP_UDP, choose TCP_UDP.

  7. (Optional) For Port, modify the default value as needed.

  8. For VPC, select a virtual private cloud (VPC).

  9. In the Health checks section, modify the default settings as needed. For Advanced health check settings, choose the health check port, count, timeout, interval, and specify success codes. If health checks consecutively exceed the Unhealthy threshold count, the load balancer takes the target out of service. If health checks consecutively exceed the Healthy threshold count, the load balancer puts the target back in service. For more information, see Health checks for your target groups.

  10. (Optional) Add one or more tags as follows:

    1. Expand the Tags section.

    2. Choose Add tag.

    3. Enter the tag Key and Value. Allowed characters are letters, spaces, numbers (in UTF-8), and the following special characters: + - = . _ : / @. Do not use leading or trailing spaces. Tag values are case-sensitive.

  11. Choose Next.

  12. In the Register targets page, add one or more targets as follows:

    • If the target type is Instances, select one or more instances, enter one or more ports, and then choose Include as pending below.

    • If the target type is IP addresses, select the network, enter the IP address and ports, and then choose Include as pending below.

  13. Choose Create target group.

Old console

To create a target group using the old console

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, under Load Balancing, choose Target Groups.

  3. Choose Create target group.

  4. For Target group name, enter a name for the target group. This name must be unique per Region per account, can have a maximum of 32 characters, must contain only alphanumeric characters or hyphens, and must not begin or end with a hyphen.

  5. For Protocol, choose a protocol as follows:

    • If the listener protocol is TCP, choose TCP or TCP_UDP.

    • If the listener protocol is TLS, choose TCP or TLS.

    • If the listener protocol is UDP, choose UDP or TCP_UDP.

    • If the listener protocol is TCP_UDP, choose TCP_UDP.

  6. (Optional) For Port, modify the default value as needed.

  7. For Target type, select instance to specify targets by instance ID or ip to specify targets by IP address.

  8. For VPC, select a virtual private cloud (VPC).

  9. (Optional) For Health check settings and Advanced health check settings, modify the default settings as needed. Choose Create.

  10. (Optional) Add one or more tags as follows:

    1. Select the newly created target group.

    2. Choose Tags, Add/Edit Tags.

    3. On the Add/Edit Tags page, for each tag that you add, choose Create Tag and then specify the tag key and tag value. When you have finished adding tags, choose Save.

  11. (Optional) To add targets to the target group, see Register targets with your target group.

  12. (Optional) You can specify the target group in the default listener rule. For more information, see Create a Listener and Update a Listener.

To create a target group using the AWS CLI

Use the create-target-group command to create the target group, the add-tags command to tag your target group, and the register-targets command to add targets.