put_notification_configuration
¶
put_notification_configuration(
*,
config_overrides: Optional[AutoScalingClientConfig] = None,
auto_scaling_group_name: Optional[XmlStringMaxLen255] = None,
topic_arn: Optional[XmlStringMaxLen255] = None,
notification_types: Optional[AutoScalingNotificationTypes] = None,
) -> None
Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to the specified topic can have messages delivered to an endpoint such as a web server or an email address.
This configuration overwrites any existing configuration.
For more information, see Amazon SNS notification options for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
If you exceed your maximum limit of SNS topics, which is 10 per Auto Scaling group, the call fails.
Parameters:
-
auto_scaling_group_name(Optional[XmlStringMaxLen255], default:None) –The name of the Auto Scaling group.
-
topic_arn(Optional[XmlStringMaxLen255], default:None) –The Amazon Resource Name (ARN) of the Amazon SNS topic.
-
notification_types(Optional[AutoScalingNotificationTypes], default:None) –The type of event that causes the notification to be sent. To query the notification types supported by Amazon EC2 Auto Scaling, call the DescribeAutoScalingNotificationTypes API.
Raises:
-
LimitExceededFault–You have already reached a limit for your Amazon EC2 Auto Scaling resources (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
-
ResourceContentionFault–You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).
-
ServiceLinkedRoleFailure–The service-linked role is not yet ready for use.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To add an Auto Scaling notification This example adds the specified notification to the specified Auto Scaling group.
>>> client.put_notification_configuration(auto_scaling_group_name='my-auto-scaling-group', topic_arn='arn:aws:sns:us-west-2:123456789012:my-sns-topic', notification_types=['autoscaling:TEST_NOTIFICATION'])
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 | |