put_notification_configuration

put_notification_configuration(**kwargs)

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 Getting Amazon SNS notifications when your Auto Scaling group scales 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.

See also: AWS API Documentation

Request Syntax

response = client.put_notification_configuration(
    AutoScalingGroupName='string',
    TopicARN='string',
    NotificationTypes=[
        'string',
    ]
)
Parameters
  • AutoScalingGroupName (string) --

    [REQUIRED]

    The name of the Auto Scaling group.

  • TopicARN (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the Amazon SNS topic.

  • NotificationTypes (list) --

    [REQUIRED]

    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.

    • (string) --
Returns

None

Exceptions

  • AutoScaling.Client.exceptions.LimitExceededFault
  • AutoScaling.Client.exceptions.ResourceContentionFault
  • AutoScaling.Client.exceptions.ServiceLinkedRoleFailure

Examples

This example adds the specified notification to the specified Auto Scaling group.

response = client.put_notification_configuration(
    AutoScalingGroupName='my-auto-scaling-group',
    NotificationTypes=[
        'autoscaling:TEST_NOTIFICATION',
    ],
    TopicARN='arn:aws:sns:us-west-2:123456789012:my-sns-topic',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}