IT/Python

IT/Python

[Python] Name Tag가 있는 인스턴스만 출력하기

AWS CLI V2로 테스트 한 코드 import boto3 import json ec2_client = boto3.client( 'ec2', aws_access_key_id = '**************', aws_secret_access_key = '*********************', region_name = 'ap-northeast-2' ) response = ec2_client.describe_instances() for reservation in response['Reservations']: for ec2 in reservation['Instances']: re_tags = {} if 'Tags' not in ec2: # Case) all tags removed #print(ec2["I..

Ersia
'IT/Python' 카테고리의 글 목록