首页 > 解决方案 > 使用 boto 描述 Opsworks 堆栈的问题

问题描述

下面是我试图运行的简单代码片段,它给出了异常。我已经在本地配置了 AWS,并且能够在 AWS Opsworks UI 中描述相同的堆栈。有人可以在这里帮忙吗,可能是什么原因:

import boto3
client=boto3.client('opsworks')
response=client.describe_stack_summary(
    StackId="6efce529-0b77-43dc-981b-ff20b906c4ae"
)
print(response)

堆栈跟踪错误:

Traceback (most recent call last):
File "botoTest.py", line 9, in <module>
StackId="6efce529-0b77-43dc-981b-ff20b906c4ae"
File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- 
packages/botocore/client.py", line 320, in _api_call
return self._make_api_call(operation_name, kwargs)
File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site- 
packages/botocore/client.py", line 623, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.errorfactory.ResourceNotFoundException: An error occurred 
(ResourceNotFoundException) when calling the DescribeStackSummary 
operation: Unable to find stack with ID 6efce529-0b77-43dc-981b- 
ff20b906c4ae

标签: python-2.7boto3

解决方案


推荐阅读