0
AWS 스택 세부 정보, 스택 ID, 각 스택의 레이어 수, 각 레이어의 인스턴스 수 및 파이썬 스크립트를 사용하는 태그를 가져오고 싶습니다. 나 좀 도와 줄래?aws 스택 레이어 인스턴스 및 태그의 세부 정보를 가져 오는 Python 스크립트
AWS 스택 세부 정보, 스택 ID, 각 스택의 레이어 수, 각 레이어의 인스턴스 수 및 파이썬 스크립트를 사용하는 태그를 가져오고 싶습니다. 나 좀 도와 줄래?aws 스택 레이어 인스턴스 및 태그의 세부 정보를 가져 오는 Python 스크립트
#!/usr/bin/python
import boto3
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
print ("\n")
st_name = raw_input("What is STACK_NAME name? :: ")
stack_name = boto3.client('opsworks')
stacs = stack_name.describe_stacks()
for st in stacs['Stacks']:
stname = st['Name']
if st_name == stname :
print bcolors.OKBLUE + ("\nSTACK ID FOR THIS STACK IS :: \n")
print bcolors.WARNING + st['StackId']
stid = st['StackId']
print bcolors.FAIL + (" \nLayers Attached with this STACK and their ID's are :")
print bcolors.ENDC
layr = stack_name.describe_layers(StackId=stid)
for lr in layr['Layers']:
print "LAYER NAME :: " + bcolors.OKGREEN +lr['Name'] + bcolors.ENDC + " LAYER ID is :: " + bcolors.OKBLUE + lr['LayerId']
샘플 출력 :
샘플 출력을 보려면 아래 링크를 확인하십시오. https://s17.postimg.org/l6fhb8uu7/Screen_Shot_2017-11-26_at_2.05.38_AM.png –
당신은 시도 무엇입니까? – Gammer