Generation

generate functionSat, 10 Dec 2022

Aws lambda to cordon and delete an eks node

import json import boto3 def lambda_handler(event, context): ec2 = boto3.client('ec2') # This deletes the node from the cluster response = ec2.terminate_instances( InstanceIds=[event['instanceId']] )

Want to kickstart your project?Use the new AI Studio to create your code