1 個回答
- 最新
- 最多得票
- 最多評論
0
What about triggering the connection in the Systems Manager session manager to start Lambda?
This would allow us to run Lambda and launch EC2 when Amazon EventBridge detects a session manager event.
Below is an example of an Amazon EventBridge event pattern.
{
"source": ["aws.ssm"],
"detail-type": ["AWS API Call via CloudTrail"],
"detail": {
"eventSource": ["ssm.amazonaws.com"],
"eventName": ["StartSession"],
"requestParameters": {
"target": ["EC2 ID"]
}
}
}
Another possibility would be to enable VPC flow logging and use CloudWatch Logs subscription filters to share logs to Lambda when there is an SSH connection.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters.html#LambdaFunctionExample
Please refer to the example in the following document for the Lambda function to be used for startup.
https://repost.aws/knowledge-center/start-stop-lambda-eventbridge
相關內容
- 已提問 1 年前
- 已提問 7 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前