## Kubernetes client using AWS Lambda A Kubernetes Java client implemented as an AWS Lambda function whose execution is triggered whenever an IAM user is added or removed from an IAM group. This is made possible using Amazon EventBridge, which is a serverless event bus service that makes it easy to deliver a stream of real-time data from the IAM service and route that data to targets such as AWS Lambda. ## Build Requirements ## Build and Installation Instructions To build the JAR file, type mvn clean followed by mvn package at the command line. Upload the JAR file to an S3 bucket. Update the JSON file createFunction.json specifying appropriate values for the following fields: Deploy the Lambda function with the following command: aws lambda create-function --cli-input-json file://createFunction.json ## Setup EventBridge Rule to Trigger Lambda Function Run the following set of commands to create an EventBridge rule that matches IAM event notifications and add the Lambda function as its target. EVENT_RULE_ARN=$(aws events put-rule --name IAMUserGroupRule --event-pattern "{\"source\":[\"aws.iam\"]}" --query RuleArn --output text) aws lambda add-permission \ --function-name K8sClientForIAMEvents \ --statement-id 'd6f44629-efc0-4f38-96db-d75ba7d06579' \ --action 'lambda:InvokeFunction' \ --principal events.amazonaws.com \ --source-arn $EVENT_RULE_ARN aws events put-targets --rule IAMUserGroupRule --targets file://lambdaTarget.json