Created
June 23, 2021 00:43
-
-
Save fabiojwalter/2567b9201b35b34bf26f800c1c4fb488 to your computer and use it in GitHub Desktop.
AWS - Lambda - EC2 Stop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
region = 'us-west-2' | |
instances = ['i-091e60ababe060baa'] | |
def lambda_handler(event, context): | |
ec2 = boto3.client('ec2', region_name=region) | |
ec2.stop_instances(InstanceIds=instances) | |
print 'Desligando a Instancia: ' + str(instances) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment