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
4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 | |