- Newest
- Most votes
- Most comments
The issue you're encountering is likely due to a typo in the attribute name used to retrieve insights from Amazon EKS clusters. Here's the corrected portion of your code
# Retrieve information about available updates
response_insights = eks.list_insights(
clusterName=cluster_name
)
available_updates = response_insights.get('insights', {}) # Corrected attribute name
In the response_insights.get('insights', {}) line, make sure to use 'insights' instead of 'insights '. The extra space in 'insights ' causes the attribute name to be incorrect, resulting in the error you're experiencing. With this correction, your Lambda function should be able to retrieve insights from Amazon EKS clusters successfully. Let me know if you encounter any further issues!
Hope it clarifies and if does I would appreciate answer to be accepted so that community can benefit for clarity, thanks ;)
I think I found the issue, when trying to see which version of boto3 the lambda function uses it shows version 1.27.1 and according to the changelogs as far as I have found the eks insights capability was added on the version 1.34.5... Can anyone tell me if I am correct? I'm still new to AWS and am not 100% certain
Are you looking only for resources that are able to be upgraded and send a message? You might have better luck with EventBridge and AWS Health Messages.
You could create an EventBridge rule for these types of messages and send those events to different services or endpoints. Depending on your required business logic, you could simplify your lambda to do some basic tasks, such as look up the business owner on a table, or if you store this data on the resource tags, you could read those tags and use this data to fwd to those folks using sns, or even a slack webhook.
A simple event bridge rule could look like the following. These events include the resource name and you would send these messages to an endpoint of your choice.
{
“source”: “aws.health”,
“detail”: {
“eventTypeCode”: [
“AWS_RDS_OPERATIONAL_NOTIFICATION”,
“AWS_RDS_PLANNED_LIFECYCLE_EVENT"
]
}
}
[1] Monitoring AWS Health events with Amazon EventBridge - https://docs.aws.amazon.com/health/latest/ug/cloudwatch-events-health.html.
[2] Monitoring AWS Health events with Amazon EventBridge - Creating an EventBridge rule for AWS Health - https://docs.aws.amazon.com/health/latest/ug/cloudwatch-events-health.html#creating-event-bridge-events-rule-for-aws-health
Relevant content
- Accepted Answerasked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Good eye, but sadly the issues still persists :(