如何将实例ID链接到EBS环境(例如使用boto):
(' EnvironmentId' param不是EC2 AMI ID)
def get_environment_instance(self, env_name):
"""
Returns the environment instance id
"""
response = self.ebs.describe_environments(application_name=self.app_name,environment_names=[env_name],include_deleted=False)
envs = response['DescribeEnvironmentsResponse']['DescribeEnvironmentsResult']['Environments']
for env in envs[:]:
out('---'+ env['EnvironmentId'])
return None
答案 0 :(得分:0)
我认为您需要describe_environment_resources
方法,而不是describe_environments
。这应该返回环境使用的所有AWS资源,包括所有EC2实例的实例ID。