boto3
boto3 copied to clipboard
Impossible to create Resources form Cloudformation resource Summaries
There is a bug in the implementation of the cloud formation StackResourceSummary class which prevents the creation of StackResources by calling the Resource() sub-resource:
stack = cloudformation.Stack('MyStack') resource_summary = list(stack.resource_summaries.all())[0] resource_summary.dict {'meta': ResourceMeta('cloudformation', identifiers=['stack_name', 'logical_id']), '_logical_id': 'Aurora', '_stack_name': 'MyStack'} resource = list(stack.resource_summaries.all())[0].Resource() resource.dict {'meta': ResourceMeta('cloudformation', identifiers=['stack_name', 'logical_id']), '_stack_name': 'MyStack', '_logical_id': 'Aurora'}
stack_name and logical_id have been switched
resource.load() Traceback (most recent call last): File "
", line 1, in File "/home/matteo/.local/lib/python3.6/site-packages/boto3/resources/factory.py", line 505, in do_action response = action(self, *args, **kwargs) File "/home/matteo/.local/lib/python3.6/site-packages/boto3/resources/action.py", line 83, in call response = getattr(parent.meta.client, operation_name)(**params) File "/home/matteo/.local/lib/python3.6/site-packages/botocore/client.py", line 272, in _api_call return self._make_api_call(operation_name, kwargs) File "/home/matteo/.local/lib/python3.6/site-packages/botocore/client.py", line 576, in _make_api_call raise error_class(parsed_response, operation_name) botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the DescribeStackResource operation: Stack 'Aurora' does not exist
Thank you for your post. I am able to reproduce the issue. Marking this as a bug.
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.
Reopening on behalf of @dhx-mike-palandra, reported this is still an issue in #2828. I will check in with the CloudFormation team on this. Thanks!
Thank you very much @kdaily. I just submitted another closely related issue: #2855. Since that issue involves the same model definition, and is even more essential for a properly functioning class at runtime, please consider checking in with the CloudFormation team about that one too.