New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove get_cfn_attribute from legacy models #8717
Conversation
b6b6d47
to
314b827
Compare
if "." in attribute_name: | ||
parts = attribute_name.split(".") | ||
attribute = self.props | ||
for part in parts: | ||
attribute = attribute.get(part) | ||
return attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just temporary, since this whole method will soon be removed. this will enable resolving properties like Outputs.NestedStackOutputA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!!
# def fetch_state(self, stack_name, resources): | ||
# client = connect_to().cloudformation | ||
# child_stack_name = self.props["StackName"] | ||
# result = client.describe_stacks(StackName=child_stack_name) | ||
# result = (result.get("Stacks") or [None])[0] | ||
# return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out for now, I'll probably churn through the models and check where we can delete fetch_state implementations after the two PRs are merged 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, glad to see we can get rid of the custom get_cfn_attribute
handling and move towards the resource provider way of doing things
Removes all usage of
get_cfn_attribute
from the community resource models.It does not yet introduce a subset selection for the migrated resources to stay in parity with the previous behavior for now where we nearly always fall back to a direct property/state lookup.
A follow-up PR will soon remove the base method from the GenericBaseModel and unify the code paths between old and legacy providers.