2016-09-12 3 views
0

AWS 인프라 자동화에 Python을 사용하고 있습니다. 내가 API가 제공하는 국도 표에 부착 된 자원을 얻을 필요가 응답의 반환 형식은 빈리스트를 나에게 모든 시간을주고 여기에경로 테이블에 첨부 된 리소스를 가져올 수 없습니다.

ec2 = boto3.resource('ec2') 
route_table_association = ec2.RouteTableAssociation('rtb-**********') 
response=route_table_association.get_available_subresources() 

입니다. 명시 적으로

+0

필수 ID는 라우팅 테이블 ID가 아닌 연관 ID입니다. 교차 확인하고 다시 시도하십시오. – Ali

+0

boto3을 사용하고 있습니다. 왜 botocore 태그입니까? – Skaperen

답변

0

필요한 ID RouteTableAssociationId i.e. rtbassoc-xxxxxx, 하지 경로 테이블의 ID 있습니다 response=route_table_association.delete() 예외

An error occurred (InvalidAssociationID.NotFound) when calling the `DisassociateRouteTable operation: The association ID 'rtb-*********' does not exist.` 

에게 제공하지만, 경로 tebale이 존재하고 서브넷에 연결되어 있습니다.

RouteTableAssociationId가 describe_route_tables 응답 JSON '연결'요소 안에 있습니다.

{ 
    'RouteTables': [ 
     { 
      'RouteTableId': 'string', 
      'VpcId': 'string', 
      'Routes': [ 
       {....} 
      ], 
      'Associations': [ 
       { 
        'RouteTableAssociationId': 'string', 
        'RouteTableId': 'string', 
        'SubnetId': 'string', 
        'Main': True|False 
       }, 
      ], 
..... 
} 
0

감사합니다. 저에게 도움이되었습니다.

response = client.describe_route_tables(
    RouteTableIds=[ 
     routetable, 
    ], 
    Filters=[ 
     { 
      'Name': 'route-table-id', 
      'Values': [ 
       routetable 
      ] 
     } 
    ] 
) 
관련 문제