PYTHON & AWS - Create EC2 Snapshots by AWS Lambda

Поділитися
Вставка
  • Опубліковано 2 лис 2024

КОМЕНТАРІ • 3

  • @pareshmarathe334
    @pareshmarathe334 2 роки тому

    Thank you so much Buddy..
    This tutorial is very helpful..

  • @arunmathuria321
    @arunmathuria321 3 роки тому

    Thanks for sharing . I need your help to fix this code
    import boto3
    ec = boto3.client('ec2', 'ap-south-1')
    ec2 = boto3.resource('ec2', 'ap-south-1')
    def lambda_handler(event, context):
    instance_ids = []
    reservations = ec.describe_instances().get('Reservations', [])
    for reservation in reservations:
    for instance in reservation['Instances']:
    Tags = {}
    for Tag in instance['Tags']:
    Tags[Tag['Key']] = Tag['Value']
    if not 'Patch Group' in Tags:
    print(instance['InstanceId'] + " does not have patch group tag")
    elif Tags['Patch Group'] in ['Prod', 'Dev', 'QA']:
    print(instance['InstanceId'] + " has not correct Patch Group Tag")

  • @arunmathuria321
    @arunmathuria321 3 роки тому

    how can we make it multi region