Skip to content

Proposed fix for issue #5#6

Open
nonspecialist wants to merge 3 commits into
masterfrom
issue/5
Open

Proposed fix for issue #5#6
nonspecialist wants to merge 3 commits into
masterfrom
issue/5

Conversation

@nonspecialist
Copy link
Copy Markdown

  • Determine whether an RDS resource is a cluster prior to snapshotting
  • use the appropriate snapshot method

- missing `self` call
- removed exception for flow control.
Copy link
Copy Markdown
Contributor

@stevemac007 stevemac007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed updates and additional tests to cover the new code.

I'm happy with it now, hopefully @wobeng will be able to validate this works as expected once its merged.

Comment thread lambda/backuplambda.py Outdated

def is_cluster(self, resource):
try:
return resource['DBClusterIdentifier'] is not None
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do this as

return 'DBClusterIdentifier' in resource

And not need the try except.

Comment thread lambda/backuplambda.py Outdated
current_snap = self.conn.create_db_snapshot(DBInstanceIdentifier=self.resolve_backupable_id(resource),
DBSnapshotIdentifier=snapshot_id,
Tags=aws_tagset)
if is_cluster(resource):
Copy link
Copy Markdown
Contributor

@stevemac007 stevemac007 Aug 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.is_cluster(resource):

@stevemac007
Copy link
Copy Markdown
Contributor

Looking further into the API I think this is a bit more complex than the current approach supports. I might have to actually build a cluster and see what responses come back from AWS to make it work.

@wobeng
Copy link
Copy Markdown
Contributor

wobeng commented Aug 23, 2017

Take a look at #8 . It has db cluster support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants