選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

AttachTrafficSources - Amazon EC2 Auto Scaling
此頁面尚未翻譯為您的語言。 請求翻譯

AttachTrafficSources

Attaches one or more traffic sources to the specified Auto Scaling group.

You can use any of the following as traffic sources for an Auto Scaling group:

  • Application Load Balancer

  • Classic Load Balancer

  • Gateway Load Balancer

  • Network Load Balancer

  • VPC Lattice

This operation is additive and does not detach existing traffic sources from the Auto Scaling group.

After the operation completes, use the DescribeTrafficSources API to return details about the state of the attachments between traffic sources and your Auto Scaling group. To detach a traffic source from the Auto Scaling group, call the DetachTrafficSources API.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

AutoScalingGroupName

The name of the Auto Scaling group.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 255.

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: Yes

SkipZonalShiftValidation

If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify true. For more information, see Auto Scaling group zonal shift in the Amazon EC2 Auto Scaling User Guide.

Type: Boolean

Required: No

TrafficSources.member.N

The unique identifiers of one or more traffic sources. You can specify up to 10 traffic sources.

Type: Array of TrafficSourceIdentifier objects

Required: Yes

Errors

For information about the errors that are common to all actions, see Common Errors.

ResourceContention

You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).

HTTP Status Code: 500

ServiceLinkedRoleFailure

The service-linked role is not yet ready for use.

HTTP Status Code: 500

Examples

Example

This example attaches two VPC Lattice target groups, as specified by their ARNs, to the Auto Scaling group named my-asg.

Sample Request

https://autoscaling.amazonaws.com/?Action=AttachTrafficSources &AutoScalingGroupName=my-asg &TrafficSources.member.1.Identifier=arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-0e2f2665eEXAMPLE &TrafficSources.member.2.Identifier=arn:aws:vpc-lattice:us-west-2:123456789012:targetgroup/tg-8360a9e72EXAMPLE &Version=2011-01-01 &AUTHPARAMS

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。