选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

将 DescribeNotificationConfigurations 与 CLI 配合使用 - AWS SDK 代码示例

文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

DescribeNotificationConfigurations 与 CLI 配合使用

以下代码示例演示如何使用 DescribeNotificationConfigurations

CLI
AWS CLI

示例 1:描述指定组的通知配置

此示例描述指定自动扩缩组的通知配置。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-asg

输出:

{ "NotificationConfigurations": [ { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" }, { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" } ] }

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的在您的 Auto Scaling 群组扩展时获取 Amazon EC2 SNS 通知

示例 1:描述指定数量的通知配置

要返回特定数量的通知配置,请使用 max-items 参数。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-auto-scaling-group \ --max-items 1

输出:

{ "NotificationConfigurations": [ { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" }, { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" } ] }

如果输出包含 NextToken 字段,可返回更多通知配置。要获取其他通知配置,请在后续调用中使用此字段的值和 starting-token 选项,如下所示。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-asg \ --starting-token Z3M3LMPEXAMPLE

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的在您的 Auto Scaling 群组扩展时获取 Amazon EC2 SNS 通知

PowerShell
用于 PowerShell

示例 1:此示例描述与指定自动扩缩组关联的通知操作。

Get-ASNotificationConfiguration -AutoScalingGroupName my-asg | format-list

输出

AutoScalingGroupName : my-asg NotificationType : auto-scaling:EC2_INSTANCE_LAUNCH TopicARN : arn:aws:sns:us-west-2:123456789012:my-topic AutoScalingGroupName : my-asg NotificationType : auto-scaling:EC2_INSTANCE_TERMINATE TopicARN : arn:aws:sns:us-west-2:123456789012:my-topic

示例 2:此示例描述与所有自动扩缩组关联的通知操作。

Get-ASNotificationConfiguration
AWS CLI

示例 1:描述指定组的通知配置

此示例描述指定自动扩缩组的通知配置。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-asg

输出:

{ "NotificationConfigurations": [ { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" }, { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" } ] }

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的在您的 Auto Scaling 群组扩展时获取 Amazon EC2 SNS 通知

示例 1:描述指定数量的通知配置

要返回特定数量的通知配置,请使用 max-items 参数。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-auto-scaling-group \ --max-items 1

输出:

{ "NotificationConfigurations": [ { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" }, { "AutoScalingGroupName": "my-asg", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" } ] }

如果输出包含 NextToken 字段,可返回更多通知配置。要获取其他通知配置,请在后续调用中使用此字段的值和 starting-token 选项,如下所示。

aws autoscaling describe-notification-configurations \ --auto-scaling-group-name my-asg \ --starting-token Z3M3LMPEXAMPLE

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的在您的 Auto Scaling 群组扩展时获取 Amazon EC2 SNS 通知

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。