Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class ModifyTargetGroupAttributesCommandProtected

Modifies the specified attributes of the specified target group.

Example

Use a bare-bones client and the command you need to make an API call.

import { ElasticLoadBalancingV2Client, ModifyTargetGroupAttributesCommand } from "@aws-sdk/client-elastic-load-balancing-v2"; // ES Modules import
// const { ElasticLoadBalancingV2Client, ModifyTargetGroupAttributesCommand } = require("@aws-sdk/client-elastic-load-balancing-v2"); // CommonJS import
const client = new ElasticLoadBalancingV2Client(config);
const input = { // ModifyTargetGroupAttributesInput
TargetGroupArn: "STRING_VALUE", // required
Attributes: [ // TargetGroupAttributes // required
{ // TargetGroupAttribute
Key: "STRING_VALUE",
Value: "STRING_VALUE",
},
],
};
const command = new ModifyTargetGroupAttributesCommand(input);
const response = await client.send(command);
// { // ModifyTargetGroupAttributesOutput
// Attributes: [ // TargetGroupAttributes
// { // TargetGroupAttribute
// Key: "STRING_VALUE",
// Value: "STRING_VALUE",
// },
// ],
// };

Param

ModifyTargetGroupAttributesCommandInput

Returns

ModifyTargetGroupAttributesCommandOutput

See

Throws

InvalidConfigurationRequestException (client fault)

The requested configuration is not valid.

Throws

TargetGroupNotFoundException (client fault)

The specified target group does not exist.

Throws

ElasticLoadBalancingV2ServiceException

Base exception class for all service exceptions from ElasticLoadBalancingV2 service.

Example

To modify the deregistration delay timeout

// This example sets the deregistration delay timeout to the specified value for the specified target group.
const input = {
"Attributes": [
{
"Key": "deregistration_delay.timeout_seconds",
"Value": "600"
}
],
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067"
};
const command = new ModifyTargetGroupAttributesCommand(input);
const response = await client.send(command);
/* response ==
{
"Attributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
},
{
"Key": "deregistration_delay.timeout_seconds",
"Value": "600"
},
{
"Key": "stickiness.type",
"Value": "lb_cookie"
},
{
"Key": "stickiness.lb_cookie.duration_seconds",
"Value": "86400"
}
]
}
*/
// example id: elbv2-modify-target-group-attributes-1

Hierarchy

Constructors

Properties

Methods